ng-auto-moq
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -347,3 +347,3 @@ (function (global, factory) { | ||
function providerResolver(parameter, mocked) { | ||
function providerFactory(parameter, mocked) { | ||
return { provide: parameter.token, useValue: mocked }; | ||
@@ -359,3 +359,3 @@ } | ||
var e_1, _a; | ||
if (_providerResolver === void 0) { _providerResolver = providerResolver; } | ||
if (_providerResolver === void 0) { _providerResolver = providerFactory; } | ||
if (_mockFactory === void 0) { _mockFactory = mockFactory; } | ||
@@ -372,3 +372,3 @@ return __generator(this, function (_b) { | ||
mock = _mockFactory(parameter, mockFactory); | ||
staticProvider = _providerResolver(parameter, mock.object(), providerResolver); | ||
staticProvider = _providerResolver(parameter, mock.object(), providerFactory); | ||
if (!(staticProvider !== undefined)) return [3 /*break*/, 3]; | ||
@@ -398,11 +398,22 @@ return [4 /*yield*/, staticProvider]; | ||
function moqInjectorProvidersFactory(_reflector, _typeStaticProvider, _parametersStaticProviders) { | ||
function depsFactory(parameters) { | ||
return parameters | ||
.map(function (p) { | ||
if (p.optional === true) { | ||
return [new core.Optional(), p.token]; | ||
} | ||
return p.token; | ||
}); | ||
} | ||
function moqInjectorProvidersFactory(_reflector, _typeStaticProvider, _parametersStaticProviders, _depsFactory) { | ||
if (_reflector === void 0) { _reflector = reflector; } | ||
if (_typeStaticProvider === void 0) { _typeStaticProvider = typeStaticProvider; } | ||
if (_parametersStaticProviders === void 0) { _parametersStaticProviders = parametersStaticProviders; } | ||
if (_depsFactory === void 0) { _depsFactory = depsFactory; } | ||
return function (type, options) { | ||
if (options === void 0) { options = {}; } | ||
var parameters = _reflector(type); | ||
var providers = Array.from(_parametersStaticProviders(parameters, options.providerResolver, options.mockFactory)); | ||
var provider = _typeStaticProvider(type, providers.map(function (p) { return p.provide; })); | ||
var provider = _typeStaticProvider(type, _depsFactory(parameters)); | ||
var providers = Array.from(_parametersStaticProviders(parameters, options.providerFactory, options.mockFactory)); | ||
return options.skipSelf ? providers : __spread([provider], providers); | ||
@@ -434,2 +445,3 @@ }; | ||
exports.ɵd = parametersStaticProviders; | ||
exports.ɵe = depsFactory; | ||
@@ -436,0 +448,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -15,3 +15,3 @@ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("moq.ts")):"function"==typeof define&&define.amd?define("ng-auto-moq",["exports","@angular/core","moq.ts"],r):r((e=e||self)["ng-auto-moq"]={},e.ng.core,e.moq.ts)}(this,(function(e,r,n){"use strict"; | ||
and limitations under the License. | ||
***************************************************************************** */function t(e,r){var n,t,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,t=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=r.call(e,i)}catch(e){a=[6,e],t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function o(e){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&e[r],t=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,r){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var t,o,a=n.call(e),i=[];try{for(;(void 0===r||r-- >0)&&!(t=a.next()).done;)i.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function i(e){var n=function(e){var r=e.hasOwnProperty("__parameters__")&&e.__parameters__,n=(global||window).Reflect.getOwnMetadata("design:paramtypes",e);if(n||r)return function(e,r){var n;n=new Array(void 0===e?r.length:e.length);for(var t=0;t<n.length;t++)void 0===e?n[t]=[]:e[t]!==Object?n[t]=[e[t]]:n[t]=[],r&&null!=r[t]&&(n[t]=n[t].concat(r[t]));return n}(n,r);return[]}(e);return n.map((function(e){return function(e,n,t){var o=null,a=!1;if(!Array.isArray(n))return n instanceof r.Inject?u(n.token,a,0):u(n,a,0);for(var i=0,l=0;l<n.length;++l){var c=n[l];c instanceof r.Type?o=c:c instanceof r.Inject?o=c.token:c instanceof r.Optional?a=!0:c instanceof r.Self?i=1:c instanceof r.SkipSelf?i=2:c instanceof r.InjectionToken&&(o=c)}return u(o=r.resolveForwardRef(o),a,i)}(0,e)}))}function u(e,r,n){return{displayName:l(e),token:e,optional:r,visibility:n}}function l(e){if("string"==typeof e)return e;if(e instanceof Array)return"["+e.map(l).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return""+e.overriddenName;if(e.name)return""+e.name;var r=e.toString();if(null==r)return""+r;var n=r.indexOf("\n");return-1===n?r:r.substring(0,n)}function c(e,r){var n,t,a={provide:e,useClass:e,deps:[]};try{for(var i=o(r),u=i.next();!u.done;u=i.next()){var l=u.value;a.deps.push(l)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return a}function f(e,r){return{provide:e.token,useValue:r}}function s(e){return new n.Mock({name:e.displayName})}function d(e,r,n){var a,i,u,l,c,d,p,v;return void 0===r&&(r=f),void 0===n&&(n=s),t(this,(function(t){switch(t.label){case 0:t.trys.push([0,5,6,7]),a=o(e),i=a.next(),t.label=1;case 1:return i.done?[3,4]:(u=i.value,l=n(u,s),void 0===(c=r(u,l.object(),f))?[3,3]:[4,c]);case 2:t.sent(),t.label=3;case 3:return i=a.next(),[3,1];case 4:return[3,7];case 5:return d=t.sent(),p={error:d},[3,7];case 6:try{i&&!i.done&&(v=a.return)&&v.call(a)}finally{if(p)throw p.error}return[7];case 7:return[2]}}))}function p(e,r,n){return void 0===e&&(e=i),void 0===r&&(r=c),void 0===n&&(n=d),function(t,o){void 0===o&&(o={});var i=e(t),u=Array.from(n(i,o.providerResolver,o.mockFactory)),l=r(t,u.map((function(e){return e.provide})));return o.skipSelf?u:function(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(a(arguments[r]));return e}([l],u)}}var v=p();e.moqInjectorProviders=v,e.resolveMock=function(e,r){return r.get(e)[n.MoqAPI]},e.ɵa=p,e.ɵb=i,e.ɵc=c,e.ɵd=d,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */function t(e,r){var n,t,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,t=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=r.call(e,i)}catch(e){a=[6,e],t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function o(e){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&e[r],t=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,r){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var t,o,a=n.call(e),i=[];try{for(;(void 0===r||r-- >0)&&!(t=a.next()).done;)i.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function i(e){var n=function(e){var r=e.hasOwnProperty("__parameters__")&&e.__parameters__,n=(global||window).Reflect.getOwnMetadata("design:paramtypes",e);if(n||r)return function(e,r){var n;n=new Array(void 0===e?r.length:e.length);for(var t=0;t<n.length;t++)void 0===e?n[t]=[]:e[t]!==Object?n[t]=[e[t]]:n[t]=[],r&&null!=r[t]&&(n[t]=n[t].concat(r[t]));return n}(n,r);return[]}(e);return n.map((function(e){return function(e,n,t){var o=null,a=!1;if(!Array.isArray(n))return n instanceof r.Inject?u(n.token,a,0):u(n,a,0);for(var i=0,l=0;l<n.length;++l){var c=n[l];c instanceof r.Type?o=c:c instanceof r.Inject?o=c.token:c instanceof r.Optional?a=!0:c instanceof r.Self?i=1:c instanceof r.SkipSelf?i=2:c instanceof r.InjectionToken&&(o=c)}return u(o=r.resolveForwardRef(o),a,i)}(0,e)}))}function u(e,r,n){return{displayName:l(e),token:e,optional:r,visibility:n}}function l(e){if("string"==typeof e)return e;if(e instanceof Array)return"["+e.map(l).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return""+e.overriddenName;if(e.name)return""+e.name;var r=e.toString();if(null==r)return""+r;var n=r.indexOf("\n");return-1===n?r:r.substring(0,n)}function c(e,r){var n,t,a={provide:e,useClass:e,deps:[]};try{for(var i=o(r),u=i.next();!u.done;u=i.next()){var l=u.value;a.deps.push(l)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return a}function f(e,r){return{provide:e.token,useValue:r}}function s(e){return new n.Mock({name:e.displayName})}function d(e,r,n){var a,i,u,l,c,d,p,v;return void 0===r&&(r=f),void 0===n&&(n=s),t(this,(function(t){switch(t.label){case 0:t.trys.push([0,5,6,7]),a=o(e),i=a.next(),t.label=1;case 1:return i.done?[3,4]:(u=i.value,l=n(u,s),void 0===(c=r(u,l.object(),f))?[3,3]:[4,c]);case 2:t.sent(),t.label=3;case 3:return i=a.next(),[3,1];case 4:return[3,7];case 5:return d=t.sent(),p={error:d},[3,7];case 6:try{i&&!i.done&&(v=a.return)&&v.call(a)}finally{if(p)throw p.error}return[7];case 7:return[2]}}))}function p(e){return e.map((function(e){return!0===e.optional?[new r.Optional,e.token]:e.token}))}function v(e,r,n,t){return void 0===e&&(e=i),void 0===r&&(r=c),void 0===n&&(n=d),void 0===t&&(t=p),function(o,i){void 0===i&&(i={});var u=e(o),l=r(o,t(u)),c=Array.from(n(u,i.providerFactory,i.mockFactory));return i.skipSelf?c:function(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(a(arguments[r]));return e}([l],c)}}var y=v();e.moqInjectorProviders=y,e.resolveMock=function(e,r){return r.get(e)[n.MoqAPI]},e.ɵa=v,e.ɵb=i,e.ɵc=c,e.ɵd=d,e.ɵe=p,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ng-auto-moq.umd.min.js.map |
import { reflector } from "./reflector"; | ||
import { typeStaticProvider } from "./static-provider.factory"; | ||
import { parametersStaticProviders } from "./parameters-static-providers.factory"; | ||
export function moqInjectorProvidersFactory(_reflector = reflector, _typeStaticProvider = typeStaticProvider, _parametersStaticProviders = parametersStaticProviders) { | ||
import { depsFactory } from "./deps-factory"; | ||
export function moqInjectorProvidersFactory(_reflector = reflector, _typeStaticProvider = typeStaticProvider, _parametersStaticProviders = parametersStaticProviders, _depsFactory = depsFactory) { | ||
return (type, options = {}) => { | ||
const parameters = _reflector(type); | ||
const providers = Array.from(_parametersStaticProviders(parameters, options.providerResolver, options.mockFactory)); | ||
const provider = _typeStaticProvider(type, providers.map(p => p.provide)); | ||
const provider = _typeStaticProvider(type, _depsFactory(parameters)); | ||
const providers = Array.from(_parametersStaticProviders(parameters, options.providerFactory, options.mockFactory)); | ||
return options.skipSelf ? providers : [provider, ...providers]; | ||
}; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9xLWluamVjdG9yLXByb3ZpZGVycy5mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmctYXV0by1tb3EvIiwic291cmNlcyI6WyJsaWIvbW9xLWluamVjdG9yLXByb3ZpZGVycy5mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDeEMsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDL0QsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sdUNBQXVDLENBQUM7QUFHbEYsTUFBTSxVQUFVLDJCQUEyQixDQUN2QyxhQUErQixTQUFTLEVBQ3hDLHNCQUFpRCxrQkFBa0IsRUFDbkUsNkJBQStELHlCQUF5QjtJQUN4RixPQUFPLENBQUksSUFBYSxFQUFFLFVBQXVCLEVBQUUsRUFBb0IsRUFBRTtRQUNyRSxNQUFNLFVBQVUsR0FBRyxVQUFVLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDcEMsTUFBTSxTQUFTL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LCBvcHRpb25zLm1vY2tGYWN0b3J5KSk7XG4gICAgICAgIHJldHVybiBvcHRpb25zLnNraXBTZWxmID8gcHJvdmlkZXJzIDogW3Byb3ZpZGVyLCAuLi5wcm92aWRlcnNdO1xuICAgIH07XG59XG4iXX0= |
@@ -1,7 +0,7 @@ | ||
import { providerResolver } from "./provider-resolver"; | ||
import { providerFactory } from "./provider-factory"; | ||
import { mockFactory } from "./mock-factory"; | ||
export function* parametersStaticProviders(parameters, _providerResolver = providerResolver, _mockFactory = mockFactory) { | ||
export function* parametersStaticProviders(parameters, _providerResolver = providerFactory, _mockFactory = mockFactory) { | ||
for (const parameter of parameters) { | ||
const mock = _mockFactory(parameter, mockFactory); | ||
const staticProvider = _providerResolver(parameter, mock.object(), providerResolver); | ||
const staticProvider = _providerResolver(parameter, mock.object(), providerFactory); | ||
if (staticProvider !== undefined) { | ||
@@ -12,2 +12,2 @@ yield staticProvider; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1ldGVycy1zdGF0aWMtcHJvdmlkZXJzLmZhY3RvcnkuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy1hdXRvLW1vcS8iLCJzb3VyY2VzIjpbImxpYi9wYXJhbWV0ZXJzLXN0YXRpYy1wcm92aWRlcnMuZmFjdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUN2RCxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFFN0MsTUFBTSxTQUFTLENBQUMsQ0FBQyx5QkFBeUIsQ0FDdEMsVUFBeUIsRUFDekIsb0JBQXNDLGdCQUFnQixFQUN0RCxlQUE0QixXQUFXO0lBRXZDLEtBQUssTUFBTSxTQUFTLElBQUksVUFBVSxFQUFFO1FBQ2hDLE1BQU0sSUFBSSxH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L1xuZXhwb3J0IGludGVyZmFjZSBJUGFyYW1ldGVyIHtcbiAgICAvKipcbiAgICAgKiBEZXBlbmRlbmN5IHRva2VuIG5hbWVcbiAgICAgKi9cbiAgICBkaXNwbGF5TmFtZTogc3RyaW5nO1xuICAgIC8qKlxuICAgICAqIERlcGVuZGVuY3kgdG9rZW5cbiAgICAgKi9cbiAgICB0b2tlbjogVHlwZTxhbnk+IHwgSW5qZWN0aW9uVG9rZW48YW55PjtcbiAgICAvKipcbiAgICAgKiBJZiBtYXJrZWQgd2l0aCBAT3B0aW9uYWwoKVxuICAgICAqL1xuICAgIG9wdGlvbmFsOiBib29sZWFuO1xuICAgIC8qKlxuICAgICAqIElmIG1hcmtlZCB3aXRoIEBTZWxmKCkgb3IgQFNraXBTZWxmKClcbiAgICAgKi9cbiAgICB2aXNpYmlsaXR5OiBWaXNpYmlsaXR5O1xufVxuIl19 |
@@ -5,2 +5,3 @@ /** | ||
export * from './public_api'; | ||
export { depsFactory as ɵe } from './lib/deps-factory'; | ||
export { moqInjectorProvidersFactory as ɵa } from './lib/moq-injector-providers.factory'; | ||
@@ -10,2 +11,2 @@ export { parametersStaticProviders as ɵd } from './lib/parameters-static-providers.factory'; | ||
export { typeStaticProvider as ɵc } from './lib/static-provider.factory'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmctYXV0by1tb3EuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy1hdXRvLW1vcS8iLCJzb3VyY2VzIjpbIm5nLWF1dG8tbW9xLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUM7QUFFN0IsT0FBTyxFQUFDLDJCQUEyQixJQUFJLEVBQUUsRUFBQyxNQUFNLHNDQUFzQyxDQUFDO0FBQ3ZGLE9BQU8sRUFBQyx5QkFBeUIsSUFBSSxFQUFFLEVBQUMsTUFBTSwyQ0FBMkMsQ0FBQ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QXNDLENBQUM7QUFDdkYsT0FBTyxFQUFDLHlCQUF5QixJQUFJLEVBQUUsRUFBQyxNQUFNLDJDQUEyQyxDQUFDO0FBQzFGLE9BQU8sRUFBQyxTQUFTLElBQUksRUFBRSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDaEQsT0FBTyxFQUFDLGtCQUFrQixJQUFJLEVBQUUsRUFBQyxNQUFNLCtCQUErQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuXG5leHBvcnQge2RlcHNGYWN0b3J5IGFzIMm1ZX0gZnJvbSAnLi9saWIvZGVwcy1mYWN0b3J5JztcbmV4cG9ydCB7bW9xSW5qZWN0b3JQcm92aWRlcnNGYWN0b3J5IGFzIMm1YX0gZnJvbSAnLi9saWIvbW9xLWluamVjdG9yLXByb3ZpZGVycy5mYWN0b3J5JztcbmV4cG9ydCB7cGFyYW1ldGVyc1N0YXRpY1Byb3ZpZGVycyBhcyDJtWR9IGZyb20gJy4vbGliL3BhcmFtZXRlcnMtc3RhdGljLXByb3ZpZGVycy5mYWN0b3J5JztcbmV4cG9ydCB7cmVmbGVjdG9yIGFzIMm1Yn0gZnJvbSAnLi9saWIvcmVmbGVjdG9yJztcbmV4cG9ydCB7dHlwZVN0YXRpY1Byb3ZpZGVyIGFzIMm1Y30gZnJvbSAnLi9saWIvc3RhdGljLXByb3ZpZGVyLmZhY3RvcnknOyJdfQ== |
@@ -5,14 +5,16 @@ import { __read, __spread } from "tslib"; | ||
import { parametersStaticProviders } from "./parameters-static-providers.factory"; | ||
export function moqInjectorProvidersFactory(_reflector, _typeStaticProvider, _parametersStaticProviders) { | ||
import { depsFactory } from "./deps-factory"; | ||
export function moqInjectorProvidersFactory(_reflector, _typeStaticProvider, _parametersStaticProviders, _depsFactory) { | ||
if (_reflector === void 0) { _reflector = reflector; } | ||
if (_typeStaticProvider === void 0) { _typeStaticProvider = typeStaticProvider; } | ||
if (_parametersStaticProviders === void 0) { _parametersStaticProviders = parametersStaticProviders; } | ||
if (_depsFactory === void 0) { _depsFactory = depsFactory; } | ||
return function (type, options) { | ||
if (options === void 0) { options = {}; } | ||
var parameters = _reflector(type); | ||
var providers = Array.from(_parametersStaticProviders(parameters, options.providerResolver, options.mockFactory)); | ||
var provider = _typeStaticProvider(type, providers.map(function (p) { return p.provide; })); | ||
var provider = _typeStaticProvider(type, _depsFactory(parameters)); | ||
var providers = Array.from(_parametersStaticProviders(parameters, options.providerFactory, options.mockFactory)); | ||
return options.skipSelf ? providers : __spread([provider], providers); | ||
}; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9xLWluamVjdG9yLXByb3ZpZGVycy5mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmctYXV0by1tb3EvIiwic291cmNlcyI6WyJsaWIvbW9xLWluamVjdG9yLXByb3ZpZGVycy5mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQ3hDLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQy9ELE9BQU8sRUFBRSx5QkFBeUIsRUFBRSxNQUFNLHVDQUF1QyxDQUFDO0FBR2xGLE1BQU0sVUFBVSwyQkFBMkIsQ0FDdkMsVUFBd0MsRUFDeEMsbUJBQW1FLEVBQ25FLDBCQUF3RjtJQUZ4RiwyQkFBQSxFQUFBLHNCQUF3QztJQUN4QyxvQ0FBQSxFQUFBLHdDQUFtRTtJQUNuRSwyQ0FBQSxFQUFBLHNEQUF3RjtJQUN4RixPQUFPLFVBQUksSUFBYSxFQUFFLE9BQXlCO1FBQXpCLHdCQUFBLEVBQUE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wZSwgX2RlcHNGYWN0b3J5KHBhcmFtZXRlcnMpKTtcbiAgICAgICAgY29uc3QgcHJvdmlkZXJzID0gQXJyYXkuZnJvbShfcGFyYW1ldGVyc1N0YXRpY1Byb3ZpZGVycyhwYXJhbWV0ZXJzLCBvcHRpb25zLnByb3ZpZGVyRmFjdG9yeSwgb3B0aW9ucy5tb2NrRmFjdG9yeSkpO1xuICAgICAgICByZXR1cm4gb3B0aW9ucy5za2lwU2VsZiA/IHByb3ZpZGVycyA6IFtwcm92aWRlciwgLi4ucHJvdmlkZXJzXTtcbiAgICB9O1xufVxuIl19 |
import { __generator, __values } from "tslib"; | ||
import { providerResolver } from "./provider-resolver"; | ||
import { providerFactory } from "./provider-factory"; | ||
import { mockFactory } from "./mock-factory"; | ||
@@ -7,3 +7,3 @@ export function parametersStaticProviders(parameters, _providerResolver, _mockFactory) { | ||
var e_1, _a; | ||
if (_providerResolver === void 0) { _providerResolver = providerResolver; } | ||
if (_providerResolver === void 0) { _providerResolver = providerFactory; } | ||
if (_mockFactory === void 0) { _mockFactory = mockFactory; } | ||
@@ -20,3 +20,3 @@ return __generator(this, function (_b) { | ||
mock = _mockFactory(parameter, mockFactory); | ||
staticProvider = _providerResolver(parameter, mock.object(), providerResolver); | ||
staticProvider = _providerResolver(parameter, mock.object(), providerFactory); | ||
if (!(staticProvider !== undefined)) return [3 /*break*/, 3]; | ||
@@ -45,2 +45,2 @@ return [4 /*yield*/, staticProvider]; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1ldGVycy1zdGF0aWMtcHJvdmlkZXJzLmZhY3RvcnkuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy1hdXRvLW1vcS8iLCJzb3VyY2VzIjpbImxpYi9wYXJhbWV0ZXJzLXN0YXRpYy1wcm92aWRlcnMuZmFjdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsT0FBTyxFQUF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GljUHJvdmlkZXJbXTtcblxuZXhwb3J0IGNvbnN0IGVudW0gVmlzaWJpbGl0eSB7XG4gICAgTm9uZSxcbiAgICBTZWxmLFxuICAgIFNraXBTZWxmXG59XG5cbi8qKlxuICogUmVmbGVjdHMgYSBkZXBlbmRlbmN5IG1ldGFkYXRhLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIElQYXJhbWV0ZXIge1xuICAgIGRpc3BsYXlOYW1lOiBzdHJpbmc7XG4gICAgdG9rZW46IFR5cGU8YW55PiB8IEluamVjdGlvblRva2VuPGFueT47XG4gICAgLyoqXG4gICAgICogSWYgbWFya2VkIHdpdGggQE9wdGlvbmFsKClcbiAgICAgKi9cbiAgICBvcHRpb25hbDogYm9vbGVhbjtcbiAgICAvKipcbiAgICAgKiBJZiBtYXJrZWQgd2l0aCBAU2VsZigpIG9yIEBTa2lwU2VsZigpXG4gICAgICovXG4gICAgdmlzaWJpbGl0eTogVmlzaWJpbGl0eTtcbn1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy1hdXRvLW1vcS8iLCJzb3VyY2VzIjpbImxpYi90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgICBDb25zdHJ1Y3RvclByb3ZpZGVyLFxuICAgIEV4aXN0aW5nUHJvdmlkZXIsXG4gICAgRmFjdG9yeVByb3ZpZGVyLFxuICAgIEluamVjdGlvblRva2VuLFxuICAgIFN0YXRpY0NsYXNzUHJvdmlkZXIsXG4gICAgU3RhdGljUHJvdmlkZXIsXG4gICAgVHlwZSxcbiAgICBWYWx1ZVByb3ZpZGVyXG59IGZyb20gXCJAYW5ndWxhci9jb3JlXCI7XG5pbXBvcnQgeyBJTW9jayB9IGZyb20gXCJtb3EudHNcIjtcbmltcG9ydCB7IERlZmF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oZW4gdHJ1ZSB0aGUgc3RhdGljIHByb3ZpZGVyIGZvciB0aGUgdGVzdGVkIHVuaXQgd2lsbCBiZSBza2lwcGVkLlxuICAgICAqIE9ubHkgcHJvdmlkZXJzIGZvciB0aGUgbW9xIGRlcGVuZGVuY2llcyB3aWxsIGJlIHJldHVybmVkLlxuICAgICAqL1xuICAgIHNraXBTZWxmPzogYm9vbGVhbjtcbn1cblxuZXhwb3J0IHR5cGUgTW9xSW5qZWN0b3JQcm92aWRlcnMgPSA8VD4odHlwZTogVHlwZTxUPiwgb3B0aW9ucz86IElPcHRpb25zPGFueT4pID0+IFN0YXRpY1Byb3ZpZGVyW107XG5cbmV4cG9ydCBjb25zdCBlbnVtIFZpc2liaWxpdHkge1xuICAgIE5vbmUsXG4gICAgU2VsZixcbiAgICBTa2lwU2VsZlxufVxuXG4vKipcbiAqIFJlZmxlY3RzIGEgZGVwZW5kZW5jeSBtZXRhZGF0YS5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBJUGFyYW1ldGVyIHtcbiAgICAvKipcbiAgICAgKiBEZXBlbmRlbmN5IHRva2VuIG5hbWVcbiAgICAgKi9cbiAgICBkaXNwbGF5TmFtZTogc3RyaW5nO1xuICAgIC8qKlxuICAgICAqIERlcGVuZGVuY3kgdG9rZW5cbiAgICAgKi9cbiAgICB0b2tlbjogVHlwZTxhbnk+IHwgSW5qZWN0aW9uVG9rZW48YW55PjtcbiAgICAvKipcbiAgICAgKiBJZiBtYXJrZWQgd2l0aCBAT3B0aW9uYWwoKVxuICAgICAqL1xuICAgIG9wdGlvbmFsOiBib29sZWFuO1xuICAgIC8qKlxuICAgICAqIElmIG1hcmtlZCB3aXRoIEBTZWxmKCkgb3IgQFNraXBTZWxmKClcbiAgICAgKi9cbiAgICB2aXNpYmlsaXR5OiBWaXNpYmlsaXR5O1xufVxuIl19 |
@@ -5,2 +5,3 @@ /** | ||
export * from './public_api'; | ||
export { depsFactory as ɵe } from './lib/deps-factory'; | ||
export { moqInjectorProvidersFactory as ɵa } from './lib/moq-injector-providers.factory'; | ||
@@ -10,2 +11,2 @@ export { parametersStaticProviders as ɵd } from './lib/parameters-static-providers.factory'; | ||
export { typeStaticProvider as ɵc } from './lib/static-provider.factory'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmctYXV0by1tb3EuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy1hdXRvLW1vcS8iLCJzb3VyY2VzIjpbIm5nLWF1dG8tbW9xLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUM7QUFFN0IsT0FBTyxFQUFDLDJCQUEyQixJQUFJLEVBQUUsRUFBQyxNQUFNLHNDQUFzQyxDQUFDO0FBQ3ZGLE9BQU8sRUFBQyx5QkFBeUIsSUFBSSxFQUFFLEVBQUMsTUFBTSwyQ0FBMkMsQ0FBQztBQUMxRixPQUFPLEVBQUMsU0FBUyxJQUFJLEVBQUUsRUFBQyxNQUFNLGlCQUFpQixDQUFDO0FBQ2hELE9BQU8sRUFBQyxrQkFBa0IsSUFBSSxFQUFFLEVBQUMsTUFBTSwrQkFBK0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWNfYXBpJztcblxuZXhwb3J0IHttb3FJbmplY3RvclByb3ZpZGVyc0ZhY3RvcnkgYXMgybVhfSBmcm9tICcuL2xpYi9tb3EtaW5qZWN0b3ItcHJvdmlkZXJzLmZhY3RvcnknO1xuZXhwb3J0IHtwYXJhbWV0ZXJzU3RhdGljUHJvdmlkZXJzIGFzIMm1ZH0gZnJvbSAnLi9saWIvcGFyYW1ldGVycy1zdGF0aWMtcHJvdmlkZXJzLmZhY3RvcnknO1xuZXhwb3J0IHtyZWZsZWN0b3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5JztcbmV4cG9ydCB7cGFyYW1ldGVyc1N0YXRpY1Byb3ZpZGVycyBhcyDJtWR9IGZyb20gJy4vbGliL3BhcmFtZXRlcnMtc3RhdGljLXByb3ZpZGVycy5mYWN0b3J5JztcbmV4cG9ydCB7cmVmbGVjdG9yIGFzIMm1Yn0gZnJvbSAnLi9saWIvcmVmbGVjdG9yJztcbmV4cG9ydCB7dHlwZVN0YXRpY1Byb3ZpZGVyIGFzIMm1Y30gZnJvbSAnLi9saWIvc3RhdGljLXByb3ZpZGVyLmZhY3RvcnknOyJdfQ== |
@@ -119,3 +119,3 @@ import { Inject, Type, Optional, Self, SkipSelf, InjectionToken, resolveForwardRef } from '@angular/core'; | ||
function providerResolver(parameter, mocked) { | ||
function providerFactory(parameter, mocked) { | ||
return { provide: parameter.token, useValue: mocked }; | ||
@@ -128,6 +128,6 @@ } | ||
function* parametersStaticProviders(parameters, _providerResolver = providerResolver, _mockFactory = mockFactory) { | ||
function* parametersStaticProviders(parameters, _providerResolver = providerFactory, _mockFactory = mockFactory) { | ||
for (const parameter of parameters) { | ||
const mock = _mockFactory(parameter, mockFactory); | ||
const staticProvider = _providerResolver(parameter, mock.object(), providerResolver); | ||
const staticProvider = _providerResolver(parameter, mock.object(), providerFactory); | ||
if (staticProvider !== undefined) { | ||
@@ -139,7 +139,17 @@ yield staticProvider; | ||
function moqInjectorProvidersFactory(_reflector = reflector, _typeStaticProvider = typeStaticProvider, _parametersStaticProviders = parametersStaticProviders) { | ||
function depsFactory(parameters) { | ||
return parameters | ||
.map(p => { | ||
if (p.optional === true) { | ||
return [new Optional(), p.token]; | ||
} | ||
return p.token; | ||
}); | ||
} | ||
function moqInjectorProvidersFactory(_reflector = reflector, _typeStaticProvider = typeStaticProvider, _parametersStaticProviders = parametersStaticProviders, _depsFactory = depsFactory) { | ||
return (type, options = {}) => { | ||
const parameters = _reflector(type); | ||
const providers = Array.from(_parametersStaticProviders(parameters, options.providerResolver, options.mockFactory)); | ||
const provider = _typeStaticProvider(type, providers.map(p => p.provide)); | ||
const provider = _typeStaticProvider(type, _depsFactory(parameters)); | ||
const providers = Array.from(_parametersStaticProviders(parameters, options.providerFactory, options.mockFactory)); | ||
return options.skipSelf ? providers : [provider, ...providers]; | ||
@@ -173,3 +183,3 @@ }; | ||
export { moqInjectorProviders, resolveMock, moqInjectorProvidersFactory as ɵa, reflector as ɵb, typeStaticProvider as ɵc, parametersStaticProviders as ɵd }; | ||
export { moqInjectorProviders, resolveMock, moqInjectorProvidersFactory as ɵa, reflector as ɵb, typeStaticProvider as ɵc, parametersStaticProviders as ɵd, depsFactory as ɵe }; | ||
//# sourceMappingURL=ng-auto-moq.js.map |
@@ -131,3 +131,3 @@ import { __values, __generator, __spread } from 'tslib'; | ||
function providerResolver(parameter, mocked) { | ||
function providerFactory(parameter, mocked) { | ||
return { provide: parameter.token, useValue: mocked }; | ||
@@ -143,3 +143,3 @@ } | ||
var e_1, _a; | ||
if (_providerResolver === void 0) { _providerResolver = providerResolver; } | ||
if (_providerResolver === void 0) { _providerResolver = providerFactory; } | ||
if (_mockFactory === void 0) { _mockFactory = mockFactory; } | ||
@@ -156,3 +156,3 @@ return __generator(this, function (_b) { | ||
mock = _mockFactory(parameter, mockFactory); | ||
staticProvider = _providerResolver(parameter, mock.object(), providerResolver); | ||
staticProvider = _providerResolver(parameter, mock.object(), providerFactory); | ||
if (!(staticProvider !== undefined)) return [3 /*break*/, 3]; | ||
@@ -182,11 +182,22 @@ return [4 /*yield*/, staticProvider]; | ||
function moqInjectorProvidersFactory(_reflector, _typeStaticProvider, _parametersStaticProviders) { | ||
function depsFactory(parameters) { | ||
return parameters | ||
.map(function (p) { | ||
if (p.optional === true) { | ||
return [new Optional(), p.token]; | ||
} | ||
return p.token; | ||
}); | ||
} | ||
function moqInjectorProvidersFactory(_reflector, _typeStaticProvider, _parametersStaticProviders, _depsFactory) { | ||
if (_reflector === void 0) { _reflector = reflector; } | ||
if (_typeStaticProvider === void 0) { _typeStaticProvider = typeStaticProvider; } | ||
if (_parametersStaticProviders === void 0) { _parametersStaticProviders = parametersStaticProviders; } | ||
if (_depsFactory === void 0) { _depsFactory = depsFactory; } | ||
return function (type, options) { | ||
if (options === void 0) { options = {}; } | ||
var parameters = _reflector(type); | ||
var providers = Array.from(_parametersStaticProviders(parameters, options.providerResolver, options.mockFactory)); | ||
var provider = _typeStaticProvider(type, providers.map(function (p) { return p.provide; })); | ||
var provider = _typeStaticProvider(type, _depsFactory(parameters)); | ||
var providers = Array.from(_parametersStaticProviders(parameters, options.providerFactory, options.mockFactory)); | ||
return options.skipSelf ? providers : __spread([provider], providers); | ||
@@ -220,3 +231,3 @@ }; | ||
export { moqInjectorProviders, resolveMock, moqInjectorProvidersFactory as ɵa, reflector as ɵb, typeStaticProvider as ɵc, parametersStaticProviders as ɵd }; | ||
export { moqInjectorProviders, resolveMock, moqInjectorProvidersFactory as ɵa, reflector as ɵb, typeStaticProvider as ɵc, parametersStaticProviders as ɵd, depsFactory as ɵe }; | ||
//# sourceMappingURL=ng-auto-moq.js.map |
@@ -5,2 +5,3 @@ import { reflector } from "./reflector"; | ||
import { MoqInjectorProviders } from "./types"; | ||
export declare function moqInjectorProvidersFactory(_reflector?: typeof reflector, _typeStaticProvider?: typeof typeStaticProvider, _parametersStaticProviders?: typeof parametersStaticProviders): MoqInjectorProviders; | ||
import { depsFactory } from "./deps-factory"; | ||
export declare function moqInjectorProvidersFactory(_reflector?: typeof reflector, _typeStaticProvider?: typeof typeStaticProvider, _parametersStaticProviders?: typeof parametersStaticProviders, _depsFactory?: typeof depsFactory): MoqInjectorProviders; |
@@ -1,2 +0,2 @@ | ||
import { IParameter, MockFactory, OnlyStaticProvider, ProviderResolver } from "./types"; | ||
export declare function parametersStaticProviders<T>(parameters: IParameter[], _providerResolver?: ProviderResolver, _mockFactory?: MockFactory): IterableIterator<OnlyStaticProvider>; | ||
import { IParameter, MockFactory, OnlyStaticProvider, ProviderFactory } from "./types"; | ||
export declare function parametersStaticProviders<T>(parameters: IParameter[], _providerResolver?: ProviderFactory, _mockFactory?: MockFactory): IterableIterator<OnlyStaticProvider>; |
import { ConstructorProvider, ExistingProvider, FactoryProvider, InjectionToken, StaticClassProvider, StaticProvider, Type, ValueProvider } from "@angular/core"; | ||
import { IMock } from "moq.ts"; | ||
import { DefaultMockFactory } from "./mock-factory"; | ||
import { DefaultProviderResolver } from "./provider-resolver"; | ||
import { DefaultProviderFactory } from "./provider-factory"; | ||
export declare type MockFactory = (parameter: IParameter, defaultMockFactory: DefaultMockFactory) => IMock<any>; | ||
export declare type OnlyStaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider; | ||
export declare type ProviderResolver = (parameter: IParameter, mocked: any, defaultProviderResolver: DefaultProviderResolver) => OnlyStaticProvider; | ||
export declare type ProviderFactory = (parameter: IParameter, mocked: any, defaultProviderResolver: DefaultProviderFactory) => OnlyStaticProvider; | ||
export interface IOptions<T> { | ||
providerResolver?: ProviderResolver; | ||
/** | ||
* Creates one of angular Provider for provided dependency and constructed mock | ||
*/ | ||
providerFactory?: ProviderFactory; | ||
/** | ||
* Constructs a mock object for provided dependency | ||
*/ | ||
mockFactory?: MockFactory; | ||
@@ -27,3 +33,9 @@ /** | ||
export interface IParameter { | ||
/** | ||
* Dependency token name | ||
*/ | ||
displayName: string; | ||
/** | ||
* Dependency token | ||
*/ | ||
token: Type<any> | InjectionToken<any>; | ||
@@ -30,0 +42,0 @@ /** |
@@ -5,2 +5,3 @@ /** | ||
export * from './public_api'; | ||
export { depsFactory as ɵe } from './lib/deps-factory'; | ||
export { moqInjectorProvidersFactory as ɵa } from './lib/moq-injector-providers.factory'; | ||
@@ -7,0 +8,0 @@ export { parametersStaticProviders as ɵd } from './lib/parameters-static-providers.factory'; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"moqInjectorProviders":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ɵa"}},"MockFactory":{"__symbolic":"interface"},"OnlyStaticProvider":{"__symbolic":"interface"},"ProviderResolver":{"__symbolic":"interface"},"IOptions":{"__symbolic":"interface"},"MoqInjectorProviders":{"__symbolic":"interface"},"Visibility":{"None":0,"Self":1,"SkipSelf":2},"IParameter":{"__symbolic":"interface"},"resolveMock":{"__symbolic":"function"},"ɵa":{"__symbolic":"function","parameters":["_reflector","_typeStaticProvider","_parametersStaticProviders"],"defaults":[{"__symbolic":"reference","name":"ɵb"},{"__symbolic":"reference","name":"ɵc"},{"__symbolic":"reference","name":"ɵd"}],"value":{"__symbolic":"error","message":"Lambda not supported","line":10,"character":11,"module":"./lib/moq-injector-providers.factory"}},"ɵb":{"__symbolic":"function"},"ɵc":{"__symbolic":"function"},"ɵd":{"__symbolic":"function"}},"origins":{"moqInjectorProviders":"./lib/moq-injector-providers","MockFactory":"./lib/types","OnlyStaticProvider":"./lib/types","ProviderResolver":"./lib/types","IOptions":"./lib/types","MoqInjectorProviders":"./lib/types","Visibility":"./lib/types","IParameter":"./lib/types","resolveMock":"./lib/resolveMock","ɵa":"./lib/moq-injector-providers.factory","ɵb":"./lib/reflector","ɵc":"./lib/static-provider.factory","ɵd":"./lib/parameters-static-providers.factory"},"importAs":"ng-auto-moq"} | ||
{"__symbolic":"module","version":4,"metadata":{"moqInjectorProviders":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ɵa"}},"MockFactory":{"__symbolic":"interface"},"OnlyStaticProvider":{"__symbolic":"interface"},"ProviderFactory":{"__symbolic":"interface"},"IOptions":{"__symbolic":"interface"},"MoqInjectorProviders":{"__symbolic":"interface"},"Visibility":{"None":0,"Self":1,"SkipSelf":2},"IParameter":{"__symbolic":"interface"},"resolveMock":{"__symbolic":"function"},"ɵa":{"__symbolic":"function","parameters":["_reflector","_typeStaticProvider","_parametersStaticProviders","_depsFactory"],"defaults":[{"__symbolic":"reference","name":"ɵb"},{"__symbolic":"reference","name":"ɵc"},{"__symbolic":"reference","name":"ɵd"},{"__symbolic":"reference","name":"ɵe"}],"value":{"__symbolic":"error","message":"Lambda not supported","line":12,"character":11,"module":"./lib/moq-injector-providers.factory"}},"ɵb":{"__symbolic":"function"},"ɵc":{"__symbolic":"function"},"ɵd":{"__symbolic":"function"},"ɵe":{"__symbolic":"function","parameters":["parameters"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"parameters"},"member":"map"},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":5,"character":13,"module":"./lib/deps-factory"}]}}},"origins":{"moqInjectorProviders":"./lib/moq-injector-providers","MockFactory":"./lib/types","OnlyStaticProvider":"./lib/types","ProviderFactory":"./lib/types","IOptions":"./lib/types","MoqInjectorProviders":"./lib/types","Visibility":"./lib/types","IParameter":"./lib/types","resolveMock":"./lib/resolveMock","ɵa":"./lib/moq-injector-providers.factory","ɵb":"./lib/reflector","ɵc":"./lib/static-provider.factory","ɵd":"./lib/parameters-static-providers.factory","ɵe":"./lib/deps-factory"},"importAs":"ng-auto-moq"} |
{ | ||
"name": "ng-auto-moq", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"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
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
211335
47
1343