@politie/sherlock-proxy 3.4.14 → 3.4.16

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.
@@ -1 +1 @@
1
- {"version":3,"file":"sherlock-proxy.esm.min.js","names":["IS_DERIVABLE_PROXY","Symbol","isDerivableProxy","obj","ProxyDescriptor","this","$$derivable","undefined","Object","defineProperty","prototype","pd","$proxyDescriptor","target","proxyLens","get","set","isSettableDerivable","lens","newValue","targetValue","call","autoCache","derive","createDerivable","$target","$lens","$derivable","e","assign","Error","$expression","_internal","isError","message","jse_cause","atom","expression","$create","path","descriptor","utils","clone","getOwnPropertyNames","filter","prop","startsWith","forEach","$path","Proxy","proxyHandler","$pluck","pluck","extendExpression","extendPath","$pluckableKeys","value","$value","Reflect","ownKeys","$length","maybeArray","$targetValue","Array","isArray","length","$and","other","and","unwrapProxy","$or","or","$not","not","$is","is","$derive","apply","arguments","$react","reaction","options","react","toJSON","toStringTag","iterator","i","_a","sent","receiver","isPluckableProperty","plucked","isDerivable","has","getOwnPropertyDescriptor","configurable","enumerable","property","test","replace","concat"],"sources":["../../extensions/sherlock-proxy/proxy.ts"],"sourcesContent":["import { Derivable, isDerivable, isSettableDerivable, lens, ReactorOptions, utils, _internal } from '@politie/sherlock';\n\n/**\n * The base interface for DerivableProxies. Defines only the $-properties and $-methods. Any property accessed with a number or\n * that doesn't start with a $-sign returns a new DerivableProxy.\n */\nexport interface DerivableProxy<V> {\n /** The current value that this Proxy represents. Can be expensive to calculate and is often writable. */\n $value: V;\n\n /** A string representation of this proxy's path from the root ProxyDescriptor. */\n $expression?: string;\n\n /**\n * An array representation of this proxy's path from the root ProxyDescriptor. Useful for programatically walking down the root\n * Descriptor's object tree to reacquire a target proxy.\n */\n $path?: Array<string | number>;\n\n /** {@see Derivable#and} */\n $and<W>(other: MaybePacked<W>): Derivable<V | W>;\n\n /** {@see Derivable#or} */\n $or<W>(other: MaybePacked<W>): Derivable<V | W>;\n\n /** {@see Derivable#not} */\n $not(): Derivable<boolean>;\n\n /** {@see Derivable#is} */\n $is(other: MaybePacked<any>): Derivable<boolean>;\n\n /** {@see Derivable#derive} */\n $derive<R>(f: (v: V) => R): Derivable<R>;\n $derive<R, P1>(f: (v: V, p1: P1) => R, p1: MaybePacked<P1>): Derivable<R>;\n $derive<R, P1, P2>(f: (v: V, p1: P1, p2: P2) => R, p1: MaybePacked<P1>, p2: MaybePacked<P2>): Derivable<R>;\n $derive<R, P>(f: (v: V, ...ps: P[]) => R, ...ps: Array<MaybePacked<P>>): Derivable<R>;\n\n /** {@see Derivable#react} */\n $react(reaction: (value: V, stop: () => void) => void, options?: Partial<ReactorOptions<V>>): () => void;\n}\n\nconst IS_DERIVABLE_PROXY = Symbol('isDerivableProxy');\n\n/**\n * Returns whether obj is a DerivableProxy.\n *\n * @param obj the object to test\n */\nexport function isDerivableProxy(obj: any): obj is DerivableProxy<any> {\n return obj[IS_DERIVABLE_PROXY] === true;\n}\n\n/**\n * A ProxyDescriptor must be used to create DerivableProxies. It can be used in two ways, either create a new descriptor and\n * change any implementation details (if needed) or create a subclass to extend the behavior. Use the {@link #$create} method\n * to create a DerivableProxy.\n *\n * Note that `this` in methods points to the created proxy, so only methods and properties that start with a $-sign can be accessed\n * without trouble.\n *\n * Note also that properties that start with two $-signs are cleared on $create.\n */\nexport class ProxyDescriptor<V = any, T = V> {\n /**\n * The target derivable (the input to the proxy and the {@link #$create} method). The actual values that can be seen by methods\n * on the Proxy can be influenced by providing a {@link #$lens}.\n */\n $target!: Derivable<T>;\n\n /**\n * The expression that represents the path to the current Proxy.\n */\n $expression?: string;\n\n /**\n * The path to the current Proxy.\n */\n $path?: Array<string | number>;\n\n /**\n * The derivable that is the input to all default methods on the Proxy and the {@link #$value} property.\n */\n get $derivable(): Derivable<V> {\n const pd = this.$proxyDescriptor;\n return pd.$$derivable || (pd.$$derivable = createDerivable(pd.$target, pd.$lens && pd.$lens()));\n }\n private $$derivable?: Derivable<V> = undefined;\n\n /**\n * The current value of the DerivableProxy. Can be expensive to calculate. When the target is settable (is an Atom) then $value\n * is writable.\n */\n get $value() {\n const pd = this.$proxyDescriptor;\n try {\n return pd.$derivable.get();\n } catch (e) {\n // istanbul ignore next: for debug purposes\n throw Object.assign(new Error(`error while getting ${pd.$expression || '$value'}: ${_internal.isError(e) && e.message}`), { jse_cause: e });\n }\n }\n set $value(newValue) {\n const pd = this.$proxyDescriptor;\n const atom = pd.$derivable;\n const expression = pd.$expression;\n if (!isSettableDerivable(atom)) {\n throw new Error(`${expression || '$value'} is readonly`);\n }\n try {\n atom.set(newValue);\n } catch (e) {\n throw Object.assign(new Error(`error while setting ${expression || '$value'}: ${_internal.isError(e) && e.message}`), { jse_cause: e });\n }\n }\n\n /**\n * The current value of the target Derivable that was used to create the DerivableProxy.\n */\n get $targetValue() {\n const pd = this.$proxyDescriptor;\n try {\n return pd.$target.get();\n } catch (e) {\n // istanbul ignore next: for debug purposes\n throw Object.assign(\n new Error(`error while getting ${pd.$expression || '$targetValue'}: ${_internal.isError(e) && e.message}`),\n { jse_cause: e },\n );\n }\n }\n set $targetValue(newValue) {\n const pd = this.$proxyDescriptor;\n const atom = pd.$target;\n const expression = pd.$expression;\n if (!isSettableDerivable(atom)) {\n throw new Error(`${expression || '$targetValue'} is readonly`);\n }\n try {\n atom.set(newValue);\n } catch (e) {\n throw Object.assign(new Error(`error while setting ${expression || '$targetValue'}: ${_internal.isError(e) && e.message}`), { jse_cause: e });\n }\n }\n\n /**\n * In methods of a ProxyDescriptor, `this` is bound to the Proxy Object. Therefore, only $-properties and $-methods can be\n * accessed safely. Use $proxyDescriptor to get access to the ProxyDescriptor Object to prevent the ProxyHandler from messing\n * with your logic.\n */\n protected get $proxyDescriptor() { return this; }\n\n /**\n * An optional method that can return an optional lens to this proxy. Is used to transform the values before accessed by the\n * consumer of the Proxy (either through $value or one of the other methods).\n */\n $lens?(): DerivableProxyLens<T, V> | undefined;\n\n /**\n * Wrap a Derivable as DerivableProxy using this ProxyDescriptor.\n *\n * @param obj the object to wrap\n * @param expression the new expression to the created DerivableProxy\n * @param path the new path to the created DerivableProxy\n */\n $create(obj: Derivable<T>, expression?: string, path?: Array<string | number>): DerivableProxy<V> {\n const descriptor: ProxyDescriptor = utils.clone(this.$proxyDescriptor);\n descriptor.$target = obj;\n Object.getOwnPropertyNames(descriptor)\n .filter(prop => prop.startsWith('$$'))\n .forEach(prop => descriptor[prop] = undefined);\n descriptor.$expression = expression;\n descriptor.$path = path;\n return new Proxy(descriptor, proxyHandler) as any;\n }\n\n /**\n * The $pluck method is the implementation of the pluck mechanism of DerivableProxy. Replace this method to change the\n * pluck behavior. It should return a DerivableProxy.\n *\n * @param prop the property to pluck of the wrapped derivable\n */\n $pluck(prop: string | number): DerivableProxy<V> {\n const pd = this.$proxyDescriptor;\n return pd.$create(pd.$derivable.pluck(prop), extendExpression(pd.$expression, prop), extendPath(pd.$path, prop));\n }\n\n /**\n * The $pluckableKeys returns a list of properties that can be plucked from this object. Returned keys are guaranteed to\n * result in a usable DerivableProxy when used with $pluck. Is used for `for ... in` and `Object.keys(...)` logic.\n */\n $pluckableKeys() {\n const value = this.$proxyDescriptor.$value;\n return typeof value === 'object' ? Reflect.ownKeys(value as any) : [];\n }\n\n /**\n * Method that determines whether the current object is iterable and if so, how many elements it contains. During iteration\n * {@link #pluck} is called with indices up to but not including the result of `$length()`.\n */\n $length(): number | undefined {\n const maybeArray = this.$proxyDescriptor.$targetValue;\n return Array.isArray(maybeArray) ? maybeArray.length : undefined;\n }\n\n $and(other: MaybePacked<any>) {\n return this.$proxyDescriptor.$derivable.and(unwrapProxy(other));\n }\n\n $or(other: MaybePacked<any>) {\n return this.$proxyDescriptor.$derivable.or(unwrapProxy(other));\n }\n\n $not() {\n return this.$proxyDescriptor.$derivable.not();\n }\n\n $is(other: MaybePacked<any>) {\n return this.$proxyDescriptor.$derivable.is(unwrapProxy(other));\n }\n\n $derive() {\n const target = this.$proxyDescriptor.$derivable;\n return target.derive.apply(target, arguments as any);\n }\n\n $react(reaction: (value: V, stop: () => void) => void, options?: Partial<ReactorOptions<any>>): () => void {\n return this.$proxyDescriptor.$derivable.react(reaction, options);\n }\n\n toJSON() {\n return this.$proxyDescriptor.$value;\n }\n\n get [Symbol.toStringTag]() {\n return 'DerivableProxy';\n }\n\n *[Symbol.iterator](): IterableIterator<DerivableProxy<V>> {\n const pd = this.$proxyDescriptor;\n const length = pd.$length();\n if (length === undefined) {\n const expression = pd.$expression;\n throw Object.assign(new Error(`${expression || 'object'} is not iterable`), { value: pd.$value, expression });\n }\n for (let i = 0; i < length; i++) {\n yield pd.$pluck(i)!;\n }\n }\n\n get length() {\n return this.$proxyDescriptor.$length();\n }\n}\nProxyDescriptor.prototype[IS_DERIVABLE_PROXY] = true;\n\nfunction createDerivable<V, T>(target: Derivable<T>, proxyLens?: DerivableProxyLens<T, V>): Derivable<V> {\n if (!proxyLens) {\n return target as any;\n }\n const { get, set } = proxyLens;\n if (!set || !isSettableDerivable(target)) {\n return target.derive(get).autoCache();\n }\n return lens({\n get,\n set(newValue, targetValue) {\n target.set(set.call(this, newValue, targetValue));\n }\n }, target).autoCache();\n}\n\nexport interface DerivableProxyLens<T, V> {\n get: (targetValue: T) => V;\n set?: (newValue: V, targetValue: T | undefined) => T;\n}\n\nexport type MaybePacked<T> = T | Derivable<T> | DerivableProxy<T>;\n\nexport function unwrapProxy<W>(obj: MaybePacked<W>): W | Derivable<W> {\n if (isDerivableProxy(obj)) {\n return (obj as any).$derivable;\n }\n return obj;\n}\n\nconst proxyHandler: ProxyHandler<ProxyDescriptor> = {\n get(target, prop, receiver) {\n if (prop === '$proxyDescriptor') {\n return target;\n }\n if (isPluckableProperty(target, prop)) {\n return target.$pluck.call(receiver, prop as string | number);\n }\n return Reflect.get(target, prop, receiver);\n },\n set(target, prop, newValue, receiver) {\n if (isPluckableProperty(target, prop)) {\n const plucked = target.$pluck.call(receiver, prop as string | number) as ProxyDescriptor;\n if (newValue && isDerivableProxy(newValue)) {\n plucked.$targetValue = (newValue as any).$targetValue;\n } else {\n plucked.$value = newValue && isDerivable(newValue) ? newValue.get() : newValue;\n }\n return true;\n }\n return Reflect.set(target, prop, newValue, receiver);\n },\n has(target, prop) {\n if (prop === Symbol.iterator) {\n return target.$length() !== undefined;\n }\n return isPluckableProperty(target, prop);\n },\n getOwnPropertyDescriptor(target, prop) {\n if (isPluckableProperty(target, prop)) {\n return {\n get() { return this[prop]; },\n set(newValue) { this[prop] = newValue; },\n configurable: true,\n enumerable: true,\n };\n }\n return undefined;\n },\n ownKeys(target) {\n return target.$pluckableKeys();\n },\n};\n\nfunction isPluckableProperty(target: ProxyDescriptor, prop: PropertyKey) {\n return typeof prop === 'number' || typeof prop === 'string' && prop[0] !== '$' && !Reflect.has(target, prop);\n}\n\n/**\n * Extends an expression with a property access. Automatically uses bracket notation where appropriate and escapes\n * strings in brackets to give a realistic combined expression.\n *\n * @param expression the (optional) expression to extend\n * @param property the property that should be appended to the expression\n */\nexport function extendExpression(expression = '', property: string | number) {\n if (typeof property === 'string' && /^[a-z_][a-z_0-9]*$/i.test(property)) {\n return expression + '.' + property;\n }\n if (typeof property === 'string') {\n return expression + '[\"' + property.replace(/\\\\/g, '\\\\\\\\').replace(/\\\"/g, '\\\\\"') + '\"]';\n }\n return expression + '[' + property + ']';\n}\n\n/**\n * Extends a path with a property access.\n *\n * @param path the (optional) path to extend\n * @param property the property that should be appended to the path\n */\nexport function extendPath(path: Array<string | number> = [], property: string | number) {\n return path.concat(property);\n}\n"],"mappings":"iJAyCA,IAAMA,EAAqBC,OAAO,oB,SAOlBC,EAAiBC,GAC7B,OAAmC,IAA5BA,EAAIH,EACf,C,iBAYA,SAAAI,IAwBYC,KAAAC,iBAA6BC,C,CAsKzC,OA1KIC,OAAAC,eAAIL,EAAAM,UAAA,aAAU,C,IAAd,WACI,IAAMC,EAAKN,KAAKO,iBAChB,OAAOD,EAAGL,cAAgBK,EAAGL,YA2KrC,SAA+BO,EAAsBC,GACjD,IAAKA,E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":["IS_DERIVABLE_PROXY","Symbol","isDerivableProxy","obj","ProxyDescriptor","this","$$derivable","undefined","Object","defineProperty","prototype","get","pd","$proxyDescriptor","target","proxyLens","set","isSettableDerivable","lens","newValue","targetValue","call","autoCache","derive","createDerivable","$target","$lens","$derivable","e","assign","Error","concat","$expression","_internal","isError","message","jse_cause","atom","expression","$create","path","descriptor","utils","clone","getOwnPropertyNames","filter","prop","startsWith","forEach","$path","Proxy","proxyHandler","$pluck","pluck","extendExpression","extendPath","$pluckableKeys","value","$value","Reflect","ownKeys","$length","maybeArray","$targetValue","Array","isArray","length","$and","other","and","unwrapProxy","$or","or","$not","not","$is","is","$derive","apply","arguments","$react","reaction","options","react","toJSON","toStringTag","iterator","i","_a","sent","receiver","isPluckableProperty","plucked","isDerivable","has","getOwnPropertyDescriptor","configurable","enumerable","property","test","replace"],"sources":["../../extensions/sherlock-proxy/proxy.ts"],"sourcesContent":["import { Derivable, isDerivable, isSettableDerivable, lens, ReactorOptions, utils, _internal } from '@politie/sherlock';\n\n/**\n * The base interface for DerivableProxies. Defines only the $-properties and $-methods. Any property accessed with a number or\n * that doesn't start with a $-sign returns a new DerivableProxy.\n */\nexport interface DerivableProxy<V> {\n /** The current value that this Proxy represents. Can be expensive to calculate and is often writable. */\n $value: V;\n\n /** A string representation of this proxy's path from the root ProxyDescriptor. */\n $expression?: string;\n\n /**\n * An array representation of this proxy's path from the root ProxyDescriptor. Useful for programatically walking down the root\n * Descriptor's object tree to reacquire a target proxy.\n */\n $path?: Array<string | number>;\n\n /** {@see Derivable#and} */\n $and<W>(other: MaybePacked<W>): Derivable<V | W>;\n\n /** {@see Derivable#or} */\n $or<W>(other: MaybePacked<W>): Derivable<V | W>;\n\n /** {@see Derivable#not} */\n $not(): Derivable<boolean>;\n\n /** {@see Derivable#is} */\n $is(other: MaybePacked<any>): Derivable<boolean>;\n\n /** {@see Derivable#derive} */\n $derive<R>(f: (v: V) => R): Derivable<R>;\n $derive<R, P1>(f: (v: V, p1: P1) => R, p1: MaybePacked<P1>): Derivable<R>;\n $derive<R, P1, P2>(f: (v: V, p1: P1, p2: P2) => R, p1: MaybePacked<P1>, p2: MaybePacked<P2>): Derivable<R>;\n $derive<R, P>(f: (v: V, ...ps: P[]) => R, ...ps: Array<MaybePacked<P>>): Derivable<R>;\n\n /** {@see Derivable#react} */\n $react(reaction: (value: V, stop: () => void) => void, options?: Partial<ReactorOptions<V>>): () => void;\n}\n\nconst IS_DERIVABLE_PROXY = Symbol('isDerivableProxy');\n\n/**\n * Returns whether obj is a DerivableProxy.\n *\n * @param obj the object to test\n */\nexport function isDerivableProxy(obj: any): obj is DerivableProxy<any> {\n return obj[IS_DERIVABLE_PROXY] === true;\n}\n\n/**\n * A ProxyDescriptor must be used to create DerivableProxies. It can be used in two ways, either create a new descriptor and\n * change any implementation details (if needed) or create a subclass to extend the behavior. Use the {@link #$create} method\n * to create a DerivableProxy.\n *\n * Note that `this` in methods points to the created proxy, so only methods and properties that start with a $-sign can be accessed\n * without trouble.\n *\n * Note also that properties that start with two $-signs are cleared on $create.\n */\nexport class ProxyDescriptor<V = any, T = V> {\n /**\n * The target derivable (the input to the proxy and the {@link #$create} method). The actual values that can be seen by methods\n * on the Proxy can be influenced by providing a {@link #$lens}.\n */\n $target!: Derivable<T>;\n\n /**\n * The expression that represents the path to the current Proxy.\n */\n $expression?: string;\n\n /**\n * The path to the current Proxy.\n */\n $path?: Array<string | number>;\n\n /**\n * The derivable that is the input to all default methods on the Proxy and the {@link #$value} property.\n */\n get $derivable(): Derivable<V> {\n const pd = this.$proxyDescriptor;\n return pd.$$derivable || (pd.$$derivable = createDerivable(pd.$target, pd.$lens && pd.$lens()));\n }\n private $$derivable?: Derivable<V> = undefined;\n\n /**\n * The current value of the DerivableProxy. Can be expensive to calculate. When the target is settable (is an Atom) then $value\n * is writable.\n */\n get $value() {\n const pd = this.$proxyDescriptor;\n try {\n return pd.$derivable.get();\n } catch (e) {\n // istanbul ignore next: for debug purposes\n throw Object.assign(new Error(`error while getting ${pd.$expression || '$value'}: ${_internal.isError(e) && e.message}`), { jse_cause: e });\n }\n }\n set $value(newValue) {\n const pd = this.$proxyDescriptor;\n const atom = pd.$derivable;\n const expression = pd.$expression;\n if (!isSettableDerivable(atom)) {\n throw new Error(`${expression || '$value'} is readonly`);\n }\n try {\n atom.set(newValue);\n } catch (e) {\n throw Object.assign(new Error(`error while setting ${expression || '$value'}: ${_internal.isError(e) && e.message}`), { jse_cause: e });\n }\n }\n\n /**\n * The current value of the target Derivable that was used to create the DerivableProxy.\n */\n get $targetValue() {\n const pd = this.$proxyDescriptor;\n try {\n return pd.$target.get();\n } catch (e) {\n // istanbul ignore next: for debug purposes\n throw Object.assign(\n new Error(`error while getting ${pd.$expression || '$targetValue'}: ${_internal.isError(e) && e.message}`),\n { jse_cause: e },\n );\n }\n }\n set $targetValue(newValue) {\n const pd = this.$proxyDescriptor;\n const atom = pd.$target;\n const expression = pd.$expression;\n if (!isSettableDerivable(atom)) {\n throw new Error(`${expression || '$targetValue'} is readonly`);\n }\n try {\n atom.set(newValue);\n } catch (e) {\n throw Object.assign(new Error(`error while setting ${expression || '$targetValue'}: ${_internal.isError(e) && e.message}`), { jse_cause: e });\n }\n }\n\n /**\n * In methods of a ProxyDescriptor, `this` is bound to the Proxy Object. Therefore, only $-properties and $-methods can be\n * accessed safely. Use $proxyDescriptor to get access to the ProxyDescriptor Object to prevent the ProxyHandler from messing\n * with your logic.\n */\n protected get $proxyDescriptor() { return this; }\n\n /**\n * An optional method that can return an optional lens to this proxy. Is used to transform the values before accessed by the\n * consumer of the Proxy (either through $value or one of the other methods).\n */\n $lens?(): DerivableProxyLens<T, V> | undefined;\n\n /**\n * Wrap a Derivable as DerivableProxy using this ProxyDescriptor.\n *\n * @param obj the object to wrap\n * @param expression the new expression to the created DerivableProxy\n * @param path the new path to the created DerivableProxy\n */\n $create(obj: Derivable<T>, expression?: string, path?: Array<string | number>): DerivableProxy<V> {\n const descriptor: ProxyDescriptor = utils.clone(this.$proxyDescriptor);\n descriptor.$target = obj;\n Object.getOwnPropertyNames(descriptor)\n .filter(prop => prop.startsWith('$$'))\n .forEach(prop => descriptor[prop] = undefined);\n descriptor.$expression = expression;\n descriptor.$path = path;\n return new Proxy(descriptor, proxyHandler) as any;\n }\n\n /**\n * The $pluck method is the implementation of the pluck mechanism of DerivableProxy. Replace this method to change the\n * pluck behavior. It should return a DerivableProxy.\n *\n * @param prop the property to pluck of the wrapped derivable\n */\n $pluck(prop: string | number): DerivableProxy<V> {\n const pd = this.$proxyDescriptor;\n return pd.$create(pd.$derivable.pluck(prop), extendExpression(pd.$expression, prop), extendPath(pd.$path, prop));\n }\n\n /**\n * The $pluckableKeys returns a list of properties that can be plucked from this object. Returned keys are guaranteed to\n * result in a usable DerivableProxy when used with $pluck. Is used for `for ... in` and `Object.keys(...)` logic.\n */\n $pluckableKeys() {\n const value = this.$proxyDescriptor.$value;\n return typeof value === 'object' ? Reflect.ownKeys(value as any) : [];\n }\n\n /**\n * Method that determines whether the current object is iterable and if so, how many elements it contains. During iteration\n * {@link #pluck} is called with indices up to but not including the result of `$length()`.\n */\n $length(): number | undefined {\n const maybeArray = this.$proxyDescriptor.$targetValue;\n return Array.isArray(maybeArray) ? maybeArray.length : undefined;\n }\n\n $and(other: MaybePacked<any>) {\n return this.$proxyDescriptor.$derivable.and(unwrapProxy(other));\n }\n\n $or(other: MaybePacked<any>) {\n return this.$proxyDescriptor.$derivable.or(unwrapProxy(other));\n }\n\n $not() {\n return this.$proxyDescriptor.$derivable.not();\n }\n\n $is(other: MaybePacked<any>) {\n return this.$proxyDescriptor.$derivable.is(unwrapProxy(other));\n }\n\n $derive() {\n const target = this.$proxyDescriptor.$derivable;\n return target.derive.apply(target, arguments as any);\n }\n\n $react(reaction: (value: V, stop: () => void) => void, options?: Partial<ReactorOptions<any>>): () => void {\n return this.$proxyDescriptor.$derivable.react(reaction, options);\n }\n\n toJSON() {\n return this.$proxyDescriptor.$value;\n }\n\n get [Symbol.toStringTag]() {\n return 'DerivableProxy';\n }\n\n *[Symbol.iterator](): IterableIterator<DerivableProxy<V>> {\n const pd = this.$proxyDescriptor;\n const length = pd.$length();\n if (length === undefined) {\n const expression = pd.$expression;\n throw Object.assign(new Error(`${expression || 'object'} is not iterable`), { value: pd.$value, expression });\n }\n for (let i = 0; i < length; i++) {\n yield pd.$pluck(i)!;\n }\n }\n\n get length() {\n return this.$proxyDescriptor.$length();\n }\n}\nProxyDescriptor.prototype[IS_DERIVABLE_PROXY] = true;\n\nfunction createDerivable<V, T>(target: Derivable<T>, proxyLens?: DerivableProxyLens<T, V>): Derivable<V> {\n if (!proxyLens) {\n return target as any;\n }\n const { get, set } = proxyLens;\n if (!set || !isSettableDerivable(target)) {\n return target.derive(get).autoCache();\n }\n return lens({\n get,\n set(newValue, targetValue) {\n target.set(set.call(this, newValue, targetValue));\n }\n }, target).autoCache();\n}\n\nexport interface DerivableProxyLens<T, V> {\n get: (targetValue: T) => V;\n set?: (newValue: V, targetValue: T | undefined) => T;\n}\n\nexport type MaybePacked<T> = T | Derivable<T> | DerivableProxy<T>;\n\nexport function unwrapProxy<W>(obj: MaybePacked<W>): W | Derivable<W> {\n if (isDerivableProxy(obj)) {\n return (obj as any).$derivable;\n }\n return obj;\n}\n\nconst proxyHandler: ProxyHandler<ProxyDescriptor> = {\n get(target, prop, receiver) {\n if (prop === '$proxyDescriptor') {\n return target;\n }\n if (isPluckableProperty(target, prop)) {\n return target.$pluck.call(receiver, prop as string | number);\n }\n return Reflect.get(target, prop, receiver);\n },\n set(target, prop, newValue, receiver) {\n if (isPluckableProperty(target, prop)) {\n const plucked = target.$pluck.call(receiver, prop as string | number) as ProxyDescriptor;\n if (newValue && isDerivableProxy(newValue)) {\n plucked.$targetValue = (newValue as any).$targetValue;\n } else {\n plucked.$value = newValue && isDerivable(newValue) ? newValue.get() : newValue;\n }\n return true;\n }\n return Reflect.set(target, prop, newValue, receiver);\n },\n has(target, prop) {\n if (prop === Symbol.iterator) {\n return target.$length() !== undefined;\n }\n return isPluckableProperty(target, prop);\n },\n getOwnPropertyDescriptor(target, prop) {\n if (isPluckableProperty(target, prop)) {\n return {\n get() { return this[prop]; },\n set(newValue) { this[prop] = newValue; },\n configurable: true,\n enumerable: true,\n };\n }\n return undefined;\n },\n ownKeys(target) {\n return target.$pluckableKeys();\n },\n};\n\nfunction isPluckableProperty(target: ProxyDescriptor, prop: PropertyKey) {\n return typeof prop === 'number' || typeof prop === 'string' && prop[0] !== '$' && !Reflect.has(target, prop);\n}\n\n/**\n * Extends an expression with a property access. Automatically uses bracket notation where appropriate and escapes\n * strings in brackets to give a realistic combined expression.\n *\n * @param expression the (optional) expression to extend\n * @param property the property that should be appended to the expression\n */\nexport function extendExpression(expression = '', property: string | number) {\n if (typeof property === 'string' && /^[a-z_][a-z_0-9]*$/i.test(property)) {\n return expression + '.' + property;\n }\n if (typeof property === 'string') {\n return expression + '[\"' + property.replace(/\\\\/g, '\\\\\\\\').replace(/\\\"/g, '\\\\\"') + '\"]';\n }\n return expression + '[' + property + ']';\n}\n\n/**\n * Extends a path with a property access.\n *\n * @param path the (optional) path to extend\n * @param property the property that should be appended to the path\n */\nexport function extendPath(path: Array<string | number> = [], property: string | number) {\n return path.concat(property);\n}\n"],"mappings":"iJAyCA,IAAMA,EAAqBC,OAAO,oBAO5B,SAAUC,EAAiBC,GAC7B,OAAmC,IAA5BA,EAAIH,EACf,CAYA,IAAAI,EAAA,oBAAAA,IAwBYC,KAAWC,iBAAkBC,C,CAsKzC,OA1KIC,OAAAC,eAAIL,EAAUM,UAAA,cAAdC,IAAA,WACI,IAAMC,EAAKP,KAAKQ,iBAChB,OAAOD,EAAGN,cAAgBM,EAAGN,YA2KrC,SAA+BQ,EAAsBC,GACjD,IAAKA,EACD,OAAOD,EAEH,IAAAH,EAAaI,EAASJ,IAAjBK,EAAQD,EAASC,IAC9B,OAAKA,GAAQC,EAAoBH,GAG1BI,EAAK,CACRP,IAAGA,EACHK,IAAG,SAACG,EAAUC,GACVN,E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