node-dependency-injection 2.7.3 → 3.0.0-alpha.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.
package/CHANGELOG-3.md ADDED
@@ -0,0 +1,7 @@
1
+ # Change Log
2
+
3
+ # [3.0.0] - 2022-05-09
4
+ ### Changed
5
+ ### Added
6
+ - Autowire support for TypeScript
7
+ - Get container service from a class instance
package/UPGRADE-3.0.md ADDED
@@ -0,0 +1,6 @@
1
+ UPGRADE FROM 2.x to 3.x
2
+ =======================
3
+
4
+ ### Removed deprecations
5
+
6
+ - Nothing
@@ -0,0 +1,285 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _path = _interopRequireDefault(require("path"));
9
+
10
+ var _fs = _interopRequireDefault(require("fs"));
11
+
12
+ var _parser = require("@typescript-eslint/parser");
13
+
14
+ var _Definition = _interopRequireDefault(require("./Definition"));
15
+
16
+ var _Reference = _interopRequireDefault(require("./Reference"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
21
+
22
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
23
+
24
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
25
+
26
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
27
+
28
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
29
+
30
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
+
32
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
33
+
34
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
35
+
36
+ var Autowire = /*#__PURE__*/function () {
37
+ function Autowire(container) {
38
+ _classCallCheck(this, Autowire);
39
+
40
+ this._interfaceImplementation = new Map();
41
+ this._rootDirectory = container.defaultDir;
42
+ this._container = container;
43
+ }
44
+ /**
45
+ * @return {ContainerBuilder}
46
+ */
47
+
48
+
49
+ _createClass(Autowire, [{
50
+ key: "container",
51
+ get: function get() {
52
+ return this._container;
53
+ }
54
+ }, {
55
+ key: "_walkSync",
56
+ value: /*#__PURE__*/regeneratorRuntime.mark(function _walkSync(dir) {
57
+ var files, _iterator, _step, file;
58
+
59
+ return regeneratorRuntime.wrap(function _walkSync$(_context) {
60
+ while (1) {
61
+ switch (_context.prev = _context.next) {
62
+ case 0:
63
+ files = _fs["default"].readdirSync(dir, {
64
+ withFileTypes: true
65
+ });
66
+ _iterator = _createForOfIteratorHelper(files);
67
+ _context.prev = 2;
68
+
69
+ _iterator.s();
70
+
71
+ case 4:
72
+ if ((_step = _iterator.n()).done) {
73
+ _context.next = 14;
74
+ break;
75
+ }
76
+
77
+ file = _step.value;
78
+
79
+ if (!file.isDirectory()) {
80
+ _context.next = 10;
81
+ break;
82
+ }
83
+
84
+ return _context.delegateYield(this._walkSync(_path["default"].join(dir, file.name)), "t0", 8);
85
+
86
+ case 8:
87
+ _context.next = 12;
88
+ break;
89
+
90
+ case 10:
91
+ _context.next = 12;
92
+ return _path["default"].join(dir, file.name);
93
+
94
+ case 12:
95
+ _context.next = 4;
96
+ break;
97
+
98
+ case 14:
99
+ _context.next = 19;
100
+ break;
101
+
102
+ case 16:
103
+ _context.prev = 16;
104
+ _context.t1 = _context["catch"](2);
105
+
106
+ _iterator.e(_context.t1);
107
+
108
+ case 19:
109
+ _context.prev = 19;
110
+
111
+ _iterator.f();
112
+
113
+ return _context.finish(19);
114
+
115
+ case 22:
116
+ case "end":
117
+ return _context.stop();
118
+ }
119
+ }
120
+ }, _walkSync, this, [[2, 16, 19, 22]]);
121
+ })
122
+ }, {
123
+ key: "_getServiceIdFromPath",
124
+ value: function _getServiceIdFromPath(path, type) {
125
+ var extension = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.ts';
126
+ return path.replace(/\//g, '_').replace(extension, '').concat("_".concat(type));
127
+ }
128
+ /**
129
+ * @returns {void}
130
+ */
131
+
132
+ }, {
133
+ key: "process",
134
+ value: function () {
135
+ var _process = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
136
+ var _iterator2, _step2, filePath, parsedFile, _this$_getClassDeclar, classDeclaration, body, Class, definition, serviceId;
137
+
138
+ return regeneratorRuntime.wrap(function _callee$(_context2) {
139
+ while (1) {
140
+ switch (_context2.prev = _context2.next) {
141
+ case 0:
142
+ _iterator2 = _createForOfIteratorHelper(this._walkSync(this._rootDirectory));
143
+
144
+ try {
145
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
146
+ filePath = _step2.value;
147
+ parsedFile = _path["default"].parse(filePath);
148
+
149
+ if (parsedFile.ext === '.ts') {
150
+ _this$_getClassDeclar = this._getClassDeclaration(filePath), classDeclaration = _this$_getClassDeclar.classDeclaration, body = _this$_getClassDeclar.body;
151
+ Class = require(filePath)["default"];
152
+
153
+ if (Class && classDeclaration) {
154
+ definition = this._getDefinition(classDeclaration, body, parsedFile, Class);
155
+ serviceId = this._getServiceIdFromPath(filePath, Class.name);
156
+ this.container.setDefinition(serviceId, definition);
157
+
158
+ this._interfaceImplementations(classDeclaration, body, parsedFile, serviceId);
159
+ }
160
+ }
161
+ }
162
+ } catch (err) {
163
+ _iterator2.e(err);
164
+ } finally {
165
+ _iterator2.f();
166
+ }
167
+
168
+ case 2:
169
+ case "end":
170
+ return _context2.stop();
171
+ }
172
+ }
173
+ }, _callee, this);
174
+ }));
175
+
176
+ function process() {
177
+ return _process.apply(this, arguments);
178
+ }
179
+
180
+ return process;
181
+ }()
182
+ }, {
183
+ key: "_getClassDeclaration",
184
+ value: function _getClassDeclaration(filePath) {
185
+ var sourceCode = _fs["default"].readFileSync(filePath, 'utf8');
186
+
187
+ var body = (0, _parser.parse)(sourceCode).body;
188
+ var classDeclaration = body.find(function (declaration) {
189
+ return declaration.type === 'ExportDefaultDeclaration';
190
+ });
191
+ return {
192
+ classDeclaration: classDeclaration,
193
+ body: body
194
+ };
195
+ }
196
+ }, {
197
+ key: "_getDefinition",
198
+ value: function _getDefinition(classDeclaration, body, parsedFile, ServiceClass) {
199
+ var definition = new _Definition["default"](ServiceClass);
200
+ var constructorDeclaration = classDeclaration.declaration.body.body.find(function (method) {
201
+ return method.key.name === 'constructor';
202
+ });
203
+
204
+ if (classDeclaration.declaration["abstract"]) {
205
+ definition["abstract"] = true;
206
+ }
207
+
208
+ if (classDeclaration.declaration.superClass) {
209
+ var typeParent = classDeclaration.declaration.superClass.name;
210
+
211
+ var parentId = this._getIdentifierFromImports(typeParent, body, parsedFile);
212
+
213
+ definition.parent = parentId;
214
+ }
215
+
216
+ if (constructorDeclaration) {
217
+ var _iterator3 = _createForOfIteratorHelper(constructorDeclaration.value.params),
218
+ _step3;
219
+
220
+ try {
221
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
222
+ var parameterDeclaration = _step3.value;
223
+ var typeNameForArgument = parameterDeclaration.parameter.typeAnnotation.typeAnnotation.typeName.name;
224
+
225
+ var argumentId = this._getIdentifierFromImports(typeNameForArgument, body, parsedFile);
226
+
227
+ definition.addArgument(new _Reference["default"](argumentId), definition["abstract"]);
228
+ }
229
+ } catch (err) {
230
+ _iterator3.e(err);
231
+ } finally {
232
+ _iterator3.f();
233
+ }
234
+ }
235
+
236
+ return definition;
237
+ }
238
+ }, {
239
+ key: "_interfaceImplementations",
240
+ value: function _interfaceImplementations(classDeclaration, body, parsedFile, serviceId) {
241
+ if (classDeclaration.declaration["implements"]) {
242
+ var _iterator4 = _createForOfIteratorHelper(classDeclaration.declaration["implements"]),
243
+ _step4;
244
+
245
+ try {
246
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
247
+ var implement = _step4.value;
248
+ var interfaceType = implement.expression.name;
249
+
250
+ var aliasId = this._getIdentifierFromImports(interfaceType, body, parsedFile);
251
+
252
+ if (this.container.hasAlias(aliasId) === false) {
253
+ this.container.setAlias(aliasId, serviceId);
254
+ }
255
+ }
256
+ } catch (err) {
257
+ _iterator4.e(err);
258
+ } finally {
259
+ _iterator4.f();
260
+ }
261
+ }
262
+ }
263
+ }, {
264
+ key: "_getIdentifierFromImports",
265
+ value: function _getIdentifierFromImports(type, body, parsedFile) {
266
+ var relativeImportForImplement = body.find(function (declaration) {
267
+ if (declaration.specifiers) {
268
+ return declaration.specifiers.find(function (specifier) {
269
+ return specifier.local.name === type;
270
+ });
271
+ }
272
+
273
+ return null;
274
+ }).source.value;
275
+
276
+ var absolutePathImportForImplement = _path["default"].join(parsedFile.dir, relativeImportForImplement);
277
+
278
+ return this._getServiceIdFromPath(absolutePathImportForImplement, type);
279
+ }
280
+ }]);
281
+
282
+ return Autowire;
283
+ }();
284
+
285
+ exports["default"] = Autowire;
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
+ var _path = _interopRequireDefault(require("path"));
9
+
10
+ var _fs = _interopRequireDefault(require("fs"));
11
+
8
12
  var _Definition = _interopRequireDefault(require("./Definition"));
