@stryke/hash 0.9.1 → 0.9.3

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/README.md CHANGED
@@ -22,7 +22,7 @@ This package is part of Storm Software's **đŸŒŠī¸ Stryke** monorepo. Stryke pac
22
22
 
23
23
  <h3 align="center">đŸ’ģ Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
24
24
 
25
- [![Version](https://img.shields.io/badge/version-0.9.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
+ [![Version](https://img.shields.io/badge/version-0.9.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
26
26
 
27
27
  > [!IMPORTANT] This repository, and the apps, libraries, and tools contained
28
28
  > within, is still in it's initial development phase. As a result, bugs and
@@ -8,12 +8,12 @@ exports.hashFiles = hashFiles;
8
8
  var _listFiles = require("@stryke/fs/list-files");
9
9
  var _readFile = require("@stryke/fs/read-file");
10
10
  var _hash = require("./hash.cjs");
11
- async function hashFiles(i, s) {
12
- const t = {};
13
- return await Promise.all(i.map(async r => {
14
- t[r] = await (0, _readFile.readFile)(r);
15
- })), (0, _hash.hash)(t, s);
11
+ async function hashFiles(t, s) {
12
+ const r = {};
13
+ return await Promise.all(t.map(async i => {
14
+ r[i] = await (0, _readFile.readFile)(i);
15
+ })), (0, _hash.hash)(r, s);
16
16
  }
17
- async function hashDirectory(i, s = {}) {
18
- return s.ignored = s.ignored ?? ["**/node_modules/**", "**/.git/**", "**/.nx/**", "**/.cache/**", "**/.storm/**", "**/tmp/**"], hashFiles(await (0, _listFiles.listFiles)(i, s), s);
17
+ async function hashDirectory(t, s = {}) {
18
+ return s.ignore = s.ignore ?? ["**/node_modules/**", "**/.git/**", "**/.nx/**", "**/.cache/**", "**/.storm/**", "**/tmp/**"], hashFiles(await (0, _listFiles.listFiles)(t, s), s);
19
19
  }
@@ -1,6 +1,5 @@
1
- import type { ListFilesOptions } from "@stryke/fs/list-files";
1
+ import type { ListOptions } from "@stryke/fs/list-files";
2
2
  import type { HashOptions } from "./hash";
3
- export type HashFilesOptions = HashOptions & ListFilesOptions;
4
3
  /**
5
4
  * Hash a list of file paths into a string based on the file content
6
5
  *
@@ -8,7 +7,7 @@ export type HashFilesOptions = HashOptions & ListFilesOptions;
8
7
  * @param options - Hashing options
9
8
  * @returns A hashed string value
10
9
  */
11
- export declare function hashFiles(files: string[], options?: HashFilesOptions): Promise<string>;
10
+ export declare function hashFiles(files: string[], options?: HashOptions): Promise<string>;
12
11
  /**
13
12
  * Hash a folder path into a string based on the file content
14
13
  *
@@ -16,4 +15,4 @@ export declare function hashFiles(files: string[], options?: HashFilesOptions):
16
15
  * @param options - Hashing options. By default, the `node_modules`, `.git`, `.nx`, `.cache`, and `tmp` folders is ignored.
17
16
  * @returns A hashed string value
18
17
  */
19
- export declare function hashDirectory(directoryPath: string, options?: HashFilesOptions): Promise<string>;
18
+ export declare function hashDirectory(directoryPath: string, options?: HashOptions & ListOptions): Promise<string>;
@@ -1 +1 @@
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)}
1
+ import{listFiles as o}from"@stryke/fs/list-files";import{readFile as e}from"@stryke/fs/read-file";import{hash as n}from"./hash";export async function hashFiles(t,s){const r={};return await Promise.all(t.map(async i=>{r[i]=await e(i)})),n(r,s)}export async function hashDirectory(t,s={}){return s.ignore=s.ignore??["**/node_modules/**","**/.git/**","**/.nx/**","**/.cache/**","**/.storm/**","**/tmp/**"],hashFiles(await o(t,s),s)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/hash",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "type": "module",
5
5
  "description": "A package containing utility functions that hash data using various algorithms.",
6
6
  "repository": {
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "js-xxhash": "^4.0.0",
14
14
  "ohash": "^2.0.11",
15
- "@stryke/fs": "^0.11.2"
15
+ "@stryke/fs": "^0.12.1"
16
16
  },
17
17
  "publishConfig": { "access": "public" },
18
18
  "devDependencies": {},