From 418dabdeab5107ee8e28ee4cbbb907a39842f480 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Thu, 17 Oct 2019 02:08:44 -0500 Subject: [PATCH] fix: add generic type for ModuleWithProviders --- .gitignore | 1 + http-client-in-memory-web-api.module.d.ts | 4 +- http-client-in-memory-web-api.module.js.map | 2 +- in-memory-web-api.module.d.ts | 4 +- in-memory-web-api.module.js.map | 2 +- package-lock.json | 92 ++++++++++++++----- .../http-client-in-memory-web-api.module.ts | 4 +- src/in-mem/in-memory-web-api.module.ts | 4 +- 8 files changed, 79 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 98a45e9..5b86b24 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ src/**/*.js src/**/*.js.map src/**/*.metadata.json yarn.lock +.idea diff --git a/http-client-in-memory-web-api.module.d.ts b/http-client-in-memory-web-api.module.d.ts index a565daa..f1e7843 100644 --- a/http-client-in-memory-web-api.module.d.ts +++ b/http-client-in-memory-web-api.module.d.ts @@ -18,12 +18,12 @@ export declare class HttpClientInMemoryWebApiModule { * HttpInMemoryWebApiModule.forRoot(dbCreator); * HttpInMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}}); */ - static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders; + static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders; /** * * Enable and configure the in-memory web api in a lazy-loaded feature module. * Same as `forRoot`. * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules. */ - static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders; + static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders; } diff --git a/http-client-in-memory-web-api.module.js.map b/http-client-in-memory-web-api.module.js.map index c123fa1..81216c8 100644 --- a/http-client-in-memory-web-api.module.js.map +++ b/http-client-in-memory-web-api.module.js.map @@ -1 +1 @@ -{"version":3,"file":"http-client-in-memory-web-api.module.js","sourceRoot":"","sources":["http-client-in-memory-web-api.module.ts"],"names":[],"mappings":"AAAA,mCAAmC;;;;;;;AAEnC,OAAO,EAAE,QAAQ,EAA6B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAEL,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,kEAAkE;AAClE,sCAAsC;AACtC,MAAM,UAAU,oCAAoC,CAClD,SAA4B,EAC5B,OAA8B,EAC9B,UAAsB;IAEtB,IAAM,OAAO,GAAQ,IAAI,wBAAwB,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAClF,OAAO,OAAO,CAAC;AACjB,CAAC;AAGD;IAAA;IAsCA,CAAC;uCAtCY,8BAA8B;IACzC;;;;;;;;;;;;;;MAcE;IACK,sCAAO,GAAd,UAAe,SAAkC,EAAE,OAAmC;QACpF,OAAO;YACL,QAAQ,EAAE,gCAA8B;YACxC,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,iBAAiB,EAAG,QAAQ,EAAE,SAAS,EAAE;gBACpD,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,EAAE;gBAErD,EAAE,OAAO,EAAE,WAAW;oBACpB,UAAU,EAAE,oCAAoC;oBAChD,IAAI,EAAE,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,UAAU,CAAC,EAAC;aAChE;SACF,CAAC;IACJ,CAAC;IACC;;;;;KAKC;IACI,yCAAU,GAAjB,UAAkB,SAAkC,EAAE,OAAmC;QACvF,OAAO,gCAA8B,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;;IArCU,8BAA8B;QAD1C,QAAQ,CAAC,EAAE,CAAC;OACA,8BAA8B,CAsC1C;IAAD,qCAAC;CAAA,AAtCD,IAsCC;SAtCY,8BAA8B","sourcesContent":["////// HttpClient-Only version ////\n\nimport { NgModule, ModuleWithProviders, Type } from '@angular/core';\nimport { HttpBackend, XhrFactory } from '@angular/common/http';\n\nimport {\n InMemoryBackendConfigArgs,\n InMemoryBackendConfig,\n InMemoryDbService\n} from './interfaces';\n\nimport { HttpClientBackendService } from './http-client-backend.service';\n\n// Internal - Creates the in-mem backend for the HttpClient module\n// AoT requires factory to be exported\nexport function httpClientInMemBackendServiceFactory(\n dbService: InMemoryDbService,\n options: InMemoryBackendConfig,\n xhrFactory: XhrFactory,\n): HttpBackend {\n const backend: any = new HttpClientBackendService(dbService, options, xhrFactory);\n return backend;\n}\n\n@NgModule({})\nexport class HttpClientInMemoryWebApiModule {\n /**\n * Redirect the Angular `HttpClient` XHR calls\n * to in-memory data store that implements `InMemoryDbService`.\n * with class that implements InMemoryDbService and creates an in-memory database.\n *\n * Usually imported in the root application module.\n * Can import in a lazy feature module too, which will shadow modules loaded earlier\n *\n * @param {Type} dbCreator - Class that creates seed data for in-memory database. Must implement InMemoryDbService.\n * @param {InMemoryBackendConfigArgs} [options]\n *\n * @example\n * HttpInMemoryWebApiModule.forRoot(dbCreator);\n * HttpInMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}});\n */\n static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders {\n return {\n ngModule: HttpClientInMemoryWebApiModule,\n providers: [\n { provide: InMemoryDbService, useClass: dbCreator },\n { provide: InMemoryBackendConfig, useValue: options },\n\n { provide: HttpBackend,\n useFactory: httpClientInMemBackendServiceFactory,\n deps: [InMemoryDbService, InMemoryBackendConfig, XhrFactory]}\n ]\n };\n }\n /**\n *\n * Enable and configure the in-memory web api in a lazy-loaded feature module.\n * Same as `forRoot`.\n * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules.\n */\n static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders {\n return HttpClientInMemoryWebApiModule.forRoot(dbCreator, options);\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"http-client-in-memory-web-api.module.js","sourceRoot":"","sources":["http-client-in-memory-web-api.module.ts"],"names":[],"mappings":"AAAA,mCAAmC;;;;;;;AAEnC,OAAO,EAAE,QAAQ,EAA6B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAEL,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,kEAAkE;AAClE,sCAAsC;AACtC,MAAM,UAAU,oCAAoC,CAClD,SAA4B,EAC5B,OAA8B,EAC9B,UAAsB;IAEtB,IAAM,OAAO,GAAQ,IAAI,wBAAwB,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAClF,OAAO,OAAO,CAAC;AACjB,CAAC;AAGD;IAAA;IAsCA,CAAC;uCAtCY,8BAA8B;IACzC;;;;;;;;;;;;;;MAcE;IACK,sCAAO,GAAd,UAAe,SAAkC,EAAE,OAAmC;QACpF,OAAO;YACL,QAAQ,EAAE,gCAA8B;YACxC,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,iBAAiB,EAAG,QAAQ,EAAE,SAAS,EAAE;gBACpD,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,EAAE;gBAErD,EAAE,OAAO,EAAE,WAAW;oBACpB,UAAU,EAAE,oCAAoC;oBAChD,IAAI,EAAE,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,UAAU,CAAC,EAAC;aAChE;SACF,CAAC;IACJ,CAAC;IACC;;;;;KAKC;IACI,yCAAU,GAAjB,UAAkB,SAAkC,EAAE,OAAmC;QACvF,OAAO,gCAA8B,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;;IArCU,8BAA8B;QAD1C,QAAQ,CAAC,EAAE,CAAC;OACA,8BAA8B,CAsC1C;IAAD,qCAAC;CAAA,AAtCD,IAsCC;SAtCY,8BAA8B","sourcesContent":["////// HttpClient-Only version ////\n\nimport { NgModule, ModuleWithProviders, Type } from '@angular/core';\nimport { HttpBackend, XhrFactory } from '@angular/common/http';\n\nimport {\n InMemoryBackendConfigArgs,\n InMemoryBackendConfig,\n InMemoryDbService\n} from './interfaces';\n\nimport { HttpClientBackendService } from './http-client-backend.service';\n\n// Internal - Creates the in-mem backend for the HttpClient module\n// AoT requires factory to be exported\nexport function httpClientInMemBackendServiceFactory(\n dbService: InMemoryDbService,\n options: InMemoryBackendConfig,\n xhrFactory: XhrFactory,\n): HttpBackend {\n const backend: any = new HttpClientBackendService(dbService, options, xhrFactory);\n return backend;\n}\n\n@NgModule({})\nexport class HttpClientInMemoryWebApiModule {\n /**\n * Redirect the Angular `HttpClient` XHR calls\n * to in-memory data store that implements `InMemoryDbService`.\n * with class that implements InMemoryDbService and creates an in-memory database.\n *\n * Usually imported in the root application module.\n * Can import in a lazy feature module too, which will shadow modules loaded earlier\n *\n * @param {Type} dbCreator - Class that creates seed data for in-memory database. Must implement InMemoryDbService.\n * @param {InMemoryBackendConfigArgs} [options]\n *\n * @example\n * HttpInMemoryWebApiModule.forRoot(dbCreator);\n * HttpInMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}});\n */\n static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders {\n return {\n ngModule: HttpClientInMemoryWebApiModule,\n providers: [\n { provide: InMemoryDbService, useClass: dbCreator },\n { provide: InMemoryBackendConfig, useValue: options },\n\n { provide: HttpBackend,\n useFactory: httpClientInMemBackendServiceFactory,\n deps: [InMemoryDbService, InMemoryBackendConfig, XhrFactory]}\n ]\n };\n }\n /**\n *\n * Enable and configure the in-memory web api in a lazy-loaded feature module.\n * Same as `forRoot`.\n * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules.\n */\n static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders {\n return HttpClientInMemoryWebApiModule.forRoot(dbCreator, options);\n }\n}\n"]} \ No newline at end of file diff --git a/in-memory-web-api.module.d.ts b/in-memory-web-api.module.d.ts index a149ebc..feda453 100644 --- a/in-memory-web-api.module.d.ts +++ b/in-memory-web-api.module.d.ts @@ -16,12 +16,12 @@ export declare class InMemoryWebApiModule { * InMemoryWebApiModule.forRoot(dbCreator); * InMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}}); */ - static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders; + static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders; /** * * Enable and configure the in-memory web api in a lazy-loaded feature module. * Same as `forRoot`. * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules. */ - static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders; + static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders; } diff --git a/in-memory-web-api.module.js.map b/in-memory-web-api.module.js.map index d018ae5..429e85c 100644 --- a/in-memory-web-api.module.js.map +++ b/in-memory-web-api.module.js.map @@ -1 +1 @@ -{"version":3,"file":"in-memory-web-api.module.js","sourceRoot":"","sources":["in-memory-web-api.module.ts"],"names":[],"mappings":"AAAA,kDAAkD;;;;;;;AAElD,OAAO,EAAY,QAAQ,EAA6B,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAEL,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAG9F;IAAA;IAwCA,CAAC;6BAxCY,oBAAoB;IAC/B;;;;;;;;;;;;;;MAcE;IACK,4BAAO,GAAd,UAAe,SAAkC,EAAE,OAAmC;QACpF,OAAO;YACL,QAAQ,EAAE,sBAAoB;YAC9B,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,iBAAiB,EAAG,QAAQ,EAAE,SAAS,EAAE;gBACpD,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,EAAE;gBAGrD,EAAE,OAAO,EAAE,WAAW;oBACpB,UAAU,EAAE,oCAAoC;oBAChD,IAAI,EAAE,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,UAAU,CAAC,EAAC;aAChE;SACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,+BAAU,GAAjB,UAAkB,SAAkC,EAAE,OAAmC;QACvF,OAAO,sBAAoB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;;IAvCU,oBAAoB;QADhC,QAAQ,CAAC,EAAE,CAAC;OACA,oBAAoB,CAwChC;IAAD,2BAAC;CAAA,AAxCD,IAwCC;SAxCY,oBAAoB","sourcesContent":["////// For apps with both Http and HttpClient ////\n\nimport { Injector, NgModule, ModuleWithProviders, Type } from '@angular/core';\nimport { HttpBackend, XhrFactory } from '@angular/common/http';\n\nimport {\n InMemoryBackendConfigArgs,\n InMemoryBackendConfig,\n InMemoryDbService\n} from './interfaces';\n\nimport { httpClientInMemBackendServiceFactory } from './http-client-in-memory-web-api.module';\n\n@NgModule({})\nexport class InMemoryWebApiModule {\n /**\n * Redirect BOTH Angular `Http` and `HttpClient` XHR calls\n * to in-memory data store that implements `InMemoryDbService`.\n * with class that implements InMemoryDbService and creates an in-memory database.\n *\n * Usually imported in the root application module.\n * Can import in a lazy feature module too, which will shadow modules loaded earlier\n *\n * @param {Type} dbCreator - Class that creates seed data for in-memory database. Must implement InMemoryDbService.\n * @param {InMemoryBackendConfigArgs} [options]\n *\n * @example\n * InMemoryWebApiModule.forRoot(dbCreator);\n * InMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}});\n */\n static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders {\n return {\n ngModule: InMemoryWebApiModule,\n providers: [\n { provide: InMemoryDbService, useClass: dbCreator },\n { provide: InMemoryBackendConfig, useValue: options },\n\n\n { provide: HttpBackend,\n useFactory: httpClientInMemBackendServiceFactory,\n deps: [InMemoryDbService, InMemoryBackendConfig, XhrFactory]}\n ]\n };\n }\n\n /**\n *\n * Enable and configure the in-memory web api in a lazy-loaded feature module.\n * Same as `forRoot`.\n * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules.\n */\n static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders {\n return InMemoryWebApiModule.forRoot(dbCreator, options);\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"in-memory-web-api.module.js","sourceRoot":"","sources":["in-memory-web-api.module.ts"],"names":[],"mappings":"AAAA,kDAAkD;;;;;;;AAElD,OAAO,EAAY,QAAQ,EAA6B,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAEL,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAG9F;IAAA;IAwCA,CAAC;6BAxCY,oBAAoB;IAC/B;;;;;;;;;;;;;;MAcE;IACK,4BAAO,GAAd,UAAe,SAAkC,EAAE,OAAmC;QACpF,OAAO;YACL,QAAQ,EAAE,sBAAoB;YAC9B,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,iBAAiB,EAAG,QAAQ,EAAE,SAAS,EAAE;gBACpD,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,EAAE;gBAGrD,EAAE,OAAO,EAAE,WAAW;oBACpB,UAAU,EAAE,oCAAoC;oBAChD,IAAI,EAAE,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,UAAU,CAAC,EAAC;aAChE;SACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,+BAAU,GAAjB,UAAkB,SAAkC,EAAE,OAAmC;QACvF,OAAO,sBAAoB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;;IAvCU,oBAAoB;QADhC,QAAQ,CAAC,EAAE,CAAC;OACA,oBAAoB,CAwChC;IAAD,2BAAC;CAAA,AAxCD,IAwCC;SAxCY,oBAAoB","sourcesContent":["////// For apps with both Http and HttpClient ////\n\nimport { Injector, NgModule, ModuleWithProviders, Type } from '@angular/core';\nimport { HttpBackend, XhrFactory } from '@angular/common/http';\n\nimport {\n InMemoryBackendConfigArgs,\n InMemoryBackendConfig,\n InMemoryDbService\n} from './interfaces';\n\nimport { httpClientInMemBackendServiceFactory } from './http-client-in-memory-web-api.module';\n\n@NgModule({})\nexport class InMemoryWebApiModule {\n /**\n * Redirect BOTH Angular `Http` and `HttpClient` XHR calls\n * to in-memory data store that implements `InMemoryDbService`.\n * with class that implements InMemoryDbService and creates an in-memory database.\n *\n * Usually imported in the root application module.\n * Can import in a lazy feature module too, which will shadow modules loaded earlier\n *\n * @param {Type} dbCreator - Class that creates seed data for in-memory database. Must implement InMemoryDbService.\n * @param {InMemoryBackendConfigArgs} [options]\n *\n * @example\n * InMemoryWebApiModule.forRoot(dbCreator);\n * InMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}});\n */\n static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders {\n return {\n ngModule: InMemoryWebApiModule,\n providers: [\n { provide: InMemoryDbService, useClass: dbCreator },\n { provide: InMemoryBackendConfig, useValue: options },\n\n\n { provide: HttpBackend,\n useFactory: httpClientInMemBackendServiceFactory,\n deps: [InMemoryDbService, InMemoryBackendConfig, XhrFactory]}\n ]\n };\n }\n\n /**\n *\n * Enable and configure the in-memory web api in a lazy-loaded feature module.\n * Same as `forRoot`.\n * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules.\n */\n static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders {\n return InMemoryWebApiModule.forRoot(dbCreator, options);\n }\n}\n"]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1c52d13..453460a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -570,6 +570,7 @@ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", "dev": true, + "optional": true, "requires": { "es6-promisify": "^5.0.0" } @@ -1492,6 +1493,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "dev": true, + "optional": true, "requires": { "hoek": "2.x.x" } @@ -2467,7 +2469,8 @@ "version": "0.0.2", "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz", "integrity": "sha1-JrOIXRD6E9t/wBquOquHAZngEkw=", - "dev": true + "dev": true, + "optional": true }, "buffer-xor": { "version": "1.0.3", @@ -2695,7 +2698,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2750,7 +2754,8 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2867,7 +2872,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2909,6 +2915,7 @@ "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -2927,6 +2934,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3020,6 +3028,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -3105,7 +3114,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -3141,6 +3151,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3160,6 +3171,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3203,12 +3215,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -4271,6 +4285,7 @@ "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, + "optional": true, "requires": { "es6-promise": "^4.0.3" } @@ -5081,7 +5096,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -5496,7 +5512,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -5552,6 +5569,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -5595,12 +5613,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -6448,7 +6468,8 @@ "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true + "dev": true, + "optional": true }, "homedir-polyfill": { "version": "1.0.1", @@ -6493,6 +6514,7 @@ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", "dev": true, + "optional": true, "requires": { "agent-base": "4", "debug": "3.1.0" @@ -6503,6 +6525,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, + "optional": true, "requires": { "ms": "2.0.0" } @@ -6541,6 +6564,7 @@ "resolved": "https://registry.npmjs.org/httpntlm/-/httpntlm-1.6.1.tgz", "integrity": "sha1-rQFScUOi6Hc8+uapb1hla7UqNLI=", "dev": true, + "optional": true, "requires": { "httpreq": ">=0.4.22", "underscore": "~1.7.0" @@ -6550,7 +6574,8 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/httpreq/-/httpreq-0.4.24.tgz", "integrity": "sha1-QzX/2CzZaWaKOUZckprGHWOTYn8=", - "dev": true + "dev": true, + "optional": true }, "https-browserify": { "version": "1.0.0", @@ -6563,6 +6588,7 @@ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", "dev": true, + "optional": true, "requires": { "agent-base": "^4.1.0", "debug": "^3.1.0" @@ -6573,6 +6599,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, + "optional": true, "requires": { "ms": "^2.1.1" } @@ -6581,7 +6608,8 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true + "dev": true, + "optional": true } } }, @@ -6666,7 +6694,8 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", - "dev": true + "dev": true, + "optional": true }, "is-absolute": { "version": "1.0.0", @@ -6895,7 +6924,8 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true + "dev": true, + "optional": true }, "is-relative": { "version": "1.0.0", @@ -7786,13 +7816,15 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/libbase64/-/libbase64-0.1.0.tgz", "integrity": "sha1-YjUag5VjrF/1vSbxL2Dpgwu3UeY=", - "dev": true + "dev": true, + "optional": true }, "libmime": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/libmime/-/libmime-3.0.0.tgz", "integrity": "sha1-UaGp50SOy9Ms2lRCFnW7IbwJPaY=", "dev": true, + "optional": true, "requires": { "iconv-lite": "0.4.15", "libbase64": "0.1.0", @@ -7803,7 +7835,8 @@ "version": "0.4.15", "resolved": "http://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz", "integrity": "sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es=", - "dev": true + "dev": true, + "optional": true } } }, @@ -7811,7 +7844,8 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/libqp/-/libqp-1.1.0.tgz", "integrity": "sha1-9ebgatdLeU+1tbZpiL9yjvHe2+g=", - "dev": true + "dev": true, + "optional": true }, "liftoff": { "version": "2.5.0", @@ -8852,13 +8886,15 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz", "integrity": "sha1-ecSQihwPXzdbc/6IjamCj23JY6Q=", - "dev": true + "dev": true, + "optional": true }, "nodemailer-shared": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz", "integrity": "sha1-z1mU4v0mjQD1zw+nZ6CBae2wfsA=", "dev": true, + "optional": true, "requires": { "nodemailer-fetch": "1.6.0" } @@ -8891,7 +8927,8 @@ "version": "0.1.10", "resolved": "https://registry.npmjs.org/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz", "integrity": "sha1-WG24EB2zDLRDjrVGc3pBqtDPE9U=", - "dev": true + "dev": true, + "optional": true }, "normalize-package-data": { "version": "2.4.0", @@ -9686,7 +9723,8 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true + "dev": true, + "optional": true }, "preserve": { "version": "0.2.0", @@ -10823,13 +10861,15 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.1.tgz", "integrity": "sha512-RFqinRVJVcCAL9Uh1oVqE6FZkqsyLiVOYEZ20TqIOjuX7iFVJ+zsbs4RIghnw/pTs7mZvt8ZHhvm1ZUrR4fykg==", - "dev": true + "dev": true, + "optional": true }, "smtp-connection": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/smtp-connection/-/smtp-connection-2.12.0.tgz", "integrity": "sha1-1275EnyyPCJZ7bHoNJwujV4tdME=", "dev": true, + "optional": true, "requires": { "httpntlm": "1.6.1", "nodemailer-shared": "1.1.0" @@ -11027,6 +11067,7 @@ "resolved": "https://registry.npmjs.org/socks/-/socks-2.2.1.tgz", "integrity": "sha512-0GabKw7n9mI46vcNrVfs0o6XzWzjVa3h6GaSo2UPxtWAROXUWavfJWh1M4PR5tnE0dcnQXZIDFP4yrAysLze/w==", "dev": true, + "optional": true, "requires": { "ip": "^1.1.5", "smart-buffer": "^4.0.1" @@ -11037,6 +11078,7 @@ "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz", "integrity": "sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw==", "dev": true, + "optional": true, "requires": { "agent-base": "~4.2.0", "socks": "~2.2.0" @@ -11606,6 +11648,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, + "optional": true, "requires": { "prelude-ls": "~1.1.2" } @@ -11715,7 +11758,8 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=", - "dev": true + "dev": true, + "optional": true }, "union": { "version": "0.4.6", diff --git a/src/in-mem/http-client-in-memory-web-api.module.ts b/src/in-mem/http-client-in-memory-web-api.module.ts index e0a3ef6..3d13e8b 100644 --- a/src/in-mem/http-client-in-memory-web-api.module.ts +++ b/src/in-mem/http-client-in-memory-web-api.module.ts @@ -39,7 +39,7 @@ export class HttpClientInMemoryWebApiModule { * HttpInMemoryWebApiModule.forRoot(dbCreator); * HttpInMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}}); */ - static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders { + static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders { return { ngModule: HttpClientInMemoryWebApiModule, providers: [ @@ -58,7 +58,7 @@ export class HttpClientInMemoryWebApiModule { * Same as `forRoot`. * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules. */ - static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders { + static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders { return HttpClientInMemoryWebApiModule.forRoot(dbCreator, options); } } diff --git a/src/in-mem/in-memory-web-api.module.ts b/src/in-mem/in-memory-web-api.module.ts index b3255e4..1dbeb88 100644 --- a/src/in-mem/in-memory-web-api.module.ts +++ b/src/in-mem/in-memory-web-api.module.ts @@ -28,7 +28,7 @@ export class InMemoryWebApiModule { * InMemoryWebApiModule.forRoot(dbCreator); * InMemoryWebApiModule.forRoot(dbCreator, {useValue: {delay:600}}); */ - static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders { + static forRoot(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders { return { ngModule: InMemoryWebApiModule, providers: [ @@ -49,7 +49,7 @@ export class InMemoryWebApiModule { * Same as `forRoot`. * This is a feel-good method so you can follow the Angular style guide for lazy-loaded modules. */ - static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders { + static forFeature(dbCreator: Type, options?: InMemoryBackendConfigArgs): ModuleWithProviders { return InMemoryWebApiModule.forRoot(dbCreator, options); } }