Skip to content

Commit 3d76f19

Browse files
committed
Add suggestions @mattbishop
1 parent b88e261 commit 3d76f19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cf/polyfills.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const crypto = {
4949
update: x => ({
5050
digest: () => {
5151
if (type !== 'sha256')
52-
throw Error('createHash only supports sha256 on cloudflare.')
52+
throw Error('createHash only supports sha256 in this environment.')
5353
if (!(x instanceof Uint8Array))
5454
x = textEncoder.encode(x)
5555
return Crypto.subtle.digest('SHA-256', x)
@@ -87,7 +87,7 @@ export const fs = {
8787
}
8888

8989
export const net = {
90-
isIP: (x) => RegExp.prototype.test.call(IPv4Reg, x) ? 4 : RegExp.prototype.test.call(IPv6Reg, x) ? 6 : 0,
90+
isIP: (x) => IPv4Reg.test(x) ? 4 : IPv6Reg.test(x) ? 6 : 0,
9191
Socket
9292
}
9393

0 commit comments

Comments
 (0)