convex-selections
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"exports": { | ||
@@ -29,3 +29,3 @@ ".": "./index.js", | ||
"merge": "^2.1.1", | ||
"object-hash": "^3.0.0", | ||
"sha-anything": "^0.0.4", | ||
"pathe": "^1.1.1", | ||
@@ -40,3 +40,2 @@ "sort-keys": "^5.0.0", | ||
"@types/node": "^20.7.1", | ||
"@types/object-hash": "^3.0.4", | ||
"typescript": "^5.2.2", | ||
@@ -43,0 +42,0 @@ "lionconfig": "^3.1.1" |
@@ -10,3 +10,3 @@ #!/usr/bin/env -S pnpm exec tsx | ||
import json5 from 'json5'; | ||
import hash from 'object-hash'; | ||
import { sha256 } from 'sha-anything'; | ||
import path from 'pathe'; | ||
@@ -153,3 +153,3 @@ import sortKeys from 'sort-keys'; | ||
for (const selectionObject of selectionObjects) { | ||
selectionHashes[hash.sha1(selectionObject)] = selectionObject; | ||
selectionHashes[await sha256(selectionObject)] = selectionObject; | ||
} | ||
@@ -160,3 +160,3 @@ // Add our complex selections | ||
const selection = selectionDefinition(); | ||
selectionHashes[hash.sha1(selection)] = selection; | ||
selectionHashes[await sha256(selection)] = selection; | ||
} | ||
@@ -163,0 +163,0 @@ } |
@@ -1,8 +0,8 @@ | ||
import hash from 'object-hash'; | ||
import { sha256 } from 'sha-anything'; | ||
export function createWithSelection({ selectionHashes }) { | ||
return function withSelection(cb, selection) { | ||
const selectionHash = hash.sha1(selection); | ||
return async function withSelection(cb, selection) { | ||
const selectionHash = await sha256(selection); | ||
if (selectionHashes[selectionHash] === undefined) { | ||
// eslint-disable-next-line no-console -- bruh | ||
console.error('Selection not found in selectionHashes', selection); | ||
console.error('Selection not found in selectionHashes', selection, `(hash: ${selectionHash})`); | ||
throw new Error(`Selection hash ${selectionHash} not found in selectionHashes`); | ||
@@ -9,0 +9,0 @@ } |
32678
5
+ Addedsha-anything@^0.0.4
+ Addedcrypto-hash@2.0.1(transitive)
+ Addedfast-sort@3.4.1(transitive)
+ Addedis-what@4.1.16(transitive)
+ Addedsha-anything@0.0.4(transitive)
- Removedobject-hash@^3.0.0
- Removedobject-hash@3.0.0(transitive)