diff options
-rw-r--r-- | src/find-reverse.js | 9 | ||||
-rw-r--r-- | src/find.js | 11 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/find-reverse.js b/src/find-reverse.js index 47e0e268..5f8e2100 100644 --- a/src/find-reverse.js +++ b/src/find-reverse.js @@ -69,9 +69,6 @@ export function tokenProxy({ handle: customHandle = (_key) => undefined, - - decorate = - (_token, _key) => {}, }) { return new Proxy({}, { get: (store, key) => { @@ -91,10 +88,12 @@ export function tokenProxy({ }; store[key] = (...args) => behavior(...args); - decorate(store[key], key); + store[key][tokenKey] = key; } return store[key]; }, - }); + }); } + +export const tokenKey = Symbol.for('find.tokenKey'); diff --git a/src/find.js b/src/find.js index ec28ab15..d1435fb5 100644 --- a/src/find.js +++ b/src/find.js @@ -7,6 +7,12 @@ import {isFunction, validateArrayItems} from '#validators'; import * as fr from './find-reverse.js'; +import { + tokenKey as findTokenKey, +} from './find-reverse.js'; + +export {findTokenKey}; + function warnOrThrow(mode, message) { if (mode === 'error') { throw new Error(message); @@ -278,7 +284,6 @@ export function findFindSpec(key) { return fr.findSpec(key, findReverseHelperConfig); } -export const findTokenKey = Symbol.for('find.findTokenKey'); export const boundFindData = Symbol.for('find.boundFindData'); export const boundFindOptions = Symbol.for('find.boundFindOptions'); @@ -403,10 +408,6 @@ export default fr.tokenProxy({ return findMixed; } }, - - decorate(token, key) { - token[findTokenKey] = key; - }, }); // Handy utility function for binding the find.thing() functions to a complete |