ng-auto-moq
Advanced tools
Comparing version 5.2.0 to 5.3.0
@@ -233,6 +233,12 @@ (function (global, factory) { | ||
} | ||
function __spreadArray(to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | ||
to[j] = from[i]; | ||
return to; | ||
function __spreadArray(to, from, pack) { | ||
if (pack || arguments.length === 2) | ||
for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) | ||
ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
} | ||
@@ -303,14 +309,17 @@ function __await(v) { | ||
} | ||
function __classPrivateFieldGet(receiver, privateMap) { | ||
if (!privateMap.has(receiver)) { | ||
throw new TypeError("attempted to get private field on non-instance"); | ||
} | ||
return privateMap.get(receiver); | ||
function __classPrivateFieldGet(receiver, state, kind, f) { | ||
if (kind === "a" && !f) | ||
throw new TypeError("Private accessor was defined without a getter"); | ||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) | ||
throw new TypeError("Cannot read private member from an object whose class did not declare it"); | ||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); | ||
} | ||
function __classPrivateFieldSet(receiver, privateMap, value) { | ||
if (!privateMap.has(receiver)) { | ||
throw new TypeError("attempted to set private field on non-instance"); | ||
} | ||
privateMap.set(receiver, value); | ||
return value; | ||
function __classPrivateFieldSet(receiver, state, value, kind, f) { | ||
if (kind === "m") | ||
throw new TypeError("Private method is not writable"); | ||
if (kind === "a" && !f) | ||
throw new TypeError("Private accessor was defined without a setter"); | ||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) | ||
throw new TypeError("Cannot write private member to an object whose class did not declare it"); | ||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; | ||
} | ||
@@ -317,0 +326,0 @@ |
@@ -233,6 +233,12 @@ (function (global, factory) { | ||
} | ||
function __spreadArray(to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | ||
to[j] = from[i]; | ||
return to; | ||
function __spreadArray(to, from, pack) { | ||
if (pack || arguments.length === 2) | ||
for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) | ||
ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
} | ||
@@ -303,14 +309,17 @@ function __await(v) { | ||
} | ||
function __classPrivateFieldGet(receiver, privateMap) { | ||
if (!privateMap.has(receiver)) { | ||
throw new TypeError("attempted to get private field on non-instance"); | ||
} | ||
return privateMap.get(receiver); | ||
function __classPrivateFieldGet(receiver, state, kind, f) { | ||
if (kind === "a" && !f) | ||
throw new TypeError("Private accessor was defined without a getter"); | ||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) | ||
throw new TypeError("Cannot read private member from an object whose class did not declare it"); | ||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); | ||
} | ||
function __classPrivateFieldSet(receiver, privateMap, value) { | ||
if (!privateMap.has(receiver)) { | ||
throw new TypeError("attempted to set private field on non-instance"); | ||
} | ||
privateMap.set(receiver, value); | ||
return value; | ||
function __classPrivateFieldSet(receiver, state, value, kind, f) { | ||
if (kind === "m") | ||
throw new TypeError("Private method is not writable"); | ||
if (kind === "a" && !f) | ||
throw new TypeError("Private accessor was defined without a setter"); | ||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) | ||
throw new TypeError("Cannot write private member to an object whose class did not declare it"); | ||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; | ||
} | ||
@@ -550,6 +559,12 @@ | ||
return function (type, options) { | ||
if (options === void 0) { options = { skipSelf: false }; } | ||
if (options === void 0) { options = { skipSelf: false, skipOptional: false }; } | ||
var parameters = _this.reflector(type); | ||
var provider = _this.testedUnitProviderFactory(type, _this.depsFactory(parameters)); | ||
var providers = Array.from(_this.parametersStaticProviderFactory(parameters)); | ||
var onlyRequiredParameters = options.skipOptional | ||
? parameters.filter(function (_a) { | ||
var optional = _a.optional; | ||
return optional === false; | ||
}) | ||
: parameters; | ||
var providers = Array.from(_this.parametersStaticProviderFactory(onlyRequiredParameters)); | ||
return (options === null || options === void 0 ? void 0 : options.skipSelf) ? providers : __spreadArray([provider], __read(providers)); | ||
@@ -556,0 +571,0 @@ }; |
@@ -15,6 +15,9 @@ import { Inject } from "@angular/core"; | ||
factory() { | ||
return (type, options = { skipSelf: false }) => { | ||
return (type, options = { skipSelf: false, skipOptional: false }) => { | ||
const parameters = this.reflector(type); | ||
const provider = this.testedUnitProviderFactory(type, this.depsFactory(parameters)); | ||
const providers = Array.from(this.parametersStaticProviderFactory(parameters)); | ||
const onlyRequiredParameters = options.skipOptional | ||
? parameters.filter(({ optional }) => optional === false) | ||
: parameters; | ||
const providers = Array.from(this.parametersStaticProviderFactory(onlyRequiredParameters)); | ||
return (options === null || options === void 0 ? void 0 : options.skipSelf) ? providers : [provider, ...providers]; | ||
@@ -30,2 +33,2 @@ }; | ||
]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9xLWluamVjdG9yLXByb3ZpZGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL25nLWF1dG8tbW9xL3NyYy9saWIvbW9xLWluamVjdG9yLXByb3ZpZGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUF3QixNQUFNLGVBQWUsQ0FBQztBQUM3RCxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQ3hDLE9BQU8sRUFBRSx5QkFBeUIsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQzNFLE9BQU8sRUFBRSwrQkF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HlwZXNjcmlwdC1lc2xpbnQvbmFtaW5nLWNvbnZlbnRpb24sIG5vLXNoYWRvdyovXG5leHBvcnQgY29uc3QgZW51bSBWaXNpYmlsaXR5IHtcbiAgICBOb25lLFxuICAgIFNlbGYsXG4gICAgU2tpcFNlbGZcbn1cblxuLyplc2xpbnQtZW5hYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uYW1pbmctY29udmVudGlvbiwgbm8tc2hhZG93Ki9cblxuLyoqXG4gKiBSZWZsZWN0cyBhIGRlcGVuZGVuY3kgbWV0YWRhdGEuXG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgSVBhcmFtZXRlciB7XG4gICAgLyoqXG4gICAgICogRGVwZW5kZW5jeSB0b2tlbiBuYW1lXG4gICAgICovXG4gICAgZGlzcGxheU5hbWU6IHN0cmluZztcbiAgICAvKipcbiAgICAgKiBEZXBlbmRlbmN5IHRva2VuXG4gICAgICovXG4gICAgdG9rZW46IFR5cGU8YW55PiB8IEluamVjdGlvblRva2VuPGFueT47XG4gICAgLyoqXG4gICAgICogSWYgbWFya2VkIHdpdGggQE9wdGlvbmFsKClcbiAgICAgKi9cbiAgICBvcHRpb25hbDogYm9vbGVhbjtcbiAgICAvKipcbiAgICAgKiBJZiBtYXJrZWQgd2l0aCBAU2VsZigpIG9yIEBTa2lwU2VsZigpXG4gICAgICovXG4gICAgdmlzaWJpbGl0eTogVmlzaWJpbGl0eTtcbn1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZy1hdXRvLW1vcS9zcmMvbGliL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICAgIENvbnN0cnVjdG9yUHJvdmlkZXIsXG4gICAgRXhpc3Rpbm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uLyplc2xpbnQtZW5hYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uYW1pbmctY29udmVudGlvbiwgbm8tc2hhZG93Ki9cblxuLyoqXG4gKiBSZWZsZWN0cyBhIGRlcGVuZGVuY3kgbWV0YWRhdGEuXG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgSVBhcmFtZXRlciB7XG4gICAgLyoqXG4gICAgICogRGVwZW5kZW5jeSB0b2tlbiBuYW1lXG4gICAgICovXG4gICAgZGlzcGxheU5hbWU6IHN0cmluZztcbiAgICAvKipcbiAgICAgKiBEZXBlbmRlbmN5IHRva2VuXG4gICAgICovXG4gICAgdG9rZW46IFR5cGU8YW55PiB8IEluamVjdGlvblRva2VuPGFueT47XG4gICAgLyoqXG4gICAgICogSWYgbWFya2VkIHdpdGggQE9wdGlvbmFsKClcbiAgICAgKi9cbiAgICBvcHRpb25hbDogYm9vbGVhbjtcbiAgICAvKipcbiAgICAgKiBJZiBtYXJrZWQgd2l0aCBAU2VsZigpIG9yIEBTa2lwU2VsZigpXG4gICAgICovXG4gICAgdmlzaWJpbGl0eTogVmlzaWJpbGl0eTtcbn1cbiJdfQ== |
@@ -201,6 +201,9 @@ import { Inject, Type, Optional, Self, SkipSelf, InjectionToken, resolveForwardRef, Injector } from '@angular/core'; | ||
factory() { | ||
return (type, options = { skipSelf: false }) => { | ||
return (type, options = { skipSelf: false, skipOptional: false }) => { | ||
const parameters = this.reflector(type); | ||
const provider = this.testedUnitProviderFactory(type, this.depsFactory(parameters)); | ||
const providers = Array.from(this.parametersStaticProviderFactory(parameters)); | ||
const onlyRequiredParameters = options.skipOptional | ||
? parameters.filter(({ optional }) => optional === false) | ||
: parameters; | ||
const providers = Array.from(this.parametersStaticProviderFactory(onlyRequiredParameters)); | ||
return (options === null || options === void 0 ? void 0 : options.skipSelf) ? providers : [provider, ...providers]; | ||
@@ -207,0 +210,0 @@ }; |
@@ -9,2 +9,7 @@ import { ConstructorProvider, ExistingProvider, FactoryProvider, InjectionToken, StaticClassProvider, Type, ValueProvider } from "@angular/core"; | ||
skipSelf?: boolean; | ||
/** | ||
* When true the static providers for optional dependencies are skipped. | ||
* The tested unit will receive null value. | ||
*/ | ||
skipOptional?: boolean; | ||
} | ||
@@ -11,0 +16,0 @@ export declare const enum Visibility { |
{ | ||
"name": "ng-auto-moq", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"author": "dvabuzyarov(at)gmail.com", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
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
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
240439
1847