commit
This commit is contained in:
parent
68f4b60012
commit
41ae7ff4bd
1010 changed files with 38622 additions and 17071 deletions
12
node_modules/ts-mixer/dist/cjs/proxy.js
generated
vendored
12
node_modules/ts-mixer/dist/cjs/proxy.js
generated
vendored
|
@ -7,7 +7,7 @@ const util_1 = require("./util");
|
|||
* prototypes is required.
|
||||
*/
|
||||
const getIngredientWithProp = (prop, ingredients) => {
|
||||
const protoChains = ingredients.map(ingredient => util_1.protoChain(ingredient));
|
||||
const protoChains = ingredients.map(ingredient => (0, util_1.protoChain)(ingredient));
|
||||
// since we search breadth-first, we need to keep track of our depth in the prototype chains
|
||||
let protoDepth = 0;
|
||||
// not all prototype chains are the same depth, so this remains true as long as at least one of the ingredients'
|
||||
|
@ -45,19 +45,19 @@ const proxyMix = (ingredients, prototype = Object.prototype) => new Proxy({}, {
|
|||
throw Error('Cannot set prototype of Proxies created by ts-mixer');
|
||||
},
|
||||
getOwnPropertyDescriptor(_, prop) {
|
||||
return Object.getOwnPropertyDescriptor(exports.getIngredientWithProp(prop, ingredients) || {}, prop);
|
||||
return Object.getOwnPropertyDescriptor((0, exports.getIngredientWithProp)(prop, ingredients) || {}, prop);
|
||||
},
|
||||
defineProperty() {
|
||||
throw new Error('Cannot define new properties on Proxies created by ts-mixer');
|
||||
},
|
||||
has(_, prop) {
|
||||
return exports.getIngredientWithProp(prop, ingredients) !== undefined || prototype[prop] !== undefined;
|
||||
return (0, exports.getIngredientWithProp)(prop, ingredients) !== undefined || prototype[prop] !== undefined;
|
||||
},
|
||||
get(_, prop) {
|
||||
return (exports.getIngredientWithProp(prop, ingredients) || prototype)[prop];
|
||||
return ((0, exports.getIngredientWithProp)(prop, ingredients) || prototype)[prop];
|
||||
},
|
||||
set(_, prop, val) {
|
||||
const ingredientWithProp = exports.getIngredientWithProp(prop, ingredients);
|
||||
const ingredientWithProp = (0, exports.getIngredientWithProp)(prop, ingredients);
|
||||
if (ingredientWithProp === undefined)
|
||||
throw new Error('Cannot set new properties on Proxies created by ts-mixer');
|
||||
ingredientWithProp[prop] = val;
|
||||
|
@ -78,5 +78,5 @@ exports.proxyMix = proxyMix;
|
|||
* proxying all property access to the ingredients. This is not ES5 compatible and less performant. However, any
|
||||
* changes made to the source prototypes will be reflected in the proxy-prototype, which may be desirable.
|
||||
*/
|
||||
const softMixProtos = (ingredients, constructor) => exports.proxyMix([...ingredients, { constructor }]);
|
||||
const softMixProtos = (ingredients, constructor) => (0, exports.proxyMix)([...ingredients, { constructor }]);
|
||||
exports.softMixProtos = softMixProtos;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue