diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-08-25 13:24:08 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-08-25 13:24:08 +0200 |
commit | 5ab3070b3a63c2e8fed0e413dea06cf03fb48f1e (patch) | |
tree | 121425d99c9465f2daf8ac91c6dc2254ebac5906 /packages/idb-bridge/src/util/extractKey.ts | |
parent | 70fca92e781696a057089bc8bc48adebdf6e017e (diff) | |
parent | 2051aded501cddac1a4c869fb1f9731ac4523a1e (diff) |
Merge branch 'master' into age-withdraw
Diffstat (limited to 'packages/idb-bridge/src/util/extractKey.ts')
-rw-r--r-- | packages/idb-bridge/src/util/extractKey.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/idb-bridge/src/util/extractKey.ts b/packages/idb-bridge/src/util/extractKey.ts index 6a3d468ef..2a4ec45b9 100644 --- a/packages/idb-bridge/src/util/extractKey.ts +++ b/packages/idb-bridge/src/util/extractKey.ts @@ -19,7 +19,11 @@ import { IDBKeyPath, IDBValidKey } from "../idbtypes.js"; import { valueToKey } from "./valueToKey.js"; // http://www.w3.org/TR/2015/REC-IndexedDB-20150108/#dfn-steps-for-extracting-a-key-from-a-value-using-a-key-path +/** + * Algorithm to "extract a key from a value using a key path". + */ export const extractKey = (keyPath: IDBKeyPath | IDBKeyPath[], value: any) => { + //console.log(`extracting key ${JSON.stringify(keyPath)} from ${JSON.stringify(value)}`); if (Array.isArray(keyPath)) { const result: IDBValidKey[] = []; |