Comparing version 4.0.0 to 4.1.0
@@ -1,3 +0,1 @@ | ||
import {Buffer} from 'node:buffer'; | ||
/** | ||
@@ -20,2 +18,2 @@ Create a hash for file revving. | ||
*/ | ||
export default function revisionHash(data: Buffer | string): string; | ||
export default function revisionHash(data: Uint8Array | string): string; |
import crypto from 'node:crypto'; | ||
import {Buffer} from 'node:buffer'; | ||
import {types} from 'node:util'; | ||
export default function revisionHash(data) { | ||
if (typeof data !== 'string' && !Buffer.isBuffer(data)) { | ||
throw new TypeError('Expected a Buffer or string'); | ||
if (typeof data !== 'string' && !types.isUint8Array(data)) { | ||
throw new TypeError('Expected a Uint8Array or string'); | ||
} | ||
@@ -8,0 +8,0 @@ |
{ | ||
"name": "rev-hash", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Create a hash for file revving", | ||
@@ -19,3 +19,4 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && ava && tsd" | ||
"//test": "xo && ava && tsd", | ||
"test": "ava && tsd" | ||
}, | ||
@@ -22,0 +23,0 @@ "files": [ |
@@ -34,4 +34,4 @@ # rev-hash | ||
Type: `Buffer | string` | ||
Type: `Uint8Array | string` | ||
The data to create a hash from. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3299
22