9
13
 
10
14
  var _PassConfig = _interopRequireDefault(require("./PassConfig"));
@@ -60,6 +64,8 @@ var ContainerBuilder = /*#__PURE__*/function () {
60
64
 
61
65
  _classCallCheck(this, ContainerBuilder);
62
66
 
67
+ this.ensureIsAbsolute(defaultDir);
68
+ this.ensureDirectoryExists(defaultDir);
63
69
  this._definitions = new Map();
64
70
  this._parameters = new Map();
65
71
  this._alias = new Map();
@@ -72,15 +78,34 @@ var ContainerBuilder = /*#__PURE__*/function () {
72
78
  this._containerReferenceAsService = containerReferenceAsService;
73
79
  this._defaultDir = defaultDir;
74
80
  }
75
- /**
76
- * @returns {String}
77
- */
78
-
79
81
 
80
82
  _createClass(ContainerBuilder, [{
83
+ key: "ensureDirectoryExists",
84
+ value: function ensureDirectoryExists(directory) {
85
+ if (directory && _fs["default"].existsSync(directory) === false) {
86
+ throw new Error('Root directory not found');
87
+ }
88
+ }
89
+ }, {
90
+ key: "ensureIsAbsolute",
91
+ value: function ensureIsAbsolute(directory) {
92
+ if (directory && _path["default"].isAbsolute(directory) === false) {
93
+ throw new Error('Root directory must be absolute');
94
+ }
95
+ }
96
+ /**
97
+ * @returns {String}
98
+ */
99
+
100
+ }, {
81
101
  key: "defaultDir",
82
102
  get: function get() {
83
103
  return this._defaultDir;
104
+ },
105
+ set: function set(value) {
106
+ this.ensureIsAbsolute(value);
107
+ this.ensureDirectoryExists(value);
108
+ this._defaultDir = value;
84
109
  }
85
110
  /**
86
111
  * @returns {boolean}
@@ -195,7 +220,7 @@ var ContainerBuilder = /*#__PURE__*/function () {
195
220
  throw new _FrozenContainerException["default"]();
196
221
  }
197
222
  /**
198
- * @param {string} id
223
+ * @param {string|} id
199
224
  */
200
225
 
201
226
  }, {
@@ -232,6 +257,16 @@ var ContainerBuilder = /*#__PURE__*/function () {
232
257
  value: function setAlias(alias, id) {
233
258
  this._alias.set(alias, id);
234
259
  }
260
+ /**
261
+ * @param {string} alias
262
+ * @returns {boolean}
263
+ */
264
+
265
+ }, {
266
+ key: "hasAlias",
267
+ value: function hasAlias(alias) {
268
+ return this._alias.has(alias);
269
+ }
235
270
  /**
236
271
  * @param {string} id
237
272
  * @param {Definition} definition
@@ -295,8 +295,9 @@ var Definition = /*#__PURE__*/function () {
295
295
  }, {
296
296
  key: "addArgument",
297
297
  value: function addArgument(argument) {
298
- this._args.push(argument);
299
-
298
+ var append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
299
+ var map = append ? this._appendArgs : this._args;
300
+ map.push(argument);
300
301
  return this;
301
302
  }
302
303
  /**
@@ -42,7 +42,8 @@ var ServiceNotFoundException = /*#__PURE__*/function (_Error) {
42
42
 
43
43
  _classCallCheck(this, ServiceNotFoundException);
44
44
 
45
- _this = _super.call(this, "The service ".concat(id, " is not registered"));
45
+ var serviceName = typeof id === 'function' ? id.name : id;
46
+ _this = _super.call(this, "The service ".concat(serviceName, " is not registered"));
46
47
  _this.name = 'ServiceNotFoundException';
47
48
  _this.stack = new Error().stack;
48
49
  return _this;
@@ -71,7 +71,7 @@ var InstanceManager = /*#__PURE__*/function () {
71
71
  this._alias = alias;
72
72
  }
73
73
  /**
74
- * @param {string} id
74
+ * @param {string|any} id
75
75
  * @param {boolean} bypassPublic
76
76
  * @returns {*}
77
77
  */
@@ -81,14 +81,31 @@ var InstanceManager = /*#__PURE__*/function () {
81
81
  key: "getInstance",
82
82
  value: function getInstance(id) {
83
83
  var bypassPublic = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
84
- id = this._alias.get(id) || id;
85
84
 
86
- if (id === 'service_container' && this._containerBuilder.containerReferenceAsService) {
87
- return this._containerBuilder;
85
+ if (typeof id === 'string') {
86
+ id = this._alias.get(id) || id;
87
+
88
+ if (id === 'service_container' && this._containerBuilder.containerReferenceAsService) {
89
+ return this._containerBuilder;
90
+ }
91
+
92
+ if (this._definitions.has(id)) {
93
+ return this._getInstanceFromId(id, bypassPublic);
94
+ }
88
95
  }
89
96
 
90
- if (this._definitions.has(id)) {
91
- return this._getInstanceFromId(id, bypassPublic);
97
+ if (typeof id === 'function') {
98
+ var definitionServiceId = null;
99
+
100
+ this._definitions.forEach(function (definition, serviceId) {
101
+ if (definition.Object === id) {
102
+ definitionServiceId = serviceId;
103
+ }
104
+ });
105
+
106
+ if (definitionServiceId) {
107
+ return this.getInstance(definitionServiceId);
108
+ }
92
109
  }
93
110
 
94
111
  this._containerBuilder.logger.warn("The service ".concat(id, " is not registered"));
@@ -17,6 +17,8 @@ var _Definition = _interopRequireDefault(require("./../Definition"));
17
17
 
18
18
  var _validateNpmPackageName = _interopRequireDefault(require("validate-npm-package-name"));
19
19
 
20
+ var _Autowire = _interopRequireDefault(require("../Autowire"));
21
+
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
24
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
@@ -94,7 +96,11 @@ var FileLoader = /*#__PURE__*/function () {
94
96
  var services = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
95
97
 
96
98
  for (var id in services) {
97
- this._parseDefinition(services, id);
99
+ if (id === '_defaults') {
100
+ this._parseDefaults(services._defaults);
101
+ } else {
102
+ this._parseDefinition(services, id);
103
+ }
98
104
  }
99
105
  }
100
106
  /**
@@ -225,6 +231,24 @@ var FileLoader = /*#__PURE__*/function () {
225
231
  });
226
232
  return parsedArguments;
227
233
  }
234
+ }, {
235
+ key: "_parseDefaults",
236
+ value: function _parseDefaults() {
237
+ var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
238
+
239
+ if (defaults.autowire) {
240
+ if (_path["default"].isAbsolute(defaults.rootDir) === false) {
241
+ var filePathParsed = _path["default"].parse(this.filePath);
242
+
243
+ this._container.defaultDir = _path["default"].join(filePathParsed.dir, defaults.rootDir);
244
+ } else {
245
+ this._container.defaultDir = defaults.rootDir;
246
+ }
247
+
248
+ var autowire = new _Autowire["default"](this._container);
249
+ autowire.process();
250
+ }
251
+ }
228
252
  /**
229
253
  * @param {Definition} definition
230
254
  * @param {Object} properties
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-dependency-injection",
3
- "version": "2.7.3",
3
+ "version": "3.0.0-alpha.0",
4
4
  "description": "The NodeDependencyInjection component allows you to standardize and centralize the way objects are constructed in your application.",
5
5
  "main": "dist/lib/index.js",
6
6
  "directories": {
@@ -11,7 +11,7 @@
11
11
  "ndi": "dist/bin/ndi.js"
12
12
  },
13
13
  "scripts": {
14
- "test": "cross-env NODE_ENV=test mocha",
14
+ "test": "cross-env NODE_ENV=test mocha -r ts-node/register",
15
15
  "test:coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha",
16
16
  "test:standard": "standard",
17
17
  "test:standard:fix": "standard --fix",
@@ -50,6 +50,7 @@
50
50
  },
51
51
  "homepage": "https://github.com/zazoomauro/node-dependency-injection#readme",
52
52
  "dependencies": {
53
+ "@typescript-eslint/parser": "^5.22.0",
53
54
  "chalk": "^4.1.0",
54
55
  "commander": "^8.1.0",
55
56
  "console.table": "^0.10.0",
@@ -59,17 +60,22 @@
59
60
  "devDependencies": {
60
61
  "@babel/cli": "^7.12.10",
61
62
  "@babel/core": "^7.12.10",
63
+ "@babel/plugin-transform-runtime": "^7.17.10",
62
64
  "@babel/preset-env": "^7.12.11",
63
65
  "@babel/register": "^7.12.10",
64
- "babel-plugin-istanbul": "^6.0.0",
65
- "chai": "^4.2.0",
66
+ "@types/chai": "^4.3.1",
67
+ "@types/mocha": "^9.1.1",
68
+ "babel-plugin-istanbul": "^6.1.1",
69
+ "chai": "^4.3.6",
66
70
  "codecov": "^4.0.0-0",
67
71
  "cross-env": "^7.0.3",
68
72
  "istanbul": "^0.4.5",
69
- "mocha": "^9.0.3",
73
+ "mocha": "^9.2.2",
70
74
  "nyc": "^15.1.0",
71
75
  "sinon": "^11.1.2",
72
- "standard": "^16.0.3"
76
+ "standard": "^16.0.3",
77
+ "ts-node": "^10.7.0",
78
+ "typescript": "^4.6.4"
73
79
  },
74
80
  "babel": {
75
81
  "presets": [
@@ -78,7 +84,8 @@
78
84
  "env": {
79
85
  "test": {
80
86
  "plugins": [
81
- "istanbul"
87
+ "istanbul",
88
+ "@babel/plugin-transform-runtime"
82
89
  ]
83
90
  }
84
91
  }
package/tsconfig.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["DOM", "ES7"]
4
+ }
5
+ }