@paciolan/remote-module-loader 2.5.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ IE 11
2
+ > 0.5%
3
+ last 2 versions
4
+ not dead
package/README.md CHANGED
@@ -1,28 +1,28 @@
1
1
  # Remote Module Loader ![coverage:100%](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)
2
2
 
3
- ![Lunar Module](https://raw.githubusercontent.com/Paciolan/remote-module-loader/master/media/logo-small.png)
3
+ Loads a CommonJS module from a remote URL for the Browser or Node.js.
4
4
 
5
- Loads a CommonJS module from a remote url.
5
+ ![Lunar Module](https://raw.githubusercontent.com/Paciolan/remote-module-loader/master/media/logo-small.png)
6
6
 
7
- # Use Cases
7
+ ## Use Cases
8
8
 
9
9
  Lazy Load Modules to keep initial load times down and load modules just in time, similar to Webpack's code splitting.
10
10
 
11
11
  Update Remote Modules independent of the web application. Update a module without redeploying the web application.
12
12
 
13
- # Install
13
+ ## Install
14
14
 
15
15
  ```bash
16
16
  npm install @paciolan/remote-module-loader
17
17
  ```
18
18
 
19
- # createLoadRemoteModule
19
+ ## createLoadRemoteModule
20
20
 
21
21
  The `createLoadRemoteModule` function is used to inject dependencies into a `loadRemoteModule` function.
22
22
 
23
23
  It is recommended to create a separate file, in this example it is called `src/lib/loadRemoteModule.js`.
24
24
 
25
- ## Simple Example
25
+ ### Simple Example
26
26
 
27
27
  If your module has no external dependencies, this is the easiest method to fetch the remote module.
28
28
 
@@ -36,7 +36,7 @@ import createLoadRemoteModule from "@paciolan/remote-module-loader";
36
36
  export default createLoadRemoteModule();
37
37
  ```
38
38
 
39
- ## Require Example
39
+ ### Require Example
40
40
 
41
41
  You can pass dependencies to the module. All modules loaded with this version of `loadRemoteModule`, will have the dependencies available to `require`.
42
42
 
@@ -57,9 +57,11 @@ const requires = createRequires(dependencies);
57
57
  export default createLoadRemoteModule({ requires });
58
58
  ```
59
59
 
60
- ## Using your own fetcher
60
+ ### Using your own fetcher
61
+
62
+ The default loader can be overridden if you want to use an alternate method.
61
63
 
62
- By default `loadRemoteModule` will use the `XMLHttpRequest` object avaiable in the browser. This can be overridden if you want to use an alternate method.
64
+ This example uses `axios` for the fetcher.
63
65
 
64
66
  ```javascript
65
67
  /**
@@ -74,11 +76,11 @@ const fetcher = url => axios.get(url).then(request => request.data);
74
76
  export default createLoadRemoteModule({ fetcher });
75
77
  ```
76
78
 
77
- # Usage
79
+ ## Usage
78
80
 
79
81
  Modules are loaded asynchronously, so use similar techniques to any other async function.
80
82
 
81
- ## Promise Style
83
+ ### Promise Style
82
84
 
83
85
  ```javascript
84
86
  /**
@@ -115,20 +117,17 @@ const main = async () => {
115
117
  main();
116
118
  ```
117
119
 
118
- # Creating a Remote Module
120
+ ## Creating a Remote Module
119
121
 
120
122
  Remote Modules must be in the CommonJS format, using `exports` to export functionality.
121
123
 
122
124
  This is an example of a simple CommonJS module:
123
125
 
124
126
  ```javascript
125
- var name = "myModule";
126
-
127
127
  function helloWorld() {
128
128
  console.log("Hello World!");
129
129
  }
130
130
 
131
- exports.name = name;
132
131
  exports.default = helloWorld;
133
132
  ```
134
133
 
@@ -144,9 +143,9 @@ exports = {
144
143
  exports.default = "SUCCESS!";
145
144
  ```
146
145
 
147
- ## Webpack
146
+ ### Webpack
148
147
 
149
- Setting up Webpack to export a CommonJS is pretty easy.
148
+ Webpack can be setup to export as CommonJS.
150
149
 
151
150
  Inside `webpack.config.js`, set the `libraryTarget` to `"commonjs"`.
152
151
 
@@ -158,9 +157,9 @@ module.exports = {
158
157
  };
159
158
  ```
160
159
 
161
- Dependencies that will be provided by the Web Application that uses your Remote Module can be added to webpack's `externals` section.
160
+ Dependencies should be excluded from the bundle because they will be provided by the Web Application can be added to webpack's `externals` section.
162
161
 
163
- This will prevent webpack from bundling unwanted 3rd party libraries, decreasing the bundle size.
162
+ This will prevent webpack from bundling duplicate 3rd party libraries, decreasing the bundle size.
164
163
 
165
164
  ```javascript
166
165
  module.exports = {
@@ -168,13 +167,22 @@ module.exports = {
168
167
  libraryTarget: "commonjs"
169
168
  },
170
169
  externals: {
171
- react: "react",
172
- "prop-types": "prop-types"
170
+ react: "react"
173
171
  }
174
172
  };
175
173
  ```
176
174
 
177
- # Contributors
175
+ ## Content Security Policy (CSP)
176
+
177
+ Sites with a `content_security_policy` header set are likely to not work. CSP puts a restriction on using `new Function`, which `remote-module-loader` relies upon.
178
+
179
+ [Read more on CSP](https://developer.chrome.com/extensions/contentSecurityPolicy)
180
+
181
+ ## Alternatives
182
+
183
+ - [Webpack Module Federation](https://webpack.js.org/concepts/module-federation)
184
+
185
+ ## Contributors
178
186
 
179
187
  Joel Thoms (https://twitter.com/joelnet)
180
188
 
@@ -0,0 +1,2 @@
1
+ export { createLoadRemoteModule as default } from "./lib/loadRemoteModule";
2
+ export { createRequires } from "./lib/createRequires";
package/dist/index.js CHANGED
@@ -1,22 +1,15 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "default", {
7
- enumerable: true,
8
- get: function get() {
9
- return _loadRemoteModule.createLoadRemoteModule;
10
- }
11
- });
12
- Object.defineProperty(exports, "createRequires", {
13
- enumerable: true,
14
- get: function get() {
15
- return _createRequires.createRequires;
16
- }
17
- });
18
-
19
- var _loadRemoteModule = require("./lib/loadRemoteModule");
20
-
21
- var _createRequires = require("./lib/createRequires");
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ exports.__esModule = true;
10
+ exports.createRequires = exports["default"] = void 0;
11
+ var loadRemoteModule_1 = require("./lib/loadRemoteModule");
12
+ __createBinding(exports, loadRemoteModule_1, "createLoadRemoteModule", "default");
13
+ var createRequires_1 = require("./lib/createRequires");
14
+ __createBinding(exports, createRequires_1, "createRequires");
22
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AACA","sourcesContent":["export { createLoadRemoteModule as default } from \"./lib/loadRemoteModule\";\nexport { createRequires } from \"./lib/createRequires\";\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2DAA2E;AAAlE,kFAAiC;AAC1C,uDAAsD;AAA7C,6DAAc"}
@@ -0,0 +1,8 @@
1
+ interface Requires {
2
+ (name: string): any;
3
+ }
4
+ interface CreateRequires {
5
+ (dependencies?: object): Requires;
6
+ }
7
+ export declare const createRequires: CreateRequires;
8
+ export {};
@@ -1,19 +1,12 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ exports.__esModule = true;
6
3
  exports.createRequires = void 0;
7
-
8
- var createRequires = function createRequires(dependencies) {
9
- return function (name) {
10
- if (!(name in (dependencies || {}))) {
11
- throw new Error("Could not require '".concat(name, "'. '").concat(name, "' does not exist in dependencies."));
4
+ var createRequires = function (dependencies) { return function (name) {
5
+ var _dependencies = dependencies || {};
6
+ if (!(name in _dependencies)) {
7
+ throw new Error("Could not require '" + name + "'. '" + name + "' does not exist in dependencies.");
12
8
  }
13
-
14
- return dependencies[name];
15
- };
16
- };
17
-
9
+ return _dependencies[name];
10
+ }; };
18
11
  exports.createRequires = createRequires;
19
12
  //# sourceMappingURL=createRequires.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/createRequires.js"],"names":["createRequires","dependencies","name","Error"],"mappings":";;;;;;;AAAO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAAAC,YAAY;AAAA,SAAI,UAAAC,IAAI,EAAI;AACpD,QAAI,EAAEA,IAAI,KAAKD,YAAY,IAAI,EAArB,CAAN,CAAJ,EAAqC;AACnC,YAAM,IAAIE,KAAJ,8BACkBD,IADlB,iBAC6BA,IAD7B,uCAAN;AAGD;;AAED,WAAOD,YAAY,CAACC,IAAD,CAAnB;AACD,GARyC;AAAA,CAAnC","sourcesContent":["export const createRequires = dependencies => name => {\n if (!(name in (dependencies || {}))) {\n throw new Error(\n `Could not require '${name}'. '${name}' does not exist in dependencies.`\n );\n }\n\n return dependencies[name];\n};\n"],"file":"createRequires.js"}
1
+ {"version":3,"file":"createRequires.js","sourceRoot":"","sources":["../../src/lib/createRequires.ts"],"names":[],"mappings":";;;AAQO,IAAM,cAAc,GAAmB,UAAA,YAAY,IAAI,OAAA,UAAA,IAAI;IAChE,IAAM,aAAa,GAAG,YAAY,IAAI,EAAE,CAAC;IAEzC,IAAI,CAAC,CAAC,IAAI,IAAI,aAAa,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CACb,wBAAsB,IAAI,YAAO,IAAI,sCAAmC,CACzE,CAAC;KACH;IAED,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC,EAV6D,CAU7D,CAAC;AAVW,QAAA,cAAc,kBAUzB"}
@@ -0,0 +1,12 @@
1
+ export interface CreateLoadRemoteModuleOptions {
2
+ requires?: any;
3
+ fetcher?: any;
4
+ }
5
+ interface LoadRemoteModule {
6
+ (url: string): Promise<any>;
7
+ }
8
+ interface CreateLoadRemoteModule {
9
+ (options?: CreateLoadRemoteModuleOptions): LoadRemoteModule;
10
+ }
11
+ export declare const createLoadRemoteModule: CreateLoadRemoteModule;
12
+ export {};
@@ -1,46 +1,28 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ exports.__esModule = true;
6
3
  exports.createLoadRemoteModule = void 0;
7
-
8
- var _memoize = _interopRequireDefault(require("./memoize"));
9
-
10
- var _xmlHttpRequestFetcher = _interopRequireDefault(require("./xmlHttpRequestFetcher"));
11
-
12
- var _nodeFetcher = _interopRequireDefault(require("./nodeFetcher"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
4
+ var memoize_1 = require("./memoize");
5
+ var index_1 = require("./xmlHttpRequestFetcher/index");
6
+ var nodeFetcher_1 = require("./nodeFetcher");
16
7
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
17
8
  /* istanbul ignore next - difficult to test */
18
-
19
- var defaultFetcher = isBrowser ? _xmlHttpRequestFetcher.default : _nodeFetcher.default;
20
-
21
- var defaultRequires = function defaultRequires(name) {
22
- throw new Error("Could not require '".concat(name, "'. The 'requires' function was not provided."));
9
+ var defaultFetcher = isBrowser ? index_1["default"] : nodeFetcher_1["default"];
10
+ var defaultRequires = function (name) {
11
+ throw new Error("Could not require '" + name + "'. The 'requires' function was not provided.");
23
12
  };
24
-
25
- var createLoadRemoteModule = function createLoadRemoteModule() {
26
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
27
- _ref$requires = _ref.requires,
28
- requires = _ref$requires === void 0 ? defaultRequires : _ref$requires,
29
- _ref$fetcher = _ref.fetcher,
30
- fetcher = _ref$fetcher === void 0 ? defaultFetcher : _ref$fetcher;
31
-
32
- return (0, _memoize.default)(function (url) {
33
- return fetcher(url).then(function (data) {
34
- var exports = {};
35
- var module = {
36
- exports: exports
37
- };
38
- var func = new Function("require", "module", "exports", data);
39
- func(requires, module, exports);
40
- return module.exports;
13
+ var createLoadRemoteModule = function (_a) {
14
+ var _b = _a === void 0 ? {} : _a, requires = _b.requires, fetcher = _b.fetcher;
15
+ var _requires = requires || defaultRequires;
16
+ var _fetcher = fetcher || defaultFetcher;
17
+ return memoize_1["default"](function (url) {
18
+ return _fetcher(url).then(function (data) {
19
+ var exports = {};
20
+ var module = { exports: exports };
21
+ var func = new Function("require", "module", "exports", data);
22
+ func(_requires, module, exports);
23
+ return module.exports;
24
+ });
41
25
  });
42
- });
43
26
  };
44
-
45
27
  exports.createLoadRemoteModule = createLoadRemoteModule;
46
28
  //# sourceMappingURL=loadRemoteModule.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/loadRemoteModule.js"],"names":["isBrowser","window","document","defaultFetcher","xmlHttpRequestFetcher","nodeFetcher","defaultRequires","name","Error","createLoadRemoteModule","requires","fetcher","url","then","data","exports","module","func","Function"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA,IAAMA,SAAS,GACb,OAAOC,MAAP,KAAkB,WAAlB,IAAiC,OAAOA,MAAM,CAACC,QAAd,KAA2B,WAD9D;AAGA;;AACA,IAAMC,cAAc,GAAGH,SAAS,GAAGI,8BAAH,GAA2BC,oBAA3D;;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,IAAI,EAAI;AAC9B,QAAM,IAAIC,KAAJ,8BACkBD,IADlB,kDAAN;AAGD,CAJD;;AAMO,IAAME,sBAAsB,GAAG,SAAzBA,sBAAyB;AAAA,iFAGlC,EAHkC;AAAA,2BACpCC,QADoC;AAAA,MACpCA,QADoC,8BACzBJ,eADyB;AAAA,0BAEpCK,OAFoC;AAAA,MAEpCA,OAFoC,6BAE1BR,cAF0B;;AAAA,SAIpC,sBAAQ,UAAAS,GAAG;AAAA,WACTD,OAAO,CAACC,GAAD,CAAP,CAAaC,IAAb,CAAkB,UAAAC,IAAI,EAAI;AACxB,UAAMC,OAAO,GAAG,EAAhB;AACA,UAAMC,MAAM,GAAG;AAAED,QAAAA,OAAO,EAAPA;AAAF,OAAf;AACA,UAAME,IAAI,GAAG,IAAIC,QAAJ,CAAa,SAAb,EAAwB,QAAxB,EAAkC,SAAlC,EAA6CJ,IAA7C,CAAb;AACAG,MAAAA,IAAI,CAACP,QAAD,EAAWM,MAAX,EAAmBD,OAAnB,CAAJ;AACA,aAAOC,MAAM,CAACD,OAAd;AACD,KAND,CADS;AAAA,GAAX,CAJoC;AAAA,CAA/B","sourcesContent":["import memoize from \"./memoize\";\nimport xmlHttpRequestFetcher from \"./xmlHttpRequestFetcher\";\nimport nodeFetcher from \"./nodeFetcher\";\n\nconst isBrowser =\n typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\n/* istanbul ignore next - difficult to test */\nconst defaultFetcher = isBrowser ? xmlHttpRequestFetcher : nodeFetcher;\n\nconst defaultRequires = name => {\n throw new Error(\n `Could not require '${name}'. The 'requires' function was not provided.`\n );\n};\n\nexport const createLoadRemoteModule = ({\n requires = defaultRequires,\n fetcher = defaultFetcher\n} = {}) =>\n memoize(url =>\n fetcher(url).then(data => {\n const exports = {};\n const module = { exports };\n const func = new Function(\"require\", \"module\", \"exports\", data);\n func(requires, module, exports);\n return module.exports;\n })\n );\n"],"file":"loadRemoteModule.js"}
1
+ {"version":3,"file":"loadRemoteModule.js","sourceRoot":"","sources":["../../src/lib/loadRemoteModule.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAChC,uDAAkE;AAClE,6CAAwC;AAExC,IAAM,SAAS,GACb,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,CAAC;AAE1E,8CAA8C;AAC9C,IAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,kBAAqB,CAAC,CAAC,CAAC,wBAAW,CAAC;AAEvE,IAAM,eAAe,GAAG,UAAA,IAAI;IAC1B,MAAM,IAAI,KAAK,CACb,wBAAsB,IAAI,iDAA8C,CACzE,CAAC;AACJ,CAAC,CAAC;AAeK,IAAM,sBAAsB,GAA2B,UAAC,EAGzD;QAHyD,qBAG3D,EAAE,KAAA,EAFJ,QAAQ,cAAA,EACR,OAAO,aAAA;IAEP,IAAM,SAAS,GAAG,QAAQ,IAAI,eAAe,CAAC;IAC9C,IAAM,QAAQ,GAAG,OAAO,IAAI,cAAc,CAAC;IAE3C,OAAO,oBAAO,CAAC,UAAA,GAAG;QAChB,OAAA,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAA,IAAI;YACrB,IAAM,OAAO,GAAG,EAAE,CAAC;YACnB,IAAM,MAAM,GAAG,EAAE,OAAO,SAAA,EAAE,CAAC;YAC3B,IAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;YAChE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACjC,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC,CAAC;IANF,CAME,CACH,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,sBAAsB,0BAgBjC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Memoizes a 1-arity function
3
+ *
4
+ * @param {Function} func Function to memoize
5
+ * @returns {Function} Memoized version of func.
6
+ */
7
+ declare const memoize: (func: any) => (key: any) => any;
8
+ export default memoize;
@@ -1,27 +1,19 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
2
+ exports.__esModule = true;
8
3
  /**
9
4
  * Memoizes a 1-arity function
10
5
  *
11
6
  * @param {Function} func Function to memoize
12
7
  * @returns {Function} Memoized version of func.
13
8
  */
14
- var memoize = function memoize(func) {
15
- var cache = {};
16
- return function (x) {
17
- if (x in cache == false) {
18
- cache[x] = func(x);
19
- }
20
-
21
- return cache[x];
22
- };
9
+ var memoize = function (func) {
10
+ var cache = {};
11
+ return function (key) {
12
+ if (key in cache == false) {
13
+ cache[key] = func(key);
14
+ }
15
+ return cache[key];
16
+ };
23
17
  };
24
-
25
- var _default = memoize;
26
- exports.default = _default;
18
+ exports["default"] = memoize;
27
19
  //# sourceMappingURL=memoize.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/memoize.js"],"names":["memoize","func","cache","x"],"mappings":";;;;;;;AAAA;;;;;;AAMA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAAAC,IAAI,EAAI;AACtB,MAAIC,KAAK,GAAG,EAAZ;AACA,SAAO,UAAAC,CAAC,EAAI;AACV,QAAIA,CAAC,IAAID,KAAL,IAAc,KAAlB,EAAyB;AACvBA,MAAAA,KAAK,CAACC,CAAD,CAAL,GAAWF,IAAI,CAACE,CAAD,CAAf;AACD;;AACD,WAAOD,KAAK,CAACC,CAAD,CAAZ;AACD,GALD;AAMD,CARD;;eAUeH,O","sourcesContent":["/**\n * Memoizes a 1-arity function\n *\n * @param {Function} func Function to memoize\n * @returns {Function} Memoized version of func.\n */\nconst memoize = func => {\n var cache = {};\n return x => {\n if (x in cache == false) {\n cache[x] = func(x);\n }\n return cache[x];\n };\n};\n\nexport default memoize;\n"],"file":"memoize.js"}
1
+ {"version":3,"file":"memoize.js","sourceRoot":"","sources":["../../src/lib/memoize.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,IAAM,OAAO,GAAG,UAAA,IAAI;IAClB,IAAM,KAAK,GAAG,EAAE,CAAC;IACjB,OAAO,UAAA,GAAG;QACR,IAAI,GAAG,IAAI,KAAK,IAAI,KAAK,EAAE;YACzB,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;SACxB;QACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,qBAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Fetcher } from "../models";
2
+ /**
3
+ * Get's a URL and returns a Promise
4
+ */
5
+ declare const nodeFetcher: Fetcher;
6
+ export default nodeFetcher;
@@ -1,63 +1,55 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
2
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
3
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
5
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6
+ r[k] = a[j];
7
+ return r;
8
+ };
9
+ exports.__esModule = true;
8
10
  var http = require("http");
9
-
10
11
  var https = require("https");
12
+ var status_1 = require("./status");
11
13
  /**
12
14
  * Get's a url. Compatible with http and https.
13
- * @param {string} url
14
- * @param {...any} args
15
15
  */
16
-
17
-
18
- var get = function get(url) {
19
- if (typeof url !== "string") {
20
- return {
21
- on: function on(eventName, callback) {
22
- callback(new Error("URL must be a string."));
23
- }
24
- };
25
- }
26
-
27
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
28
- args[_key - 1] = arguments[_key];
29
- }
30
-
31
- return url.indexOf("https://") === 0 ? https.get.apply(https, [url].concat(args)) : http.get.apply(http, [url].concat(args));
16
+ var get = function (url) {
17
+ var args = [];
18
+ for (var _i = 1; _i < arguments.length; _i++) {
19
+ args[_i - 1] = arguments[_i];
20
+ }
21
+ if (typeof url !== "string") {
22
+ return {
23
+ on: function (eventName, callback) {
24
+ callback(new Error("URL must be a string."));
25
+ }
26
+ };
27
+ }
28
+ return url.indexOf("https://") === 0
29
+ ? https.get.apply(https, __spreadArrays([url], args)) : http.get.apply(http, __spreadArrays([url], args));
32
30
  };
33
31
  /**
34
32
  * Get's a URL and returns a Promise
35
- * @param {string} url
36
- * @returns {Promise<string>}
37
33
  */
38
-
39
-
40
- var nodeFetcher = function nodeFetcher(url) {
41
- return new Promise(function (resolve, reject) {
42
- get(url, function (res) {
43
- var data = null; // called when a data chunk is received.
44
-
45
- res.on("data", function (chunk) {
46
- if (data === null) {
47
- data = chunk;
48
- return;
49
- }
50
-
51
- data += chunk;
52
- }); // called when the complete response is received.
53
-
54
- res.on("end", function () {
55
- return resolve(data);
56
- });
57
- }).on("error", reject);
58
- });
34
+ var nodeFetcher = function (url) {
35
+ return new Promise(function (resolve, reject) {
36
+ get(url, function (res) {
37
+ if (res.statusCode !== status_1.OK) {
38
+ return reject(new Error("HTTP Error Response: " + res.statusCode + " " + res.statusMessage + " (" + url + ")"));
39
+ }
40
+ var data = null;
41
+ // called when a data chunk is received.
42
+ res.on("data", function (chunk) {
43
+ if (data === null) {
44
+ data = chunk;
45
+ return;
46
+ }
47
+ data += chunk;
48
+ });
49
+ // called when the complete response is received.
50
+ res.on("end", function () { return resolve(data); });
51
+ }).on("error", reject);
52
+ });
59
53
  };
60
-
61
- var _default = nodeFetcher;
62
- exports.default = _default;
54
+ exports["default"] = nodeFetcher;
63
55
  //# sourceMappingURL=nodeFetcher.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/nodeFetcher.js"],"names":["http","require","https","get","url","on","eventName","callback","Error","args","indexOf","nodeFetcher","Promise","resolve","reject","res","data","chunk"],"mappings":";;;;;;;AAAA,IAAMA,IAAI,GAAGC,OAAO,CAAC,MAAD,CAApB;;AACA,IAAMC,KAAK,GAAGD,OAAO,CAAC,OAAD,CAArB;AAEA;;;;;;;AAKA,IAAME,GAAG,GAAG,SAANA,GAAM,CAACC,GAAD,EAAkB;AAC5B,MAAI,OAAOA,GAAP,KAAe,QAAnB,EAA6B;AAC3B,WAAO;AACLC,MAAAA,EADK,cACFC,SADE,EACSC,QADT,EACmB;AACtBA,QAAAA,QAAQ,CAAC,IAAIC,KAAJ,CAAU,uBAAV,CAAD,CAAR;AACD;AAHI,KAAP;AAKD;;AAP2B,oCAATC,IAAS;AAATA,IAAAA,IAAS;AAAA;;AAQ5B,SAAOL,GAAG,CAACM,OAAJ,CAAY,UAAZ,MAA4B,CAA5B,GACHR,KAAK,CAACC,GAAN,OAAAD,KAAK,GAAKE,GAAL,SAAaK,IAAb,EADF,GAEHT,IAAI,CAACG,GAAL,OAAAH,IAAI,GAAKI,GAAL,SAAaK,IAAb,EAFR;AAGD,CAXD;AAaA;;;;;;;AAKA,IAAME,WAAW,GAAG,SAAdA,WAAc,CAAAP,GAAG;AAAA,SACrB,IAAIQ,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV,EAAqB;AAC/BX,IAAAA,GAAG,CAACC,GAAD,EAAM,UAAAW,GAAG,EAAI;AACd,UAAIC,IAAI,GAAG,IAAX,CADc,CAGd;;AACAD,MAAAA,GAAG,CAACV,EAAJ,CAAO,MAAP,EAAe,UAAAY,KAAK,EAAI;AACtB,YAAID,IAAI,KAAK,IAAb,EAAmB;AACjBA,UAAAA,IAAI,GAAGC,KAAP;AACA;AACD;;AACDD,QAAAA,IAAI,IAAIC,KAAR;AACD,OAND,EAJc,CAYd;;AACAF,MAAAA,GAAG,CAACV,EAAJ,CAAO,KAAP,EAAc;AAAA,eAAMQ,OAAO,CAACG,IAAD,CAAb;AAAA,OAAd;AACD,KAdE,CAAH,CAcGX,EAdH,CAcM,OAdN,EAceS,MAdf;AAeD,GAhBD,CADqB;AAAA,CAAvB;;eAmBeH,W","sourcesContent":["const http = require(\"http\");\nconst https = require(\"https\");\n\n/**\n * Get's a url. Compatible with http and https.\n * @param {string} url\n * @param {...any} args\n */\nconst get = (url, ...args) => {\n if (typeof url !== \"string\") {\n return {\n on(eventName, callback) {\n callback(new Error(\"URL must be a string.\"));\n }\n };\n }\n return url.indexOf(\"https://\") === 0\n ? https.get(url, ...args)\n : http.get(url, ...args);\n};\n\n/**\n * Get's a URL and returns a Promise\n * @param {string} url\n * @returns {Promise<string>}\n */\nconst nodeFetcher = url =>\n new Promise((resolve, reject) => {\n get(url, res => {\n let data = null;\n\n // called when a data chunk is received.\n res.on(\"data\", chunk => {\n if (data === null) {\n data = chunk;\n return;\n }\n data += chunk;\n });\n\n // called when the complete response is received.\n res.on(\"end\", () => resolve(data));\n }).on(\"error\", reject);\n });\n\nexport default nodeFetcher;\n"],"file":"nodeFetcher.js"}
1
+ {"version":3,"file":"nodeFetcher.js","sourceRoot":"","sources":["../../src/lib/nodeFetcher.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2BAA6B;AAC7B,6BAA+B;AAE/B,mCAA6B;AAM7B;;GAEG;AACH,IAAM,GAAG,GAAY,UAAC,GAAG;IAAE,cAAO;SAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;QAAP,6BAAO;;IAChC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO;YACL,EAAE,YAAC,SAAS,EAAE,QAAQ;gBACpB,QAAQ,CAAC,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;YAC/C,CAAC;SACoB,CAAC;KACzB;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;QAClC,CAAC,CAAC,KAAK,CAAC,GAAG,OAAT,KAAK,kBAAK,GAAG,GAAK,IAAI,GACxB,CAAC,CAAC,IAAI,CAAC,GAAG,OAAR,IAAI,kBAAK,GAAG,GAAK,IAAI,EAAC,CAAC;AAC7B,CAAC,CAAC;AAEF;;GAEG;AACH,IAAM,WAAW,GAAY,UAAA,GAAG;IAC9B,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAC1B,GAAG,CAAC,GAAG,EAAE,UAAA,GAAG;YACV,IAAI,GAAG,CAAC,UAAU,KAAK,WAAE,EAAE;gBACzB,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,0BAAwB,GAAG,CAAC,UAAU,SAAI,GAAG,CAAC,aAAa,UAAK,GAAG,MAAG,CAAC,CAAC,CAAA;aACjG;YAED,IAAI,IAAI,GAAG,IAAI,CAAC;YAEhB,wCAAwC;YACxC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,UAAA,KAAK;gBAClB,IAAI,IAAI,KAAK,IAAI,EAAE;oBACjB,IAAI,GAAG,KAAK,CAAC;oBACb,OAAO;iBACR;gBACD,IAAI,IAAI,KAAK,CAAC;YAChB,CAAC,CAAC,CAAC;YAEH,iDAAiD;YACjD,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,cAAM,OAAA,OAAO,CAAC,IAAI,CAAC,EAAb,CAAa,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACzB,CAAC,CAAC;AApBF,CAoBE,CAAC;AAEL,qBAAe,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const OK = 200;
2
+ export declare const InternalServerError = 500;
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ exports.__esModule = true;
6
3
  exports.InternalServerError = exports.OK = void 0;
7
4
  // export const Continue = 100;
8
5
  // export const Switchingprotocols = 101;
9
- var OK = 200; // export const Created = 201;
6
+ exports.OK = 200;
7
+ // export const Created = 201;
10
8
  // export const Accepted = 202;
11
9
  // export const NonAuthoritativeInformation = 203;
12
10
  // export const NoContent = 204;
@@ -37,13 +35,10 @@ var OK = 200; // export const Created = 201;
37
35
  // export const UnsupportedMediaType = 415;
38
36
  // export const RequestedRangeNotSuitable = 416;
39
37
  // export const ExpectationFailed = 417;
40
-
41
- exports.OK = OK;
42
- var InternalServerError = 500; // export const NotImplemented = 501;
38
+ exports.InternalServerError = 500;
39
+ // export const NotImplemented = 501;
43
40
  // export const BadGateway = 502;
44
41
  // export const ServiceUnavailable = 503;
45
42
  // export const GatewayTimeout = 504;
46
43
  // export const HTTPVersionNotSupported = 505;
47
-
48
- exports.InternalServerError = InternalServerError;
49
44
  //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/lib/status.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,yCAAyC;AAC5B,QAAA,EAAE,GAAG,GAAG,CAAC;AACtB,8BAA8B;AAC9B,+BAA+B;AAC/B,kDAAkD;AAClD,gCAAgC;AAChC,mCAAmC;AACnC,qCAAqC;AACrC,sCAAsC;AACtC,uCAAuC;AACvC,4BAA4B;AAC5B,+BAA+B;AAC/B,kCAAkC;AAClC,+BAA+B;AAC/B,wCAAwC;AACxC,iCAAiC;AACjC,mCAAmC;AACnC,sCAAsC;AACtC,gCAAgC;AAChC,+BAA+B;AAC/B,uCAAuC;AACvC,oCAAoC;AACpC,kDAAkD;AAClD,qCAAqC;AACrC,+BAA+B;AAC/B,2BAA2B;AAC3B,qCAAqC;AACrC,yCAAyC;AACzC,4CAA4C;AAC5C,wCAAwC;AACxC,2CAA2C;AAC3C,gDAAgD;AAChD,wCAAwC;AAC3B,QAAA,mBAAmB,GAAG,GAAG,CAAC;AACvC,qCAAqC;AACrC,iCAAiC;AACjC,yCAAyC;AACzC,qCAAqC;AACrC,8CAA8C"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from "../../models";
2
+ declare const xmlHttpRequestFetcher: Fetcher;
3
+ export default xmlHttpRequestFetcher;
@@ -1,28 +1,20 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _readyState = require("./readyState");
9
-
10
- var _status = require("./status");
11
-
12
- var xmlHttpRequestFetcher = function xmlHttpRequestFetcher(url) {
13
- return new Promise(function (resolve, reject) {
14
- var xhr = new XMLHttpRequest();
15
-
16
- xhr.onreadystatechange = function () {
17
- if (xhr.readyState !== _readyState.DONE) return;
18
- xhr.status === _status.OK ? resolve(xhr.responseText) : reject("".concat(xhr.status, " ").concat(xhr.statusText));
19
- };
20
-
21
- xhr.open("GET", url, true);
22
- xhr.send();
23
- });
2
+ exports.__esModule = true;
3
+ var status_1 = require("../status");
4
+ var readyState_1 = require("./readyState");
5
+ var xmlHttpRequestFetcher = function (url) {
6
+ return new Promise(function (resolve, reject) {
7
+ var xhr = new XMLHttpRequest();
8
+ xhr.onreadystatechange = function () {
9
+ if (xhr.readyState !== readyState_1.DONE)
10
+ return;
11
+ xhr.status === status_1.OK
12
+ ? resolve(xhr.responseText)
13
+ : reject(new Error("HTTP Error Response: " + xhr.status + " " + xhr.statusText + " (" + url + ")"));
14
+ };
15
+ xhr.open("GET", url, true);
16
+ xhr.send();
17
+ });
24
18
  };
25
-
26
- var _default = xmlHttpRequestFetcher;
27
- exports.default = _default;
19
+ exports["default"] = xmlHttpRequestFetcher;
28
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/xmlHttpRequestFetcher/index.js"],"names":["xmlHttpRequestFetcher","url","Promise","resolve","reject","xhr","XMLHttpRequest","onreadystatechange","readyState","DONE","status","OK","responseText","statusText","open","send"],"mappings":";;;;;;;AAAA;;AACA;;AAEA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAwB,CAAAC,GAAG;AAAA,SAC/B,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV,EAAqB;AAC/B,QAAMC,GAAG,GAAG,IAAIC,cAAJ,EAAZ;;AACAD,IAAAA,GAAG,CAACE,kBAAJ,GAAyB,YAAM;AAC7B,UAAIF,GAAG,CAACG,UAAJ,KAAmBC,gBAAvB,EAA6B;AAC7BJ,MAAAA,GAAG,CAACK,MAAJ,KAAeC,UAAf,GACIR,OAAO,CAACE,GAAG,CAACO,YAAL,CADX,GAEIR,MAAM,WAAIC,GAAG,CAACK,MAAR,cAAkBL,GAAG,CAACQ,UAAtB,EAFV;AAGD,KALD;;AAMAR,IAAAA,GAAG,CAACS,IAAJ,CAAS,KAAT,EAAgBb,GAAhB,EAAqB,IAArB;AACAI,IAAAA,GAAG,CAACU,IAAJ;AACD,GAVD,CAD+B;AAAA,CAAjC;;eAaef,qB","sourcesContent":["import { DONE } from \"./readyState\";\nimport { OK } from \"./status\";\n\nconst xmlHttpRequestFetcher = url =>\n new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.onreadystatechange = () => {\n if (xhr.readyState !== DONE) return;\n xhr.status === OK\n ? resolve(xhr.responseText)\n : reject(`${xhr.status} ${xhr.statusText}`);\n };\n xhr.open(\"GET\", url, true);\n xhr.send();\n });\n\nexport default xmlHttpRequestFetcher;\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/xmlHttpRequestFetcher/index.ts"],"names":[],"mappings":";;AACA,oCAA+B;AAC/B,2CAAoC;AAEpC,IAAM,qBAAqB,GAAY,UAAA,GAAG;IACxC,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAC1B,IAAM,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;QACjC,GAAG,CAAC,kBAAkB,GAAG;YACvB,IAAI,GAAG,CAAC,UAAU,KAAK,iBAAI;gBAAE,OAAO;YACpC,GAAG,CAAC,MAAM,KAAK,WAAE;gBACf,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;gBAC3B,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,0BAAwB,GAAG,CAAC,MAAM,SAAI,GAAG,CAAC,UAAU,UAAK,GAAG,MAAG,CAAC,CAAC,CAAA;QACxF,CAAC,CAAC;QACF,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAC3B,GAAG,CAAC,IAAI,EAAE,CAAC;IACb,CAAC,CAAC;AAVF,CAUE,CAAC;AAEL,qBAAe,qBAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const UNSENT = 0;
2
+ export declare const OPENED = 1;
3
+ export declare const DONE = 4;
@@ -1,18 +1,9 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ exports.__esModule = true;
6
3
  exports.DONE = exports.OPENED = exports.UNSENT = void 0;
7
- var UNSENT = 0; // Client has been created. open() not called yet.
8
-
9
- exports.UNSENT = UNSENT;
10
- var OPENED = 1; // open() has been called.
4
+ exports.UNSENT = 0; // Client has been created. open() not called yet.
5
+ exports.OPENED = 1; // open() has been called.
11
6
  // export const HEADERS_RECEIVED = 2; // send() has been called, and headers and status are available.
12
7
  // export const LOADING = 3; // Downloading; responseText holds partial data.
13
-
14
- exports.OPENED = OPENED;
15
- var DONE = 4; // The operation is complete.
16
-
17
- exports.DONE = DONE;
8
+ exports.DONE = 4; // The operation is complete.
18
9
  //# sourceMappingURL=readyState.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/xmlHttpRequestFetcher/readyState.js"],"names":["UNSENT","OPENED","DONE"],"mappings":";;;;;;AAAO,IAAMA,MAAM,GAAG,CAAf,C,CAAkB;;;AAClB,IAAMC,MAAM,GAAG,CAAf,C,CAAkB;AACzB;AACA;;;AACO,IAAMC,IAAI,GAAG,CAAb,C,CAAgB","sourcesContent":["export const UNSENT = 0; //\tClient has been created. open() not called yet.\nexport const OPENED = 1; //\topen() has been called.\n// export const HEADERS_RECEIVED = 2; //\tsend() has been called, and headers and status are available.\n// export const LOADING = 3; //\tDownloading; responseText holds partial data.\nexport const DONE = 4; //\tThe operation is complete.\n"],"file":"readyState.js"}
1
+ {"version":3,"file":"readyState.js","sourceRoot":"","sources":["../../../src/lib/xmlHttpRequestFetcher/readyState.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG,CAAC,CAAC,CAAC,kDAAkD;AAC9D,QAAA,MAAM,GAAG,CAAC,CAAC,CAAC,0BAA0B;AACnD,sGAAsG;AACtG,6EAA6E;AAChE,QAAA,IAAI,GAAG,CAAC,CAAC,CAAC,6BAA6B"}
@@ -0,0 +1,3 @@
1
+ export interface Fetcher {
2
+ (url: string): Promise<string>;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paciolan/remote-module-loader",
3
- "version": "2.5.3",
3
+ "version": "3.0.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "author": "Paciolan",
@@ -24,7 +24,9 @@
24
24
  ]
25
25
  },
26
26
  "scripts": {
27
- "build": "npm run clean && npx babel src --ignore **/*.test.js --out-dir dist --source-maps",
27
+ "prebuild": "npm run clean",
28
+ "build": "tsc --declaration",
29
+ "watch": "npm run build -- --watch",
28
30
  "clean": "rimraf dist",
29
31
  "cz": "git-cz",
30
32
  "test": "cross-env NODE_ENV=test jest",
@@ -34,23 +36,27 @@
34
36
  },
35
37
  "dependencies": {},
36
38
  "devDependencies": {
37
- "@babel/cli": "^7.5.5",
38
- "@babel/core": "^7.5.5",
39
- "@babel/preset-env": "^7.5.5",
40
- "@commitlint/cli": "^8.1.0",
41
- "@commitlint/config-conventional": "^8.1.0",
42
- "@types/jest": "^24.0.17",
43
- "babel-loader": "^8.0.6",
44
- "cross-env": "^5.2.0",
45
- "eslint": "^6.1.0",
46
- "eslint-config-prettier": "^6.0.0",
47
- "eslint-plugin-prettier": "^3.1.0",
48
- "git-cz": "^3.2.1",
49
- "husky": "^3.0.2",
50
- "jest": "^24.8.0",
51
- "prettier": "^1.18.2",
52
- "regenerator-runtime": "^0.13.3",
53
- "rimraf": "^2.6.3"
39
+ "@babel/cli": "^7.12.8",
40
+ "@babel/core": "^7.12.9",
41
+ "@babel/preset-env": "^7.12.7",
42
+ "@babel/preset-typescript": "^7.12.7",
43
+ "@commitlint/cli": "^11.0.0",
44
+ "@commitlint/config-conventional": "^11.0.0",
45
+ "@types/jest": "^26.0.16",
46
+ "@types/node": "^14.14.10",
47
+ "babel-loader": "^8.2.2",
48
+ "cross-env": "^7.0.3",
49
+ "eslint": "^7.14.0",
50
+ "eslint-config-prettier": "^6.15.0",
51
+ "eslint-plugin-prettier": "^3.2.0",
52
+ "git-cz": "^4.7.5",
53
+ "husky": "^4.3.0",
54
+ "jest": "^26.6.3",
55
+ "prettier": "^2.2.1",
56
+ "regenerator-runtime": "^0.13.7",
57
+ "rimraf": "^3.0.2",
58
+ "ts-jest": "^26.4.4",
59
+ "typescript": "^4.1.2"
54
60
  },
55
61
  "husky": {
56
62
  "hooks": {
package/tsconfig.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": [
4
+ "ES2015",
5
+ "DOM"
6
+ ],
7
+ "outDir": "dist",
8
+ "module": "commonjs",
9
+ "types": [
10
+ "node",
11
+ "jest"
12
+ ],
13
+ "sourceMap": true,
14
+ },
15
+ "include": [
16
+ "./src/**/*.ts"
17
+ ],
18
+ "exclude": [
19
+ "node_modules",
20
+ "./src/**/*.test.ts"
21
+ ]
22
+ }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/xmlHttpRequestFetcher/status.js"],"names":["OK","InternalServerError"],"mappings":";;;;;;AAAA;AACA;AACO,IAAMA,EAAE,GAAG,GAAX,C,CACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,IAAMC,mBAAmB,GAAG,GAA5B,C,CACP;AACA;AACA;AACA;AACA","sourcesContent":["// export const Continue = 100;\n// export const Switchingprotocols = 101;\nexport const OK = 200;\n// export const Created = 201;\n// export const Accepted = 202;\n// export const NonAuthoritativeInformation = 203;\n// export const NoContent = 204;\n// export const ResetContent = 205;\n// export const PartialContent = 206;\n// export const MultipleChoices = 300;\n// export const MovedPermanently = 301;\n// export const Found = 302;\n// export const SeeOther = 303;\n// export const NotModified = 304;\n// export const UseProxy = 305;\n// export const TemporaryRedirect = 307;\n// export const BadRequest = 400;\n// export const Unauthorized = 401;\n// export const PaymentRequired = 402;\n// export const Forbidden = 403;\n// export const NotFound = 404;\n// export const MethodNotAllowed = 405;\n// export const NotAcceptable = 406;\n// export const ProxyAuthenticationRequired = 407;\n// export const RequestTimeout = 408;\n// export const Conflict = 409;\n// export const Gone = 410;\n// export const LengthRequired = 411;\n// export const PreconditionFailed = 412;\n// export const RequestEntityTooLarge = 413;\n// export const RequestURITooLong = 414;\n// export const UnsupportedMediaType = 415;\n// export const RequestedRangeNotSuitable = 416;\n// export const ExpectationFailed = 417;\nexport const InternalServerError = 500;\n// export const NotImplemented = 501;\n// export const BadGateway = 502;\n// export const ServiceUnavailable = 503;\n// export const GatewayTimeout = 504;\n// export const HTTPVersionNotSupported = 505;\n"],"file":"status.js"}