Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@politie/sherlock-proxy

Package Overview
Dependencies
Maintainers
11
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@politie/sherlock-proxy - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

6

package.json
{
"name": "@politie/sherlock-proxy",
"version": "3.1.0",
"version": "3.2.0",
"description": "A proxy extension to Sherlock.",

@@ -38,7 +38,7 @@ "main": "sherlock-proxy.cjs.js",

"dependencies": {
"tslib": "^1.9.0"
"tslib": "^2.2.0"
},
"peerDependencies": {
"@politie/sherlock": "3.1.0"
"@politie/sherlock": "3.2.0"
}
}

@@ -65,3 +65,3 @@ import { Derivable, ReactorOptions } from '@politie/sherlock';

*/
readonly $derivable: Derivable<V>;
get $derivable(): Derivable<V>;
private $$derivable?;

@@ -72,7 +72,9 @@ /**

*/
$value: V;
get $value(): V;
set $value(newValue: V);
/**
* The current value of the target Derivable that was used to create the DerivableProxy.
*/
$targetValue: T;
get $targetValue(): T;
set $targetValue(newValue: T);
/**

@@ -83,3 +85,3 @@ * In methods of a ProxyDescriptor, `this` is bound to the Proxy Object. Therefore, only $-properties and $-methods can be

*/
protected readonly $proxyDescriptor: this;
protected get $proxyDescriptor(): this;
/**

@@ -120,7 +122,7 @@ * An optional method that can return an optional lens to this proxy. Is used to transform the values before accessed by the

$derive(): Derivable<unknown>;
$react(reaction: (value: V) => void, options?: Partial<ReactorOptions<any>>): () => void;
$react(reaction: (value: V, stop: () => void) => void, options?: Partial<ReactorOptions<any>>): () => void;
toJSON(): V;
readonly [Symbol.toStringTag]: string;
get [Symbol.toStringTag](): string;
[Symbol.iterator](): IterableIterator<DerivableProxy<V>>;
readonly length: number | undefined;
get length(): number | undefined;
}

@@ -127,0 +129,0 @@ export interface DerivableProxyLens<T, V> {

@@ -39,3 +39,3 @@ 'use strict';

},
enumerable: true,
enumerable: false,
configurable: true

@@ -72,3 +72,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -104,3 +104,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -115,3 +115,3 @@ });

get: function () { return this; },
enumerable: true,
enumerable: false,
configurable: true

@@ -188,3 +188,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -222,3 +222,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -225,0 +225,0 @@ });

@@ -1,2 +0,2 @@

Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("@politie/sherlock"),e=Symbol("isDerivableProxy");function n(r){return!0===r[e]}var i=function(){function e(){this.$$derivable=void 0}return Object.defineProperty(e.prototype,"$derivable",{get:function(){var r=this.$proxyDescriptor;return r.$$derivable||(r.$$derivable=function(r,e){if(!e)return r;var n=e.get,i=e.set;return i&&t.isSettableDerivable(r)?t.lens({get:n,set:function(t,e){r.set(i.call(this,t,e))}},r).autoCache():r.derive(n).autoCache()}(r.$target,r.$lens&&r.$lens()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$value",{get:function(){var r=this.$proxyDescriptor;try{return r.$derivable.get()}catch(t){throw Object.assign(Error("error while getting "+(r.$expression||"$value")+": "+(t&&t.message)),{jse_cause:t})}},set:function(r){var e=this.$proxyDescriptor,n=e.$derivable,i=e.$expression;if(!t.isSettableDerivable(n))throw Error((i||"$value")+" is readonly");try{n.set(r)}catch(r){throw Object.assign(Error("error while setting "+(i||"$value")+": "+(r&&r.message)),{jse_cause:r})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$targetValue",{get:function(){var r=this.$proxyDescriptor;try{return r.$target.get()}catch(t){throw Object.assign(Error("error while getting "+(r.$expression||"$targetValue")+": "+(t&&t.message)),{jse_cause:t})}},set:function(r){var e=this.$proxyDescriptor,n=e.$target,i=e.$expression;if(!t.isSettableDerivable(n))throw Error((i||"$targetValue")+" is readonly");try{n.set(r)}catch(r){throw Object.assign(Error("error while setting "+(i||"$targetValue")+": "+(r&&r.message)),{jse_cause:r})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$proxyDescriptor",{get:function(){return this},enumerable:!0,configurable:!0}),e.prototype.$create=function(r,e,n){var i=t.utils.clone(this.$proxyDescriptor);return i.$target=r,Object.getOwnPropertyNames(i).filter((function(r){return r.startsWith("$$")})).forEach((function(r){return i[r]=void 0})),i.$expression=e,i.$path=n,new Proxy(i,o)},e.prototype.$pluck=function(r){var t=this.$proxyDescriptor;return t.$create(t.$derivable.pluck(r),s(t.$expression,r),a(t.$path,r))},e.prototype.$pluckableKeys=function(){var r=this.$proxyDescriptor.$value;return"object"==typeof r?Reflect.ownKeys(r):[]},e.prototype.$length=function(){var r=this.$proxyDescriptor.$targetValue;return Array.isArray(r)?r.length:void 0},e.prototype.$and=function(r){return this.$proxyDescriptor.$derivable.and(u(r))},e.prototype.$or=function(r){return this.$proxyDescriptor.$derivable.or(u(r))},e.prototype.$not=function(){return this.$proxyDescriptor.$derivable.not()},e.prototype.$is=function(r){return this.$proxyDescriptor.$derivable.is(u(r))},e.prototype.$derive=function(){var r=this.$proxyDescriptor.$derivable;return r.derive.apply(r,arguments)},e.prototype.$react=function(r,t){return this.$proxyDescriptor.$derivable.react(r,t)},e.prototype.toJSON=function(){return this.$proxyDescriptor.$value},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"DerivableProxy"},enumerable:!0,configurable:!0}),e.prototype[Symbol.iterator]=function(){var t,e,n,i;return r.__generator(this,(function(r){switch(r.label){case 0:if(t=this.$proxyDescriptor,void 0===(e=t.$length()))throw n=t.$expression,Object.assign(Error((n||"object")+" is not iterable"),{value:t.$value,expression:n});i=0,r.label=1;case 1:return i<e?[4,t.$pluck(i)]:[3,4];case 2:r.sent(),r.label=3;case 3:return i++,[3,1];case 4:return[2]}}))},Object.defineProperty(e.prototype,"length",{get:function(){return this.$proxyDescriptor.$length()},enumerable:!0,configurable:!0}),e}();function u(r){return n(r)?r.$derivable:r}i.prototype[e]=!0;var o={get:function(r,t,e){return"$proxyDescriptor"===t?r:c(r,t)?r.$pluck.call(e,t):Reflect.get(r,t,e)},set:function(r,e,i,u){if(c(r,e)){var o=r.$pluck.call(u,e);return i&&n(i)?o.$targetValue=i.$targetValue:o.$value=i&&t.isDerivable(i)?i.get():i,!0}return Reflect.set(r,e,i,u)},has:function(r,t){return t===Symbol.iterator?void 0!==r.$length():c(r,t)},getOwnPropertyDescriptor:function(r,t){if(c(r,t))return{get:function(){return this[t]},set:function(r){this[t]=r},configurable:!0,enumerable:!0}},ownKeys:function(r){return r.$pluckableKeys()}};function c(r,t){return"number"==typeof t||"string"==typeof t&&"$"!==t[0]&&!Reflect.has(r,t)}function s(r,t){return void 0===r&&(r=""),"string"==typeof t&&/^[a-z_][a-z_0-9]*$/i.test(t)?r+"."+t:"string"==typeof t?r+'["'+t.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"]':r+"["+t+"]"}function a(r,t){return void 0===r&&(r=[]),r.concat(t)}exports.ProxyDescriptor=i,exports.extendExpression=s,exports.extendPath=a,exports.isDerivableProxy=n,exports.unwrapProxy=u;
Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=require("@politie/sherlock"),e=Symbol("isDerivableProxy");function n(r){return!0===r[e]}var i=function(){function e(){this.$$derivable=void 0}return Object.defineProperty(e.prototype,"$derivable",{get:function(){var r=this.$proxyDescriptor;return r.$$derivable||(r.$$derivable=function(r,e){if(!e)return r;var n=e.get,i=e.set;return i&&t.isSettableDerivable(r)?t.lens({get:n,set:function(t,e){r.set(i.call(this,t,e))}},r).autoCache():r.derive(n).autoCache()}(r.$target,r.$lens&&r.$lens()))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$value",{get:function(){var r=this.$proxyDescriptor;try{return r.$derivable.get()}catch(t){throw Object.assign(Error("error while getting "+(r.$expression||"$value")+": "+(t&&t.message)),{jse_cause:t})}},set:function(r){var e=this.$proxyDescriptor,n=e.$derivable,i=e.$expression;if(!t.isSettableDerivable(n))throw Error((i||"$value")+" is readonly");try{n.set(r)}catch(r){throw Object.assign(Error("error while setting "+(i||"$value")+": "+(r&&r.message)),{jse_cause:r})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$targetValue",{get:function(){var r=this.$proxyDescriptor;try{return r.$target.get()}catch(t){throw Object.assign(Error("error while getting "+(r.$expression||"$targetValue")+": "+(t&&t.message)),{jse_cause:t})}},set:function(r){var e=this.$proxyDescriptor,n=e.$target,i=e.$expression;if(!t.isSettableDerivable(n))throw Error((i||"$targetValue")+" is readonly");try{n.set(r)}catch(r){throw Object.assign(Error("error while setting "+(i||"$targetValue")+": "+(r&&r.message)),{jse_cause:r})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$proxyDescriptor",{get:function(){return this},enumerable:!1,configurable:!0}),e.prototype.$create=function(r,e,n){var i=t.utils.clone(this.$proxyDescriptor);return i.$target=r,Object.getOwnPropertyNames(i).filter((function(r){return r.startsWith("$$")})).forEach((function(r){return i[r]=void 0})),i.$expression=e,i.$path=n,new Proxy(i,o)},e.prototype.$pluck=function(r){var t=this.$proxyDescriptor;return t.$create(t.$derivable.pluck(r),s(t.$expression,r),a(t.$path,r))},e.prototype.$pluckableKeys=function(){var r=this.$proxyDescriptor.$value;return"object"==typeof r?Reflect.ownKeys(r):[]},e.prototype.$length=function(){var r=this.$proxyDescriptor.$targetValue;return Array.isArray(r)?r.length:void 0},e.prototype.$and=function(r){return this.$proxyDescriptor.$derivable.and(u(r))},e.prototype.$or=function(r){return this.$proxyDescriptor.$derivable.or(u(r))},e.prototype.$not=function(){return this.$proxyDescriptor.$derivable.not()},e.prototype.$is=function(r){return this.$proxyDescriptor.$derivable.is(u(r))},e.prototype.$derive=function(){var r=this.$proxyDescriptor.$derivable;return r.derive.apply(r,arguments)},e.prototype.$react=function(r,t){return this.$proxyDescriptor.$derivable.react(r,t)},e.prototype.toJSON=function(){return this.$proxyDescriptor.$value},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"DerivableProxy"},enumerable:!1,configurable:!0}),e.prototype[Symbol.iterator]=function(){var t,e,n,i;return r.__generator(this,(function(r){switch(r.label){case 0:if(t=this.$proxyDescriptor,void 0===(e=t.$length()))throw n=t.$expression,Object.assign(Error((n||"object")+" is not iterable"),{value:t.$value,expression:n});i=0,r.label=1;case 1:return i<e?[4,t.$pluck(i)]:[3,4];case 2:r.sent(),r.label=3;case 3:return i++,[3,1];case 4:return[2]}}))},Object.defineProperty(e.prototype,"length",{get:function(){return this.$proxyDescriptor.$length()},enumerable:!1,configurable:!0}),e}();function u(r){return n(r)?r.$derivable:r}i.prototype[e]=!0;var o={get:function(r,t,e){return"$proxyDescriptor"===t?r:c(r,t)?r.$pluck.call(e,t):Reflect.get(r,t,e)},set:function(r,e,i,u){if(c(r,e)){var o=r.$pluck.call(u,e);return i&&n(i)?o.$targetValue=i.$targetValue:o.$value=i&&t.isDerivable(i)?i.get():i,!0}return Reflect.set(r,e,i,u)},has:function(r,t){return t===Symbol.iterator?void 0!==r.$length():c(r,t)},getOwnPropertyDescriptor:function(r,t){if(c(r,t))return{get:function(){return this[t]},set:function(r){this[t]=r},configurable:!0,enumerable:!0}},ownKeys:function(r){return r.$pluckableKeys()}};function c(r,t){return"number"==typeof t||"string"==typeof t&&"$"!==t[0]&&!Reflect.has(r,t)}function s(r,t){return void 0===r&&(r=""),"string"==typeof t&&/^[a-z_][a-z_0-9]*$/i.test(t)?r+"."+t:"string"==typeof t?r+'["'+t.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"]':r+"["+t+"]"}function a(r,t){return void 0===r&&(r=[]),r.concat(t)}exports.ProxyDescriptor=i,exports.extendExpression=s,exports.extendPath=a,exports.isDerivableProxy=n,exports.unwrapProxy=u;
//# sourceMappingURL=sherlock-proxy.cjs.min.js.map

@@ -35,3 +35,3 @@ import { __generator } from 'tslib';

},
enumerable: true,
enumerable: false,
configurable: true

@@ -68,3 +68,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -100,3 +100,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -111,3 +111,3 @@ });

get: function () { return this; },
enumerable: true,
enumerable: false,
configurable: true

@@ -184,3 +184,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -218,3 +218,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -221,0 +221,0 @@ });

@@ -1,2 +0,2 @@

import{__generator as r}from"tslib";import{isSettableDerivable as t,utils as e,lens as n,isDerivable as i}from"@politie/sherlock";var u=Symbol("isDerivableProxy");function o(r){return!0===r[u]}var c=function(){function i(){this.$$derivable=void 0}return Object.defineProperty(i.prototype,"$derivable",{get:function(){var r=this.$proxyDescriptor;return r.$$derivable||(r.$$derivable=function(r,e){if(!e)return r;var i=e.get,u=e.set;return u&&t(r)?n({get:i,set:function(t,e){r.set(u.call(this,t,e))}},r).autoCache():r.derive(i).autoCache()}(r.$target,r.$lens&&r.$lens()))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"$value",{get:function(){var r=this.$proxyDescriptor;try{return r.$derivable.get()}catch(t){throw Object.assign(Error("error while getting "+(r.$expression||"$value")+": "+(t&&t.message)),{jse_cause:t})}},set:function(r){var e=this.$proxyDescriptor,n=e.$derivable,i=e.$expression;if(!t(n))throw Error((i||"$value")+" is readonly");try{n.set(r)}catch(r){throw Object.assign(Error("error while setting "+(i||"$value")+": "+(r&&r.message)),{jse_cause:r})}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"$targetValue",{get:function(){var r=this.$proxyDescriptor;try{return r.$target.get()}catch(t){throw Object.assign(Error("error while getting "+(r.$expression||"$targetValue")+": "+(t&&t.message)),{jse_cause:t})}},set:function(r){var e=this.$proxyDescriptor,n=e.$target,i=e.$expression;if(!t(n))throw Error((i||"$targetValue")+" is readonly");try{n.set(r)}catch(r){throw Object.assign(Error("error while setting "+(i||"$targetValue")+": "+(r&&r.message)),{jse_cause:r})}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"$proxyDescriptor",{get:function(){return this},enumerable:!0,configurable:!0}),i.prototype.$create=function(r,t,n){var i=e.clone(this.$proxyDescriptor);return i.$target=r,Object.getOwnPropertyNames(i).filter((function(r){return r.startsWith("$$")})).forEach((function(r){return i[r]=void 0})),i.$expression=t,i.$path=n,new Proxy(i,f)},i.prototype.$pluck=function(r){var t=this.$proxyDescriptor;return t.$create(t.$derivable.pluck(r),l(t.$expression,r),h(t.$path,r))},i.prototype.$pluckableKeys=function(){var r=this.$proxyDescriptor.$value;return"object"==typeof r?Reflect.ownKeys(r):[]},i.prototype.$length=function(){var r=this.$proxyDescriptor.$targetValue;return Array.isArray(r)?r.length:void 0},i.prototype.$and=function(r){return this.$proxyDescriptor.$derivable.and(a(r))},i.prototype.$or=function(r){return this.$proxyDescriptor.$derivable.or(a(r))},i.prototype.$not=function(){return this.$proxyDescriptor.$derivable.not()},i.prototype.$is=function(r){return this.$proxyDescriptor.$derivable.is(a(r))},i.prototype.$derive=function(){var r=this.$proxyDescriptor.$derivable;return r.derive.apply(r,arguments)},i.prototype.$react=function(r,t){return this.$proxyDescriptor.$derivable.react(r,t)},i.prototype.toJSON=function(){return this.$proxyDescriptor.$value},Object.defineProperty(i.prototype,Symbol.toStringTag,{get:function(){return"DerivableProxy"},enumerable:!0,configurable:!0}),i.prototype[Symbol.iterator]=function(){var t,e,n,i;return r(this,(function(r){switch(r.label){case 0:if(t=this.$proxyDescriptor,void 0===(e=t.$length()))throw n=t.$expression,Object.assign(Error((n||"object")+" is not iterable"),{value:t.$value,expression:n});i=0,r.label=1;case 1:return i<e?[4,t.$pluck(i)]:[3,4];case 2:r.sent(),r.label=3;case 3:return i++,[3,1];case 4:return[2]}}))},Object.defineProperty(i.prototype,"length",{get:function(){return this.$proxyDescriptor.$length()},enumerable:!0,configurable:!0}),i}();function a(r){return o(r)?r.$derivable:r}c.prototype[u]=!0;var f={get:function(r,t,e){return"$proxyDescriptor"===t?r:s(r,t)?r.$pluck.call(e,t):Reflect.get(r,t,e)},set:function(r,t,e,n){if(s(r,t)){var u=r.$pluck.call(n,t);return e&&o(e)?u.$targetValue=e.$targetValue:u.$value=e&&i(e)?e.get():e,!0}return Reflect.set(r,t,e,n)},has:function(r,t){return t===Symbol.iterator?void 0!==r.$length():s(r,t)},getOwnPropertyDescriptor:function(r,t){if(s(r,t))return{get:function(){return this[t]},set:function(r){this[t]=r},configurable:!0,enumerable:!0}},ownKeys:function(r){return r.$pluckableKeys()}};function s(r,t){return"number"==typeof t||"string"==typeof t&&"$"!==t[0]&&!Reflect.has(r,t)}function l(r,t){return void 0===r&&(r=""),"string"==typeof t&&/^[a-z_][a-z_0-9]*$/i.test(t)?r+"."+t:"string"==typeof t?r+'["'+t.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"]':r+"["+t+"]"}function h(r,t){return void 0===r&&(r=[]),r.concat(t)}export{c as ProxyDescriptor,l as extendExpression,h as extendPath,o as isDerivableProxy,a as unwrapProxy};
import{__generator as r}from"tslib";import{isSettableDerivable as t,utils as e,lens as n,isDerivable as i}from"@politie/sherlock";var u=Symbol("isDerivableProxy");function o(r){return!0===r[u]}var c=function(){function i(){this.$$derivable=void 0}return Object.defineProperty(i.prototype,"$derivable",{get:function(){var r=this.$proxyDescriptor;return r.$$derivable||(r.$$derivable=function(r,e){if(!e)return r;var i=e.get,u=e.set;return u&&t(r)?n({get:i,set:function(t,e){r.set(u.call(this,t,e))}},r).autoCache():r.derive(i).autoCache()}(r.$target,r.$lens&&r.$lens()))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"$value",{get:function(){var r=this.$proxyDescriptor;try{return r.$derivable.get()}catch(t){throw Object.assign(Error("error while getting "+(r.$expression||"$value")+": "+(t&&t.message)),{jse_cause:t})}},set:function(r){var e=this.$proxyDescriptor,n=e.$derivable,i=e.$expression;if(!t(n))throw Error((i||"$value")+" is readonly");try{n.set(r)}catch(r){throw Object.assign(Error("error while setting "+(i||"$value")+": "+(r&&r.message)),{jse_cause:r})}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"$targetValue",{get:function(){var r=this.$proxyDescriptor;try{return r.$target.get()}catch(t){throw Object.assign(Error("error while getting "+(r.$expression||"$targetValue")+": "+(t&&t.message)),{jse_cause:t})}},set:function(r){var e=this.$proxyDescriptor,n=e.$target,i=e.$expression;if(!t(n))throw Error((i||"$targetValue")+" is readonly");try{n.set(r)}catch(r){throw Object.assign(Error("error while setting "+(i||"$targetValue")+": "+(r&&r.message)),{jse_cause:r})}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"$proxyDescriptor",{get:function(){return this},enumerable:!1,configurable:!0}),i.prototype.$create=function(r,t,n){var i=e.clone(this.$proxyDescriptor);return i.$target=r,Object.getOwnPropertyNames(i).filter((function(r){return r.startsWith("$$")})).forEach((function(r){return i[r]=void 0})),i.$expression=t,i.$path=n,new Proxy(i,f)},i.prototype.$pluck=function(r){var t=this.$proxyDescriptor;return t.$create(t.$derivable.pluck(r),l(t.$expression,r),h(t.$path,r))},i.prototype.$pluckableKeys=function(){var r=this.$proxyDescriptor.$value;return"object"==typeof r?Reflect.ownKeys(r):[]},i.prototype.$length=function(){var r=this.$proxyDescriptor.$targetValue;return Array.isArray(r)?r.length:void 0},i.prototype.$and=function(r){return this.$proxyDescriptor.$derivable.and(a(r))},i.prototype.$or=function(r){return this.$proxyDescriptor.$derivable.or(a(r))},i.prototype.$not=function(){return this.$proxyDescriptor.$derivable.not()},i.prototype.$is=function(r){return this.$proxyDescriptor.$derivable.is(a(r))},i.prototype.$derive=function(){var r=this.$proxyDescriptor.$derivable;return r.derive.apply(r,arguments)},i.prototype.$react=function(r,t){return this.$proxyDescriptor.$derivable.react(r,t)},i.prototype.toJSON=function(){return this.$proxyDescriptor.$value},Object.defineProperty(i.prototype,Symbol.toStringTag,{get:function(){return"DerivableProxy"},enumerable:!1,configurable:!0}),i.prototype[Symbol.iterator]=function(){var t,e,n,i;return r(this,(function(r){switch(r.label){case 0:if(t=this.$proxyDescriptor,void 0===(e=t.$length()))throw n=t.$expression,Object.assign(Error((n||"object")+" is not iterable"),{value:t.$value,expression:n});i=0,r.label=1;case 1:return i<e?[4,t.$pluck(i)]:[3,4];case 2:r.sent(),r.label=3;case 3:return i++,[3,1];case 4:return[2]}}))},Object.defineProperty(i.prototype,"length",{get:function(){return this.$proxyDescriptor.$length()},enumerable:!1,configurable:!0}),i}();function a(r){return o(r)?r.$derivable:r}c.prototype[u]=!0;var f={get:function(r,t,e){return"$proxyDescriptor"===t?r:s(r,t)?r.$pluck.call(e,t):Reflect.get(r,t,e)},set:function(r,t,e,n){if(s(r,t)){var u=r.$pluck.call(n,t);return e&&o(e)?u.$targetValue=e.$targetValue:u.$value=e&&i(e)?e.get():e,!0}return Reflect.set(r,t,e,n)},has:function(r,t){return t===Symbol.iterator?void 0!==r.$length():s(r,t)},getOwnPropertyDescriptor:function(r,t){if(s(r,t))return{get:function(){return this[t]},set:function(r){this[t]=r},configurable:!0,enumerable:!0}},ownKeys:function(r){return r.$pluckableKeys()}};function s(r,t){return"number"==typeof t||"string"==typeof t&&"$"!==t[0]&&!Reflect.has(r,t)}function l(r,t){return void 0===r&&(r=""),"string"==typeof t&&/^[a-z_][a-z_0-9]*$/i.test(t)?r+"."+t:"string"==typeof t?r+'["'+t.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"]':r+"["+t+"]"}function h(r,t){return void 0===r&&(r=[]),r.concat(t)}export{c as ProxyDescriptor,l as extendExpression,h as extendPath,o as isDerivableProxy,a as unwrapProxy};
//# sourceMappingURL=sherlock-proxy.esm.min.js.map
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@politie/sherlock')) :
typeof define === 'function' && define.amd ? define(['exports', '@politie/sherlock'], factory) :
(global = global || self, factory(global.SherlockProxy = {}, global.Sherlock));
}(this, function (exports, sherlock) { 'use strict';
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.SherlockProxy = {}, global.Sherlock));
}(this, (function (exports, sherlock) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) Microsoft Corporation.
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

@@ -81,3 +81,3 @@

},
enumerable: true,
enumerable: false,
configurable: true

@@ -114,3 +114,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -146,3 +146,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -157,3 +157,3 @@ });

get: function () { return this; },
enumerable: true,
enumerable: false,
configurable: true

@@ -230,3 +230,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -264,3 +264,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -375,3 +375,3 @@ });

}));
})));
//# sourceMappingURL=sherlock-proxy.umd.js.map

@@ -1,2 +0,16 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@politie/sherlock")):"function"==typeof define&&define.amd?define(["exports","@politie/sherlock"],t):t((e=e||self).SherlockProxy={},e.Sherlock)}(this,(function(e,t){"use strict";var r=Symbol("isDerivableProxy");function n(e){return!0===e[r]}var i=function(){function e(){this.$$derivable=void 0}return Object.defineProperty(e.prototype,"$derivable",{get:function(){var e=this.$proxyDescriptor;return e.$$derivable||(e.$$derivable=function(e,r){if(!r)return e;var n=r.get,i=r.set;return i&&t.isSettableDerivable(e)?t.lens({get:n,set:function(t,r){e.set(i.call(this,t,r))}},e).autoCache():e.derive(n).autoCache()}(e.$target,e.$lens&&e.$lens()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$value",{get:function(){var e=this.$proxyDescriptor;try{return e.$derivable.get()}catch(t){throw Object.assign(Error("error while getting "+(e.$expression||"$value")+": "+(t&&t.message)),{jse_cause:t})}},set:function(e){var r=this.$proxyDescriptor,n=r.$derivable,i=r.$expression;if(!t.isSettableDerivable(n))throw Error((i||"$value")+" is readonly");try{n.set(e)}catch(e){throw Object.assign(Error("error while setting "+(i||"$value")+": "+(e&&e.message)),{jse_cause:e})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$targetValue",{get:function(){var e=this.$proxyDescriptor;try{return e.$target.get()}catch(t){throw Object.assign(Error("error while getting "+(e.$expression||"$targetValue")+": "+(t&&t.message)),{jse_cause:t})}},set:function(e){var r=this.$proxyDescriptor,n=r.$target,i=r.$expression;if(!t.isSettableDerivable(n))throw Error((i||"$targetValue")+" is readonly");try{n.set(e)}catch(e){throw Object.assign(Error("error while setting "+(i||"$targetValue")+": "+(e&&e.message)),{jse_cause:e})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$proxyDescriptor",{get:function(){return this},enumerable:!0,configurable:!0}),e.prototype.$create=function(e,r,n){var i=t.utils.clone(this.$proxyDescriptor);return i.$target=e,Object.getOwnPropertyNames(i).filter((function(e){return e.startsWith("$$")})).forEach((function(e){return i[e]=void 0})),i.$expression=r,i.$path=n,new Proxy(i,o)},e.prototype.$pluck=function(e){var t=this.$proxyDescriptor;return t.$create(t.$derivable.pluck(e),f(t.$expression,e),a(t.$path,e))},e.prototype.$pluckableKeys=function(){var e=this.$proxyDescriptor.$value;return"object"==typeof e?Reflect.ownKeys(e):[]},e.prototype.$length=function(){var e=this.$proxyDescriptor.$targetValue;return Array.isArray(e)?e.length:void 0},e.prototype.$and=function(e){return this.$proxyDescriptor.$derivable.and(u(e))},e.prototype.$or=function(e){return this.$proxyDescriptor.$derivable.or(u(e))},e.prototype.$not=function(){return this.$proxyDescriptor.$derivable.not()},e.prototype.$is=function(e){return this.$proxyDescriptor.$derivable.is(u(e))},e.prototype.$derive=function(){var e=this.$proxyDescriptor.$derivable;return e.derive.apply(e,arguments)},e.prototype.$react=function(e,t){return this.$proxyDescriptor.$derivable.react(e,t)},e.prototype.toJSON=function(){return this.$proxyDescriptor.$value},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"DerivableProxy"},enumerable:!0,configurable:!0}),e.prototype[Symbol.iterator]=function(){var e,t,r,n;return function(e,t){var r,n,i,u,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}(this,(function(i){switch(i.label){case 0:if(e=this.$proxyDescriptor,void 0===(t=e.$length()))throw r=e.$expression,Object.assign(Error((r||"object")+" is not iterable"),{value:e.$value,expression:r});n=0,i.label=1;case 1:return n<t?[4,e.$pluck(n)]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))},Object.defineProperty(e.prototype,"length",{get:function(){return this.$proxyDescriptor.$length()},enumerable:!0,configurable:!0}),e}();function u(e){return n(e)?e.$derivable:e}i.prototype[r]=!0;var o={get:function(e,t,r){return"$proxyDescriptor"===t?e:c(e,t)?e.$pluck.call(r,t):Reflect.get(e,t,r)},set:function(e,r,i,u){if(c(e,r)){var o=e.$pluck.call(u,r);return i&&n(i)?o.$targetValue=i.$targetValue:o.$value=i&&t.isDerivable(i)?i.get():i,!0}return Reflect.set(e,r,i,u)},has:function(e,t){return t===Symbol.iterator?void 0!==e.$length():c(e,t)},getOwnPropertyDescriptor:function(e,t){if(c(e,t))return{get:function(){return this[t]},set:function(e){this[t]=e},configurable:!0,enumerable:!0}},ownKeys:function(e){return e.$pluckableKeys()}};function c(e,t){return"number"==typeof t||"string"==typeof t&&"$"!==t[0]&&!Reflect.has(e,t)}function f(e,t){return void 0===e&&(e=""),"string"==typeof t&&/^[a-z_][a-z_0-9]*$/i.test(t)?e+"."+t:"string"==typeof t?e+'["'+t.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"]':e+"["+t+"]"}function a(e,t){return void 0===e&&(e=[]),e.concat(t)}e.ProxyDescriptor=i,e.extendExpression=f,e.extendPath=a,e.isDerivableProxy=n,e.unwrapProxy=u,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@politie/sherlock")):"function"==typeof define&&define.amd?define(["exports","@politie/sherlock"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SherlockProxy={},e.Sherlock)}(this,(function(e,t){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var r=Symbol("isDerivableProxy");function n(e){return!0===e[r]}var i=function(){function e(){this.$$derivable=void 0}return Object.defineProperty(e.prototype,"$derivable",{get:function(){var e=this.$proxyDescriptor;return e.$$derivable||(e.$$derivable=function(e,r){if(!r)return e;var n=r.get,i=r.set;return i&&t.isSettableDerivable(e)?t.lens({get:n,set:function(t,r){e.set(i.call(this,t,r))}},e).autoCache():e.derive(n).autoCache()}(e.$target,e.$lens&&e.$lens()))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$value",{get:function(){var e=this.$proxyDescriptor;try{return e.$derivable.get()}catch(t){throw Object.assign(Error("error while getting "+(e.$expression||"$value")+": "+(t&&t.message)),{jse_cause:t})}},set:function(e){var r=this.$proxyDescriptor,n=r.$derivable,i=r.$expression;if(!t.isSettableDerivable(n))throw Error((i||"$value")+" is readonly");try{n.set(e)}catch(e){throw Object.assign(Error("error while setting "+(i||"$value")+": "+(e&&e.message)),{jse_cause:e})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$targetValue",{get:function(){var e=this.$proxyDescriptor;try{return e.$target.get()}catch(t){throw Object.assign(Error("error while getting "+(e.$expression||"$targetValue")+": "+(t&&t.message)),{jse_cause:t})}},set:function(e){var r=this.$proxyDescriptor,n=r.$target,i=r.$expression;if(!t.isSettableDerivable(n))throw Error((i||"$targetValue")+" is readonly");try{n.set(e)}catch(e){throw Object.assign(Error("error while setting "+(i||"$targetValue")+": "+(e&&e.message)),{jse_cause:e})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$proxyDescriptor",{get:function(){return this},enumerable:!1,configurable:!0}),e.prototype.$create=function(e,r,n){var i=t.utils.clone(this.$proxyDescriptor);return i.$target=e,Object.getOwnPropertyNames(i).filter((function(e){return e.startsWith("$$")})).forEach((function(e){return i[e]=void 0})),i.$expression=r,i.$path=n,new Proxy(i,u)},e.prototype.$pluck=function(e){var t=this.$proxyDescriptor;return t.$create(t.$derivable.pluck(e),f(t.$expression,e),a(t.$path,e))},e.prototype.$pluckableKeys=function(){var e=this.$proxyDescriptor.$value;return"object"==typeof e?Reflect.ownKeys(e):[]},e.prototype.$length=function(){var e=this.$proxyDescriptor.$targetValue;return Array.isArray(e)?e.length:void 0},e.prototype.$and=function(e){return this.$proxyDescriptor.$derivable.and(o(e))},e.prototype.$or=function(e){return this.$proxyDescriptor.$derivable.or(o(e))},e.prototype.$not=function(){return this.$proxyDescriptor.$derivable.not()},e.prototype.$is=function(e){return this.$proxyDescriptor.$derivable.is(o(e))},e.prototype.$derive=function(){var e=this.$proxyDescriptor.$derivable;return e.derive.apply(e,arguments)},e.prototype.$react=function(e,t){return this.$proxyDescriptor.$derivable.react(e,t)},e.prototype.toJSON=function(){return this.$proxyDescriptor.$value},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"DerivableProxy"},enumerable:!1,configurable:!0}),e.prototype[Symbol.iterator]=function(){var e,t,r,n;return function(e,t){var r,n,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,n=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}(this,(function(i){switch(i.label){case 0:if(e=this.$proxyDescriptor,void 0===(t=e.$length()))throw r=e.$expression,Object.assign(Error((r||"object")+" is not iterable"),{value:e.$value,expression:r});n=0,i.label=1;case 1:return n<t?[4,e.$pluck(n)]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))},Object.defineProperty(e.prototype,"length",{get:function(){return this.$proxyDescriptor.$length()},enumerable:!1,configurable:!0}),e}();function o(e){return n(e)?e.$derivable:e}i.prototype[r]=!0;var u={get:function(e,t,r){return"$proxyDescriptor"===t?e:c(e,t)?e.$pluck.call(r,t):Reflect.get(e,t,r)},set:function(e,r,i,o){if(c(e,r)){var u=e.$pluck.call(o,r);return i&&n(i)?u.$targetValue=i.$targetValue:u.$value=i&&t.isDerivable(i)?i.get():i,!0}return Reflect.set(e,r,i,o)},has:function(e,t){return t===Symbol.iterator?void 0!==e.$length():c(e,t)},getOwnPropertyDescriptor:function(e,t){if(c(e,t))return{get:function(){return this[t]},set:function(e){this[t]=e},configurable:!0,enumerable:!0}},ownKeys:function(e){return e.$pluckableKeys()}};function c(e,t){return"number"==typeof t||"string"==typeof t&&"$"!==t[0]&&!Reflect.has(e,t)}function f(e,t){return void 0===e&&(e=""),"string"==typeof t&&/^[a-z_][a-z_0-9]*$/i.test(t)?e+"."+t:"string"==typeof t?e+'["'+t.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"]':e+"["+t+"]"}function a(e,t){return void 0===e&&(e=[]),e.concat(t)}e.ProxyDescriptor=i,e.extendExpression=f,e.extendPath=a,e.isDerivableProxy=n,e.unwrapProxy=o,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=sherlock-proxy.umd.min.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc