reflect-metadata
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "reflect-metadata", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Polyfill for Metadata Reflection API", | ||
@@ -5,0 +5,0 @@ "main": "Reflect.js", |
@@ -646,4 +646,4 @@ /*! ***************************************************************************** | ||
var keys = []; | ||
for (var _i = 0; _i < ownKeys.length; _i++) { | ||
var key = ownKeys[_i]; | ||
for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) { | ||
var key = ownKeys_1[_i]; | ||
var hasKey = set.has(key); | ||
@@ -655,4 +655,4 @@ if (!hasKey) { | ||
} | ||
for (var _a = 0; _a < parentKeys.length; _a++) { | ||
var key = parentKeys[_a]; | ||
for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) { | ||
var key = parentKeys_1[_a]; | ||
var hasKey = set.has(key); | ||
@@ -707,3 +707,3 @@ if (!hasKey) { | ||
} | ||
// TypeScript doesn't set __proto__ in ES5, as it's non-standard. | ||
// TypeScript doesn't set __proto__ in ES5, as it's non-standard. | ||
// Try to determine the superclass constructor. Compatible implementations | ||
@@ -720,3 +720,3 @@ // must either set __proto__ on a subclass constructor to the superclass constructor, | ||
var prototype = O.prototype; | ||
var prototypeProto = Object.getPrototypeOf(prototype); | ||
var prototypeProto = prototype && Object.getPrototypeOf(prototype); | ||
if (prototypeProto == null || prototypeProto === Object.prototype) { | ||
@@ -844,3 +844,6 @@ return proto; | ||
var isNode = typeof global !== "undefined" && Object.prototype.toString.call(global.process) === '[object process]'; | ||
var nodeCrypto = isNode && require("crypto"); | ||
var nodeCrypto = isNode && function () { try { | ||
return (void 0, require)("crypto"); | ||
} | ||
catch (e) { } }(); | ||
var hasOwn = Object.prototype.hasOwnProperty; | ||
@@ -847,0 +850,0 @@ var keys = {}; |
116
Reflect.ts
/*! ***************************************************************************** | ||
Copyright (C) Microsoft. 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 | ||
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 | ||
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. | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
@@ -78,3 +78,3 @@ See the Apache Version 2.0 License for specific language governing permissions | ||
const _WeakMap: typeof WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill(); | ||
// [[Metadata]] internal slot | ||
@@ -104,3 +104,3 @@ const __Metadata__ = new _WeakMap<Object, Map<string | symbol, Map<any, any>>>(); | ||
* @param targetKey The property key to decorate. | ||
* @param descriptor A property descriptor | ||
* @param descriptor A property descriptor | ||
* @remarks Decorators are applied in reverse order. | ||
@@ -111,5 +111,5 @@ * @example | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
* | ||
* | ||
* static staticMethod() { } | ||
@@ -126,9 +126,9 @@ * method() { } | ||
* // method (on constructor) | ||
* Object.defineProperty(C, "staticMethod", | ||
* Reflect.decorate(decoratorsArray, C, "staticMethod", | ||
* Object.defineProperty(C, "staticMethod", | ||
* Reflect.decorate(decoratorsArray, C, "staticMethod", | ||
* Object.getOwnPropertyDescriptor(C, "staticMethod"))); | ||
* | ||
* // method (on prototype) | ||
* Object.defineProperty(C.prototype, "method", | ||
* Reflect.decorate(decoratorsArray, C.prototype, "method", | ||
* Object.defineProperty(C.prototype, "method", | ||
* Reflect.decorate(decoratorsArray, C.prototype, "method", | ||
* Object.getOwnPropertyDescriptor(C.prototype, "method"))); | ||
@@ -150,3 +150,3 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
@@ -156,3 +156,3 @@ * | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -170,9 +170,9 @@ * | ||
* // method (on constructor) | ||
* Object.defineProperty(C, "staticMethod", | ||
* Reflect.decorate(decoratorsArray, C, "staticMethod", | ||
* Object.defineProperty(C, "staticMethod", | ||
* Reflect.decorate(decoratorsArray, C, "staticMethod", | ||
* Object.getOwnPropertyDescriptor(C, "staticMethod"))); | ||
* | ||
* // method (on prototype) | ||
* Object.defineProperty(C.prototype, "method", | ||
* Reflect.decorate(decoratorsArray, C.prototype, "method", | ||
* Object.defineProperty(C.prototype, "method", | ||
* Reflect.decorate(decoratorsArray, C.prototype, "method", | ||
* Object.getOwnPropertyDescriptor(C.prototype, "method"))); | ||
@@ -227,4 +227,4 @@ * | ||
* @returns A decorator function. | ||
* @remarks | ||
* If `metadataKey` is already defined for the target and target key, the | ||
* @remarks | ||
* If `metadataKey` is already defined for the target and target key, the | ||
* metadataValue for that key will be overwritten. | ||
@@ -286,3 +286,3 @@ * @example | ||
} | ||
/** | ||
@@ -319,7 +319,7 @@ * Define a unique metadata entry on the target. | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
* | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -357,3 +357,3 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
@@ -363,3 +363,3 @@ * | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -398,3 +398,3 @@ * | ||
} | ||
/** | ||
@@ -426,7 +426,7 @@ * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
* | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -459,3 +459,3 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
@@ -465,3 +465,3 @@ * | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -522,7 +522,7 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
* | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -555,3 +555,3 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
@@ -561,3 +561,3 @@ * | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -618,7 +618,7 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
* | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -651,3 +651,3 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
@@ -657,3 +657,3 @@ * | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -714,7 +714,7 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
* | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -747,3 +747,3 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
@@ -753,3 +753,3 @@ * | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -808,7 +808,7 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
* | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -840,3 +840,3 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
@@ -846,3 +846,3 @@ * | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -901,7 +901,7 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
* | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -933,3 +933,3 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
@@ -939,3 +939,3 @@ * | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -996,7 +996,7 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
* | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -1029,3 +1029,3 @@ * | ||
* // property declarations are not part of ES6, though they are valid in TypeScript: | ||
* // static staticProperty; | ||
* // static staticProperty; | ||
* // property; | ||
@@ -1035,3 +1035,3 @@ * | ||
* static staticMethod(p) { } | ||
* method(p) { } | ||
* method(p) { } | ||
* } | ||
@@ -1289,3 +1289,3 @@ * | ||
// TypeScript doesn't set __proto__ in ES5, as it's non-standard. | ||
// TypeScript doesn't set __proto__ in ES5, as it's non-standard. | ||
// Try to determine the superclass constructor. Compatible implementations | ||
@@ -1304,3 +1304,3 @@ // must either set __proto__ on a subclass constructor to the superclass constructor, | ||
let prototype = O.prototype; | ||
let prototypeProto = Object.getPrototypeOf(prototype); | ||
let prototypeProto = prototype && Object.getPrototypeOf(prototype); | ||
if (prototypeProto == null || prototypeProto === Object.prototype) { | ||
@@ -1434,3 +1434,3 @@ return proto; | ||
const isNode = typeof global !== "undefined" && Object.prototype.toString.call(global.process) === '[object process]'; | ||
const nodeCrypto = isNode && require("crypto"); | ||
const nodeCrypto = isNode && function () { try { return (void 0, require)("crypto"); } catch (e) { } }(); | ||
const hasOwn = Object.prototype.hasOwnProperty; | ||
@@ -1437,0 +1437,0 @@ const keys: { [key: string]: boolean; } = {}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
359186
33
3799
1