@stryke/hash 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hash-files.cjs +2 -2
- package/dist/hash-files.d.ts +1 -1
- package/dist/hash-files.mjs +1 -1
- package/dist/hash.cjs +1 -1
- package/dist/hash.mjs +1 -1
- package/package.json +3 -3
package/dist/hash-files.cjs
CHANGED
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.hashDirectory = hashDirectory;
|
|
7
7
|
exports.hashFiles = hashFiles;
|
|
8
|
-
var _listFiles = require("@stryke/fs/
|
|
9
|
-
var _readFile = require("@stryke/fs/
|
|
8
|
+
var _listFiles = require("@stryke/fs/list-files");
|
|
9
|
+
var _readFile = require("@stryke/fs/read-file");
|
|
10
10
|
var _hash = require("./hash.cjs");
|
|
11
11
|
async function hashFiles(i, s) {
|
|
12
12
|
const t = {};
|
package/dist/hash-files.d.ts
CHANGED
package/dist/hash-files.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{listFiles as e}from"@stryke/fs/
|
|
1
|
+
import{listFiles as e}from"@stryke/fs/list-files";import{readFile as o}from"@stryke/fs/read-file";import{hash as n}from"./hash";export async function hashFiles(i,s){const t={};return await Promise.all(i.map(async r=>{t[r]=await o(r)})),n(t,s)}export async function hashDirectory(i,s={}){return s.ignored=s.ignored??["**/node_modules/**","**/.git/**","**/.nx/**","**/.cache/**","**/.storm/**","**/tmp/**"],hashFiles(await e(i,s),s)}
|
package/dist/hash.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.hash = hash;
|
|
7
|
-
var _isString = require("@stryke/
|
|
7
|
+
var _isString = require("@stryke/type-checks/is-string");
|
|
8
8
|
var _hashObject = require("./hash-object.cjs");
|
|
9
9
|
var _sha = require("./sha-256.cjs");
|
|
10
10
|
function hash(t, e) {
|
package/dist/hash.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isString as r}from"@stryke/
|
|
1
|
+
import{isString as r}from"@stryke/type-checks/is-string";import{hashObject as h}from"./hash-object";import{sha256base64 as a}from"./sha-256";export function hash(t,e){const s=a(r(t)?t:h(t,e)),n=e?.maxLength??32;return s.length>n?s.slice(0,n):s}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/hash",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing utility functions that hash data using various algorithms.",
|
|
6
6
|
"repository": {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"private": false,
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"js-xxhash": "^4.0.0",
|
|
14
|
-
"@stryke/fs": ">=0.
|
|
15
|
-
"@stryke/
|
|
14
|
+
"@stryke/fs": ">=0.10.0",
|
|
15
|
+
"@stryke/type-checks": ">=0.1.0"
|
|
16
16
|
},
|
|
17
17
|
"publishConfig": { "access": "public" },
|
|
18
18
|
"devDependencies": {},
|