@allgemein/base 1.6.1 → 1.6.5

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/browser.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { JsonUtils, TreeUtils, CryptUtils, ClassUtils, NotSupportedError, NotYetImplementedError, TodoException, NestedException, Logger, ILogLevel, ILoggerOptions, ILoggerApi, ConsoleLogger, AbstractLogger, MetaArgs, StringOrFunction, ISO8601, C_WARN, C_TRACE, C_INFO, C_ERROR, C_DEBUG, C_CONSOLE, __SOURCE__, C_DEFAULT, MetadataStorage, Semaphore, LockFactory } from './shared';
1
+ export { JsonUtils, TreeUtils, WalkValues, ArrayUtils, CryptUtils, ClassUtils, NotSupportedError, NotYetImplementedError, TodoException, NestedException, Logger, ILogLevel, ILoggerOptions, ILoggerApi, ConsoleLogger, AbstractLogger, MetaArgs, StringOrFunction, ISO8601, C_WARN, C_TRACE, C_INFO, C_ERROR, C_DEBUG, C_CONSOLE, __SOURCE__, C_DEFAULT, MetadataStorage, Semaphore, LockFactory, Serializer, IMergeChange } from './shared';
2
2
  export { PlatformUtils } from './utils/PlatformUtilsBrowser';
package/browser.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformUtils = exports.LockFactory = exports.Semaphore = exports.MetadataStorage = exports.C_DEFAULT = exports.__SOURCE__ = exports.C_CONSOLE = exports.C_DEBUG = exports.C_ERROR = exports.C_INFO = exports.C_TRACE = exports.C_WARN = exports.ISO8601 = exports.MetaArgs = exports.AbstractLogger = exports.ConsoleLogger = exports.Logger = exports.NestedException = exports.TodoException = exports.NotYetImplementedError = exports.NotSupportedError = exports.ClassUtils = exports.CryptUtils = exports.TreeUtils = exports.JsonUtils = void 0;
3
+ exports.PlatformUtils = exports.Serializer = exports.LockFactory = exports.Semaphore = exports.MetadataStorage = exports.C_DEFAULT = exports.__SOURCE__ = exports.C_CONSOLE = exports.C_DEBUG = exports.C_ERROR = exports.C_INFO = exports.C_TRACE = exports.C_WARN = exports.ISO8601 = exports.MetaArgs = exports.AbstractLogger = exports.ConsoleLogger = exports.Logger = exports.NestedException = exports.TodoException = exports.NotYetImplementedError = exports.NotSupportedError = exports.ClassUtils = exports.CryptUtils = exports.ArrayUtils = exports.TreeUtils = exports.JsonUtils = void 0;
4
4
  var shared_1 = require("./shared");
5
5
  Object.defineProperty(exports, "JsonUtils", { enumerable: true, get: function () { return shared_1.JsonUtils; } });
6
6
  Object.defineProperty(exports, "TreeUtils", { enumerable: true, get: function () { return shared_1.TreeUtils; } });
7
+ Object.defineProperty(exports, "ArrayUtils", { enumerable: true, get: function () { return shared_1.ArrayUtils; } });
7
8
  Object.defineProperty(exports, "CryptUtils", { enumerable: true, get: function () { return shared_1.CryptUtils; } });
8
9
  Object.defineProperty(exports, "ClassUtils", { enumerable: true, get: function () { return shared_1.ClassUtils; } });
9
10
  Object.defineProperty(exports, "NotSupportedError", { enumerable: true, get: function () { return shared_1.NotSupportedError; } });
@@ -26,6 +27,7 @@ Object.defineProperty(exports, "C_DEFAULT", { enumerable: true, get: function ()
26
27
  Object.defineProperty(exports, "MetadataStorage", { enumerable: true, get: function () { return shared_1.MetadataStorage; } });
27
28
  Object.defineProperty(exports, "Semaphore", { enumerable: true, get: function () { return shared_1.Semaphore; } });
28
29
  Object.defineProperty(exports, "LockFactory", { enumerable: true, get: function () { return shared_1.LockFactory; } });
30
+ Object.defineProperty(exports, "Serializer", { enumerable: true, get: function () { return shared_1.Serializer; } });
29
31
  var PlatformUtilsBrowser_1 = require("./utils/PlatformUtilsBrowser");
30
32
  Object.defineProperty(exports, "PlatformUtils", { enumerable: true, get: function () { return PlatformUtilsBrowser_1.PlatformUtils; } });
31
33
 
package/browser.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/browser.ts"],"names":[],"mappings":";;;AAAA,mCA6BkB;AA5BhB,mGAAA,SAAS,OAAA;AACT,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AACV,oGAAA,UAAU,OAAA;AACV,2GAAA,iBAAiB,OAAA;AACjB,gHAAA,sBAAsB,OAAA;AACtB,uGAAA,aAAa,OAAA;AACb,yGAAA,eAAe,OAAA;AACf,gGAAA,MAAM,OAAA;AAIN,uGAAA,aAAa,OAAA;AACb,wGAAA,cAAc,OAAA;AACd,kGAAA,QAAQ,OAAA;AAER,iGAAA,OAAO,OAAA;AACP,gGAAA,MAAM,OAAA;AACN,iGAAA,OAAO,OAAA;AACP,gGAAA,MAAM,OAAA;AACN,iGAAA,OAAO,OAAA;AACP,iGAAA,OAAO,OAAA;AACP,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AACV,mGAAA,SAAS,OAAA;AACT,yGAAA,eAAe,OAAA;AACf,mGAAA,SAAS,OAAA;AACT,qGAAA,WAAW,OAAA;AAEb,qEAA2D;AAAnD,qHAAA,aAAa,OAAA","file":"browser.js","sourcesContent":["export {\n JsonUtils,\n TreeUtils,\n CryptUtils,\n ClassUtils,\n NotSupportedError,\n NotYetImplementedError,\n TodoException,\n NestedException,\n Logger,\n ILogLevel,\n ILoggerOptions,\n ILoggerApi,\n ConsoleLogger,\n AbstractLogger,\n MetaArgs,\n StringOrFunction,\n ISO8601,\n C_WARN,\n C_TRACE,\n C_INFO,\n C_ERROR,\n C_DEBUG,\n C_CONSOLE,\n __SOURCE__,\n C_DEFAULT,\n MetadataStorage,\n Semaphore,\n LockFactory\n} from './shared';\nexport {PlatformUtils} from './utils/PlatformUtilsBrowser';\n"],"sourceRoot":"."}
1
+ {"version":3,"sources":["../../../src/browser.ts"],"names":[],"mappings":";;;AAAA,mCAiCkB;AAhChB,mGAAA,SAAS,OAAA;AACT,mGAAA,SAAS,OAAA;AAET,oGAAA,UAAU,OAAA;AACV,oGAAA,UAAU,OAAA;AACV,oGAAA,UAAU,OAAA;AACV,2GAAA,iBAAiB,OAAA;AACjB,gHAAA,sBAAsB,OAAA;AACtB,uGAAA,aAAa,OAAA;AACb,yGAAA,eAAe,OAAA;AACf,gGAAA,MAAM,OAAA;AAIN,uGAAA,aAAa,OAAA;AACb,wGAAA,cAAc,OAAA;AACd,kGAAA,QAAQ,OAAA;AAER,iGAAA,OAAO,OAAA;AACP,gGAAA,MAAM,OAAA;AACN,iGAAA,OAAO,OAAA;AACP,gGAAA,MAAM,OAAA;AACN,iGAAA,OAAO,OAAA;AACP,iGAAA,OAAO,OAAA;AACP,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AACV,mGAAA,SAAS,OAAA;AACT,yGAAA,eAAe,OAAA;AACf,mGAAA,SAAS,OAAA;AACT,qGAAA,WAAW,OAAA;AACX,oGAAA,UAAU,OAAA;AAGZ,qEAA2D;AAAnD,qHAAA,aAAa,OAAA","file":"browser.js","sourcesContent":["export {\n JsonUtils,\n TreeUtils,\n WalkValues,\n ArrayUtils,\n CryptUtils,\n ClassUtils,\n NotSupportedError,\n NotYetImplementedError,\n TodoException,\n NestedException,\n Logger,\n ILogLevel,\n ILoggerOptions,\n ILoggerApi,\n ConsoleLogger,\n AbstractLogger,\n MetaArgs,\n StringOrFunction,\n ISO8601,\n C_WARN,\n C_TRACE,\n C_INFO,\n C_ERROR,\n C_DEBUG,\n C_CONSOLE,\n __SOURCE__,\n C_DEFAULT,\n MetadataStorage,\n Semaphore,\n LockFactory,\n Serializer,\n IMergeChange\n} from './shared';\nexport {PlatformUtils} from './utils/PlatformUtilsBrowser';\n"],"sourceRoot":"."}
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { JsonUtils, TreeUtils, CryptUtils, ClassUtils, NotSupportedError, NotYetImplementedError, TodoException, NestedException, Logger, ILogLevel, ILoggerOptions, ILoggerApi, ConsoleLogger, AbstractLogger, MetaArgs, StringOrFunction, ISO8601, C_WARN, C_TRACE, C_INFO, C_ERROR, C_DEBUG, C_CONSOLE, __SOURCE__, C_DEFAULT, MetadataStorage, LockFactory, Semaphore } from './shared';
1
+ export { JsonUtils, TreeUtils, CryptUtils, ArrayUtils, WalkValues, ClassUtils, NotSupportedError, NotYetImplementedError, TodoException, NestedException, Logger, ILogLevel, ILoggerOptions, ILoggerApi, ConsoleLogger, AbstractLogger, MetaArgs, StringOrFunction, ISO8601, C_WARN, C_TRACE, C_INFO, C_ERROR, C_DEBUG, C_CONSOLE, __SOURCE__, C_DEFAULT, MetadataStorage, LockFactory, Semaphore, Serializer, IMergeChange } from './shared';
2
2
  export { ClassLoader } from './utils/ClassLoader';
3
3
  export { PlatformUtils } from './utils/PlatformUtils';
4
4
  export { FileUtils } from './utils/FileUtils';
package/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FileUtils = exports.PlatformUtils = exports.ClassLoader = exports.Semaphore = exports.LockFactory = exports.MetadataStorage = exports.C_DEFAULT = exports.__SOURCE__ = exports.C_CONSOLE = exports.C_DEBUG = exports.C_ERROR = exports.C_INFO = exports.C_TRACE = exports.C_WARN = exports.ISO8601 = exports.MetaArgs = exports.AbstractLogger = exports.ConsoleLogger = exports.Logger = exports.NestedException = exports.TodoException = exports.NotYetImplementedError = exports.NotSupportedError = exports.ClassUtils = exports.CryptUtils = exports.TreeUtils = exports.JsonUtils = void 0;
3
+ exports.FileUtils = exports.PlatformUtils = exports.ClassLoader = exports.Serializer = exports.Semaphore = exports.LockFactory = exports.MetadataStorage = exports.C_DEFAULT = exports.__SOURCE__ = exports.C_CONSOLE = exports.C_DEBUG = exports.C_ERROR = exports.C_INFO = exports.C_TRACE = exports.C_WARN = exports.ISO8601 = exports.MetaArgs = exports.AbstractLogger = exports.ConsoleLogger = exports.Logger = exports.NestedException = exports.TodoException = exports.NotYetImplementedError = exports.NotSupportedError = exports.ClassUtils = exports.ArrayUtils = exports.CryptUtils = exports.TreeUtils = exports.JsonUtils = void 0;
4
4
  var shared_1 = require("./shared");
5
5
  Object.defineProperty(exports, "JsonUtils", { enumerable: true, get: function () { return shared_1.JsonUtils; } });
6
6
  Object.defineProperty(exports, "TreeUtils", { enumerable: true, get: function () { return shared_1.TreeUtils; } });
7
7
  Object.defineProperty(exports, "CryptUtils", { enumerable: true, get: function () { return shared_1.CryptUtils; } });
8
+ Object.defineProperty(exports, "ArrayUtils", { enumerable: true, get: function () { return shared_1.ArrayUtils; } });
8
9
  Object.defineProperty(exports, "ClassUtils", { enumerable: true, get: function () { return shared_1.ClassUtils; } });
9
10
  Object.defineProperty(exports, "NotSupportedError", { enumerable: true, get: function () { return shared_1.NotSupportedError; } });
10
11
  Object.defineProperty(exports, "NotYetImplementedError", { enumerable: true, get: function () { return shared_1.NotYetImplementedError; } });
@@ -26,6 +27,7 @@ Object.defineProperty(exports, "C_DEFAULT", { enumerable: true, get: function ()
26
27
  Object.defineProperty(exports, "MetadataStorage", { enumerable: true, get: function () { return shared_1.MetadataStorage; } });
27
28
  Object.defineProperty(exports, "LockFactory", { enumerable: true, get: function () { return shared_1.LockFactory; } });
28
29
  Object.defineProperty(exports, "Semaphore", { enumerable: true, get: function () { return shared_1.Semaphore; } });
30
+ Object.defineProperty(exports, "Serializer", { enumerable: true, get: function () { return shared_1.Serializer; } });
29
31
  var ClassLoader_1 = require("./utils/ClassLoader");
30
32
  Object.defineProperty(exports, "ClassLoader", { enumerable: true, get: function () { return ClassLoader_1.ClassLoader; } });
31
33
  var PlatformUtils_1 = require("./utils/PlatformUtils");
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,mCA6BkB;AA5BhB,mGAAA,SAAS,OAAA;AACT,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AACV,oGAAA,UAAU,OAAA;AACV,2GAAA,iBAAiB,OAAA;AACjB,gHAAA,sBAAsB,OAAA;AACtB,uGAAA,aAAa,OAAA;AACb,yGAAA,eAAe,OAAA;AACf,gGAAA,MAAM,OAAA;AAIN,uGAAA,aAAa,OAAA;AACb,wGAAA,cAAc,OAAA;AACd,kGAAA,QAAQ,OAAA;AAER,iGAAA,OAAO,OAAA;AACP,gGAAA,MAAM,OAAA;AACN,iGAAA,OAAO,OAAA;AACP,gGAAA,MAAM,OAAA;AACN,iGAAA,OAAO,OAAA;AACP,iGAAA,OAAO,OAAA;AACP,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AACV,mGAAA,SAAS,OAAA;AACT,yGAAA,eAAe,OAAA;AACf,qGAAA,WAAW,OAAA;AACX,mGAAA,SAAS,OAAA;AAIX,mDAAgD;AAAxC,0GAAA,WAAW,OAAA;AACnB,uDAAoD;AAA5C,8GAAA,aAAa,OAAA;AACrB,+CAA4C;AAApC,sGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["export {\n JsonUtils,\n TreeUtils,\n CryptUtils,\n ClassUtils,\n NotSupportedError,\n NotYetImplementedError,\n TodoException,\n NestedException,\n Logger,\n ILogLevel,\n ILoggerOptions,\n ILoggerApi,\n ConsoleLogger,\n AbstractLogger,\n MetaArgs,\n StringOrFunction,\n ISO8601,\n C_WARN,\n C_TRACE,\n C_INFO,\n C_ERROR,\n C_DEBUG,\n C_CONSOLE,\n __SOURCE__,\n C_DEFAULT,\n MetadataStorage,\n LockFactory,\n Semaphore\n} from './shared';\n\n\nexport {ClassLoader} from './utils/ClassLoader';\nexport {PlatformUtils} from './utils/PlatformUtils';\nexport {FileUtils} from './utils/FileUtils';\n\n"],"sourceRoot":"."}
1
+ {"version":3,"sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAiCkB;AAhChB,mGAAA,SAAS,OAAA;AACT,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AACV,oGAAA,UAAU,OAAA;AAEV,oGAAA,UAAU,OAAA;AACV,2GAAA,iBAAiB,OAAA;AACjB,gHAAA,sBAAsB,OAAA;AACtB,uGAAA,aAAa,OAAA;AACb,yGAAA,eAAe,OAAA;AACf,gGAAA,MAAM,OAAA;AAIN,uGAAA,aAAa,OAAA;AACb,wGAAA,cAAc,OAAA;AACd,kGAAA,QAAQ,OAAA;AAER,iGAAA,OAAO,OAAA;AACP,gGAAA,MAAM,OAAA;AACN,iGAAA,OAAO,OAAA;AACP,gGAAA,MAAM,OAAA;AACN,iGAAA,OAAO,OAAA;AACP,iGAAA,OAAO,OAAA;AACP,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AACV,mGAAA,SAAS,OAAA;AACT,yGAAA,eAAe,OAAA;AACf,qGAAA,WAAW,OAAA;AACX,mGAAA,SAAS,OAAA;AACT,oGAAA,UAAU,OAAA;AAKZ,mDAAgD;AAAxC,0GAAA,WAAW,OAAA;AACnB,uDAAoD;AAA5C,8GAAA,aAAa,OAAA;AACrB,+CAA4C;AAApC,sGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["export {\n JsonUtils,\n TreeUtils,\n CryptUtils,\n ArrayUtils,\n WalkValues,\n ClassUtils,\n NotSupportedError,\n NotYetImplementedError,\n TodoException,\n NestedException,\n Logger,\n ILogLevel,\n ILoggerOptions,\n ILoggerApi,\n ConsoleLogger,\n AbstractLogger,\n MetaArgs,\n StringOrFunction,\n ISO8601,\n C_WARN,\n C_TRACE,\n C_INFO,\n C_ERROR,\n C_DEBUG,\n C_CONSOLE,\n __SOURCE__,\n C_DEFAULT,\n MetadataStorage,\n LockFactory,\n Semaphore,\n Serializer,\n IMergeChange\n} from './shared';\n\n\nexport {ClassLoader} from './utils/ClassLoader';\nexport {PlatformUtils} from './utils/PlatformUtils';\nexport {FileUtils} from './utils/FileUtils';\n\n"],"sourceRoot":"."}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allgemein/base",
3
- "version": "1.6.1",
3
+ "version": "1.6.5",
4
4
  "description": "Library for commons moduls.",
5
5
  "main": "./index.js",
6
6
  "private": false,
@@ -37,10 +37,16 @@
37
37
  "@types/lodash": "^4.14.175",
38
38
  "@types/mocha": "^9.0.0",
39
39
  "@types/node": "^16.10.3",
40
+ "@typescript-eslint/eslint-plugin": "^5.10.1",
41
+ "@typescript-eslint/parser": "^5.10.1",
40
42
  "chai": "^4.3.4",
41
43
  "codecov": "^3.8.3",
42
44
  "codelyzer": "^6.0.2",
43
45
  "del": "6.0.0",
46
+ "eslint": "7.28.0",
47
+ "eslint-plugin-import": "2.23.4",
48
+ "eslint-plugin-mocha": "9.0.0",
49
+ "eslint-plugin-prettier": "3.4.0",
44
50
  "gulp": "4.0.2",
45
51
  "gulp-bump": "^3.2.0",
46
52
  "gulp-clean": "^0.4.0",
@@ -51,13 +57,14 @@
51
57
  "merge-stream": "^2.0.0",
52
58
  "mocha": "^9.1.2",
53
59
  "nyc": "^15.1.0",
60
+ "lodash": "^4.17.21",
54
61
  "reflect-metadata": "^0.1.13",
55
62
  "std-mocks": "^1.0.1",
56
63
  "ts-node": "^10.2.1",
57
64
  "tslint": "^6.1.3",
58
65
  "typescript": "4.4.3"
59
66
  },
60
- "dependencies": {
67
+ "peerDependencies": {
61
68
  "lodash": "^4.17.21"
62
69
  }
63
70
  }
package/shared.d.ts CHANGED
@@ -13,8 +13,9 @@ export { NotYetImplementedError } from './exceptions/NotYetImplementedError';
13
13
  export { NotSupportedError } from './exceptions/NotSupportedError';
14
14
  export { ClassUtils } from './utils/ClassUtils';
15
15
  export { CryptUtils } from './utils/CryptUtils';
16
- export { TreeUtils } from './utils/TreeUtils';
16
+ export { TreeUtils, WalkValues } from './utils/TreeUtils';
17
17
  export { JsonUtils } from './utils/JsonUtils';
18
18
  export { Serializer } from './utils/Serializer';
19
+ export { ArrayUtils, IMergeChange } from './utils/ArrayUtils';
19
20
  export { LockFactory } from './locking/LockFactory';
20
21
  export { Semaphore } from './locking/Semaphore';
package/shared.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Semaphore = exports.LockFactory = exports.Serializer = exports.JsonUtils = exports.TreeUtils = exports.CryptUtils = exports.ClassUtils = exports.NotSupportedError = exports.NotYetImplementedError = exports.TodoException = exports.NestedException = exports.Logger = exports.ConsoleLogger = exports.AbstractLogger = exports.MetadataStorage = exports.MetaArgs = exports.ISO8601 = exports.C_WARN = exports.C_TRACE = exports.C_INFO = exports.C_ERROR = exports.C_DEBUG = exports.C_CONSOLE = exports.__SOURCE__ = exports.C_DEFAULT = void 0;
3
+ exports.Semaphore = exports.LockFactory = exports.ArrayUtils = exports.Serializer = exports.JsonUtils = exports.TreeUtils = exports.CryptUtils = exports.ClassUtils = exports.NotSupportedError = exports.NotYetImplementedError = exports.TodoException = exports.NestedException = exports.Logger = exports.ConsoleLogger = exports.AbstractLogger = exports.MetadataStorage = exports.MetaArgs = exports.ISO8601 = exports.C_WARN = exports.C_TRACE = exports.C_INFO = exports.C_ERROR = exports.C_DEBUG = exports.C_CONSOLE = exports.__SOURCE__ = exports.C_DEFAULT = void 0;
4
4
  var Constants_1 = require("./Constants");
5
5
  Object.defineProperty(exports, "C_DEFAULT", { enumerable: true, get: function () { return Constants_1.C_DEFAULT; } });
6
6
  Object.defineProperty(exports, "__SOURCE__", { enumerable: true, get: function () { return Constants_1.__SOURCE__; } });
@@ -39,6 +39,8 @@ var JsonUtils_1 = require("./utils/JsonUtils");
39
39
  Object.defineProperty(exports, "JsonUtils", { enumerable: true, get: function () { return JsonUtils_1.JsonUtils; } });
40
40
  var Serializer_1 = require("./utils/Serializer");
41
41
  Object.defineProperty(exports, "Serializer", { enumerable: true, get: function () { return Serializer_1.Serializer; } });
42
+ var ArrayUtils_1 = require("./utils/ArrayUtils");
43
+ Object.defineProperty(exports, "ArrayUtils", { enumerable: true, get: function () { return ArrayUtils_1.ArrayUtils; } });
42
44
  var LockFactory_1 = require("./locking/LockFactory");
43
45
  Object.defineProperty(exports, "LockFactory", { enumerable: true, get: function () { return LockFactory_1.LockFactory; } });
44
46
  var Semaphore_1 = require("./locking/Semaphore");
package/shared.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/shared.ts"],"names":[],"mappings":";;;AAAA,yCAEqB;AADnB,sGAAA,SAAS,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,sGAAA,SAAS,OAAA;AAAE,oGAAA,OAAO,OAAA;AAAE,oGAAA,OAAO,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,oGAAA,OAAO,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,oGAAA,OAAO,OAAA;AAEtF,uCAAoC;AAA5B,oGAAA,QAAQ,OAAA;AAChB,qDAAkD;AAA1C,kHAAA,eAAe,OAAA;AAEvB,2DAAwD;AAAhD,gHAAA,cAAc,OAAA;AACtB,yDAAsD;AAA9C,8GAAA,aAAa,OAAA;AAIrB,2CAAwC;AAAhC,gGAAA,MAAM,OAAA;AAEd,gEAA6D;AAArD,kHAAA,eAAe,OAAA;AACvB,4DAAyD;AAAjD,8GAAA,aAAa,OAAA;AACrB,8EAA2E;AAAnE,gIAAA,sBAAsB,OAAA;AAC9B,oEAAiE;AAAzD,sHAAA,iBAAiB,OAAA;AAEzB,iDAA8C;AAAtC,wGAAA,UAAU,OAAA;AAClB,iDAA8C;AAAtC,wGAAA,UAAU,OAAA;AAClB,+CAA4C;AAApC,sGAAA,SAAS,OAAA;AACjB,+CAA4C;AAApC,sGAAA,SAAS,OAAA;AACjB,iDAA8C;AAAtC,wGAAA,UAAU,OAAA;AAElB,qDAAkD;AAA1C,0GAAA,WAAW,OAAA;AACnB,iDAA8C;AAAtC,sGAAA,SAAS,OAAA","file":"shared.js","sourcesContent":["export {\n C_DEFAULT, __SOURCE__, C_CONSOLE, C_DEBUG, C_ERROR, C_INFO, C_TRACE, C_WARN, ISO8601, StringOrFunction\n} from './Constants';\nexport {MetaArgs} from './MetaArgs';\nexport {MetadataStorage} from './MetadataStorage';\n\nexport {AbstractLogger} from './logging/AbstractLogger';\nexport {ConsoleLogger} from './logging/ConsoleLogger';\nexport {ILoggerApi} from './logging/ILoggerApi';\nexport {ILoggerOptions} from './logging/ILoggerOptions';\nexport {ILogLevel} from './logging/ILogLevel';\nexport {Logger} from './logging/Logger';\n\nexport {NestedException} from './exceptions/NestedException';\nexport {TodoException} from './exceptions/TodoException';\nexport {NotYetImplementedError} from './exceptions/NotYetImplementedError';\nexport {NotSupportedError} from './exceptions/NotSupportedError';\n\nexport {ClassUtils} from './utils/ClassUtils';\nexport {CryptUtils} from './utils/CryptUtils';\nexport {TreeUtils} from './utils/TreeUtils';\nexport {JsonUtils} from './utils/JsonUtils';\nexport {Serializer} from './utils/Serializer';\n\nexport {LockFactory} from './locking/LockFactory';\nexport {Semaphore} from './locking/Semaphore';\n\n"],"sourceRoot":"."}
1
+ {"version":3,"sources":["../../../src/shared.ts"],"names":[],"mappings":";;;AAAA,yCAEqB;AADnB,sGAAA,SAAS,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,sGAAA,SAAS,OAAA;AAAE,oGAAA,OAAO,OAAA;AAAE,oGAAA,OAAO,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,oGAAA,OAAO,OAAA;AAAE,mGAAA,MAAM,OAAA;AAAE,oGAAA,OAAO,OAAA;AAEtF,uCAAoC;AAA5B,oGAAA,QAAQ,OAAA;AAChB,qDAAkD;AAA1C,kHAAA,eAAe,OAAA;AAEvB,2DAAwD;AAAhD,gHAAA,cAAc,OAAA;AACtB,yDAAsD;AAA9C,8GAAA,aAAa,OAAA;AAIrB,2CAAwC;AAAhC,gGAAA,MAAM,OAAA;AAEd,gEAA6D;AAArD,kHAAA,eAAe,OAAA;AACvB,4DAAyD;AAAjD,8GAAA,aAAa,OAAA;AACrB,8EAA2E;AAAnE,gIAAA,sBAAsB,OAAA;AAC9B,oEAAiE;AAAzD,sHAAA,iBAAiB,OAAA;AAEzB,iDAA8C;AAAtC,wGAAA,UAAU,OAAA;AAClB,iDAA8C;AAAtC,wGAAA,UAAU,OAAA;AAClB,+CAAwD;AAAhD,sGAAA,SAAS,OAAA;AACjB,+CAA4C;AAApC,sGAAA,SAAS,OAAA;AACjB,iDAA8C;AAAtC,wGAAA,UAAU,OAAA;AAClB,iDAA4D;AAApD,wGAAA,UAAU,OAAA;AAElB,qDAAkD;AAA1C,0GAAA,WAAW,OAAA;AACnB,iDAA8C;AAAtC,sGAAA,SAAS,OAAA","file":"shared.js","sourcesContent":["export {\n C_DEFAULT, __SOURCE__, C_CONSOLE, C_DEBUG, C_ERROR, C_INFO, C_TRACE, C_WARN, ISO8601, StringOrFunction\n} from './Constants';\nexport {MetaArgs} from './MetaArgs';\nexport {MetadataStorage} from './MetadataStorage';\n\nexport {AbstractLogger} from './logging/AbstractLogger';\nexport {ConsoleLogger} from './logging/ConsoleLogger';\nexport {ILoggerApi} from './logging/ILoggerApi';\nexport {ILoggerOptions} from './logging/ILoggerOptions';\nexport {ILogLevel} from './logging/ILogLevel';\nexport {Logger} from './logging/Logger';\n\nexport {NestedException} from './exceptions/NestedException';\nexport {TodoException} from './exceptions/TodoException';\nexport {NotYetImplementedError} from './exceptions/NotYetImplementedError';\nexport {NotSupportedError} from './exceptions/NotSupportedError';\n\nexport {ClassUtils} from './utils/ClassUtils';\nexport {CryptUtils} from './utils/CryptUtils';\nexport {TreeUtils, WalkValues} from './utils/TreeUtils';\nexport {JsonUtils} from './utils/JsonUtils';\nexport {Serializer} from './utils/Serializer';\nexport {ArrayUtils, IMergeChange} from './utils/ArrayUtils';\n\nexport {LockFactory} from './locking/LockFactory';\nexport {Semaphore} from './locking/Semaphore';\n\n"],"sourceRoot":"."}
@@ -0,0 +1,12 @@
1
+ export interface IMergeChange {
2
+ type: 'missing' | 'value' | 'push' | 'create-push';
3
+ key: string;
4
+ src?: any;
5
+ dst?: any;
6
+ position?: number;
7
+ value?: any;
8
+ }
9
+ export declare class ArrayUtils {
10
+ static merge(source: any, dest: any): IMergeChange[];
11
+ private static mergeHandleArray;
12
+ }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArrayUtils = void 0;
4
+ const TreeUtils_1 = require("./TreeUtils");
5
+ const lodash_1 = require("lodash");
6
+ class ArrayUtils {
7
+ static merge(source, dest) {
8
+ const changes = [];
9
+ TreeUtils_1.TreeUtils.walk(dest, (x) => {
10
+ // new sub-property
11
+ const location = x.location.join('.');
12
+ if (x.isLeaf) {
13
+ // is leaf - check content
14
+ if ((0, lodash_1.isNull)(x.index) && x.key) {
15
+ // object path
16
+ const value = (0, lodash_1.get)(source, location, undefined);
17
+ if ((0, lodash_1.isUndefined)(value)) {
18
+ // not exists, append to source
19
+ (0, lodash_1.set)(source, location, x.value);
20
+ changes.push({ type: 'missing', key: location });
21
+ }
22
+ else {
23
+ if (value !== x.value) {
24
+ (0, lodash_1.set)(source, location, x.value);
25
+ changes.push({ type: 'value', key: location, src: value, dst: x.value });
26
+ }
27
+ }
28
+ }
29
+ else if ((0, lodash_1.isNumber)(x.index)) {
30
+ // array element
31
+ this.mergeHandleArray(source, x, changes);
32
+ }
33
+ else {
34
+ throw new Error('no object or array node on leaf');
35
+ }
36
+ }
37
+ else {
38
+ // is branch - check structure
39
+ if ((0, lodash_1.isNull)(x.index) && x.key) {
40
+ // object path
41
+ const value = (0, lodash_1.get)(source, location, undefined);
42
+ if ((0, lodash_1.isUndefined)(value)) {
43
+ // not exists, append to source
44
+ (0, lodash_1.set)(source, location, x.value);
45
+ changes.push({ type: 'missing', key: location });
46
+ }
47
+ }
48
+ else if ((0, lodash_1.isNumber)(x.index)) {
49
+ this.mergeHandleArray(source, x, changes);
50
+ }
51
+ else {
52
+ throw new Error('no object or array node on branch');
53
+ }
54
+ }
55
+ });
56
+ return changes;
57
+ }
58
+ static mergeHandleArray(source, x, changes) {
59
+ // array element
60
+ const parent = (0, lodash_1.clone)(x.location);
61
+ parent.pop();
62
+ const parentLocation = parent.join('.');
63
+ const sourceArray = parent.length === 0 ? source : (0, lodash_1.get)(source, parentLocation, undefined);
64
+ if ((0, lodash_1.isArray)(sourceArray)) {
65
+ // source array exists check if value present
66
+ const exists = sourceArray.find((y) => (0, lodash_1.isEqual)(x, x.value));
67
+ if (!exists) {
68
+ // add missing value
69
+ const position = sourceArray.length;
70
+ sourceArray.push(x.value);
71
+ changes.push({ type: 'push', key: parentLocation, position: position, value: x.value });
72
+ }
73
+ }
74
+ else if ((0, lodash_1.isUndefined)(sourceArray)) {
75
+ // source parent for appending structure is not the same
76
+ (0, lodash_1.set)(source, parentLocation, [x.value]);
77
+ changes.push({ type: 'create-push', key: parentLocation, position: 0, value: x.value });
78
+ }
79
+ else if ((0, lodash_1.isObjectLike)(sourceArray)) {
80
+ // source parent is an object like entry
81
+ // todo replace this with the array
82
+ throw new Error('structural inconsistencies: needed array to add value found object-like entry [' + parentLocation + ']');
83
+ }
84
+ else {
85
+ throw new Error('structural inconsistencies: needed array to add value found unknown [' + parentLocation + ']');
86
+ }
87
+ }
88
+ }
89
+ exports.ArrayUtils = ArrayUtils;
90
+
91
+ //# sourceMappingURL=ArrayUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/ArrayUtils.ts"],"names":[],"mappings":";;;AAAA,2CAAkD;AAClD,mCAAsG;AAWtG,MAAa,UAAU;IAErB,MAAM,CAAC,KAAK,CAAC,MAAW,EAAE,IAAS;QACjC,MAAM,OAAO,GAAmB,EAAE,CAAC;QACnC,qBAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAa,EAAE,EAAE;YACrC,mBAAmB;YACnB,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEtC,IAAI,CAAC,CAAC,MAAM,EAAE;gBACZ,0BAA0B;gBAC1B,IAAI,IAAA,eAAM,EAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE;oBAC5B,cAAc;oBACd,MAAM,KAAK,GAAG,IAAA,YAAG,EAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;oBAC/C,IAAI,IAAA,oBAA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C;aACvF;SACF;aAAM,IAAI,IAAA,oBAAW,EAAC,WAAW,CAAC,EAAE;YACnC,wDAAwD;YACxD,IAAA,YAAG,EAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAC,CAAC,CAAC;SACvF;aAAM,IAAI,IAAA,qBAAY,EAAC,WAAW,CAAC,EAAE;YACpC,wCAAwC;YACxC,mCAAmC;YACnC,MAAM,IAAI,KAAK,CAAC,iFAAiF,GAAG,cAAc,GAAG,GAAG,CAAC,CAAC;SAC3H;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,uEAAuE,GAAG,cAAc,GAAG,GAAG,CAAC,CAAC;SACjH;IAEH,CAAC;CACF;AA9ED,gCA8EC","file":"ArrayUtils.js","sourcesContent":["import {TreeUtils, WalkValues} from './TreeUtils';\nimport {clone, get, isArray, isEqual, isNull, isNumber, isObjectLike, isUndefined, set} from 'lodash';\n\nexport interface IMergeChange {\n type: 'missing' | 'value' | 'push' | 'create-push';\n key: string;\n src?: any;\n dst?: any;\n position?: number;\n value?: any;\n}\n\nexport class ArrayUtils {\n\n static merge(source: any, dest: any) {\n const changes: IMergeChange[] = [];\n TreeUtils.walk(dest, (x: WalkValues) => {\n // new sub-property\n const location = x.location.join('.');\n\n if (x.isLeaf) {\n // is leaf - check content\n if (isNull(x.index) && x.key) {\n // object path\n const value = get(source, location, undefined);\n if (isUndefined(value)) {\n // not exists, append to source\n set(source, location, x.value);\n changes.push({type: 'missing', key: location});\n } else {\n if (value !== x.value) {\n set(source, location, x.value);\n changes.push({type: 'value', key: location, src: value, dst: x.value});\n }\n }\n } else if (isNumber(x.index)) {\n // array element\n this.mergeHandleArray(source, x, changes);\n } else {\n throw new Error('no object or array node on leaf');\n }\n } else {\n // is branch - check structure\n if (isNull(x.index) && x.key) {\n // object path\n const value = get(source, location, undefined);\n if (isUndefined(value)) {\n // not exists, append to source\n set(source, location, x.value);\n changes.push({type: 'missing', key: location});\n }\n } else if (isNumber(x.index)) {\n this.mergeHandleArray(source, x, changes);\n } else {\n throw new Error('no object or array node on branch');\n }\n }\n });\n return changes;\n }\n\n\n private static mergeHandleArray(source: any, x: WalkValues, changes: IMergeChange[]) {\n // array element\n const parent = clone(x.location);\n parent.pop();\n const parentLocation = parent.join('.');\n const sourceArray = parent.length === 0 ? source : get(source, parentLocation, undefined);\n if (isArray(sourceArray)) {\n // source array exists check if value present\n const exists = sourceArray.find((y: any) => isEqual(x, x.value));\n if (!exists) {\n // add missing value\n const position = sourceArray.length;\n sourceArray.push(x.value);\n changes.push({type: 'push', key: parentLocation, position: position, value: x.value});\n }\n } else if (isUndefined(sourceArray)) {\n // source parent for appending structure is not the same\n set(source, parentLocation, [x.value]);\n changes.push({type: 'create-push', key: parentLocation, position: 0, value: x.value});\n } else if (isObjectLike(sourceArray)) {\n // source parent is an object like entry\n // todo replace this with the array\n throw new Error('structural inconsistencies: needed array to add value found object-like entry [' + parentLocation + ']');\n } else {\n throw new Error('structural inconsistencies: needed array to add value found unknown [' + parentLocation + ']');\n }\n\n }\n}\n"],"sourceRoot":".."}
@@ -25,7 +25,7 @@ class TreeUtils {
25
25
  });
26
26
  }
27
27
  else if ((0, lodash_1.isObjectLike)(obj)) {
28
- (0, lodash_1.keys)(obj).forEach(_key => {
28
+ (0, lodash_1.keys)(obj).forEach((_key) => {
29
29
  const isLeaf = !(0, lodash_1.isArray)(obj[_key]) && !(0, lodash_1.isObjectLike)(obj[_key]);
30
30
  fn({
31
31
  value: obj[_key],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/TreeUtils.ts"],"names":[],"mappings":";;;AAAA,mCAAmD;AAWnD,MAAa,SAAS;IAGpB,MAAM,CAAC,IAAI,CAAC,IAAS,EAAE,EAA2B;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,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBAC5D;iBACF;aACF;iBAAM;gBACL,MAAM,EAAE,CAAC;oBACP,KAAK,EAAE,GAAG;oBACV,GAAG,EAAE,GAAG;oBACR,MAAM,EAAE,MAAM;oBACd,KAAK,EAAE,IAAI;oBACX,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC;oBACvB,MAAM,EAAE,IAAI;iBACb,CAAC,CAAC;aACJ;QACH,CAAC;QAED,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;CAGF;AA1GD,8BA0GC","file":"TreeUtils.js","sourcesContent":["import {isArray, isObjectLike, keys} from 'lodash';\n\nexport interface WalkValues {\n value: any;\n key: string | number;\n index: number;\n location: any;\n parent: any;\n isLeaf: boolean;\n}\n\nexport class TreeUtils {\n\n\n static walk(root: any, fn: (x: WalkValues) => void) {\n function walk(obj: any, parent: any = null, key: string | number = null, location: any[] = []) {\n if (obj === null || obj === undefined) {\n return;\n }\n if (isArray(obj)) {\n obj.forEach((el: any, j: number) => {\n const isLeaf = !isArray(el) && !isObjectLike(el);\n fn({\n value: el,\n key: key,\n index: j,\n location: [...location, ...[j]],\n parent: obj,\n isLeaf: isLeaf\n });\n if (!isLeaf) {\n walk(el, j, el, key ? [...location, ...[key], ...[j]] : [...location, ...[j]]);\n }\n });\n } else if (isObjectLike(obj)) {\n keys(obj).forEach(_key => {\n const isLeaf = !isArray(obj[_key]) && !isObjectLike(obj[_key]);\n fn({\n value: obj[_key],\n key: _key,\n parent: obj,\n index: null,\n location: [...location, ...[_key]],\n isLeaf: isLeaf\n });\n if (!isLeaf) {\n walk(obj[_key], obj, _key, [...location, ...[_key]]);\n }\n });\n } else {\n fn({\n value: obj,\n key: key,\n parent: parent,\n index: null,\n location: [...location],\n isLeaf: true\n });\n }\n }\n\n walk(root);\n }\n\n\n static async walkAsync(root: any, fn: (x: WalkValues) => void) {\n async function walk(obj: any, parent: any = null, key: string | number = null, location: any[] = []) {\n if (obj === null || obj === undefined) {\n return;\n }\n if (isArray(obj)) {\n for (let j = 0; j < obj.length; j++) {\n const el = obj[j];\n const isLeaf = !isArray(el) && !isObjectLike(el);\n await fn({\n value: el,\n key: key,\n index: j,\n location: [...location, ...[j]],\n parent: obj,\n isLeaf: isLeaf\n });\n if (!isLeaf) {\n await walk(el, j, el, key ? [...location, ...[key], ...[j]] : [...location, ...[j]]);\n }\n }\n } else if (isObjectLike(obj)) {\n for (const _key of keys(obj)) {\n const isLeaf = !isArray(obj[_key]) && !isObjectLike(obj[_key]);\n await fn({\n value: obj[_key],\n key: _key,\n parent: obj,\n index: null,\n location: [...location, ...[_key]],\n isLeaf: isLeaf\n });\n if (!isLeaf) {\n await walk(obj[_key], obj, _key, [...location, ...[_key]]);\n }\n }\n } else {\n await fn({\n value: obj,\n key: key,\n parent: parent,\n index: null,\n location: [...location],\n isLeaf: true\n });\n }\n }\n\n await walk(root);\n }\n\n\n}\n"],"sourceRoot":".."}
1
+ {"version":3,"sources":["../../../src/utils/TreeUtils.ts"],"names":[],"mappings":";;;AAAA,mCAAmD;AAWnD,MAAa,SAAS;IAGpB,MAAM,CAAC,IAAI,CAAC,IAAS,EAAE,EAA2B;QAChD,SAAS,IAAI,CAAC,GAAQ,EAAE,SAAc,IAAI,EAAE,MAAuB,IAAI,EAAE,WAAkB,EAAE;YAC3F,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;gBACrC,OAAO;aACR;YACD,IAAI,IAAA,gBAAO,EAAC,GAAG,CAAC,EAAE;gBAChB,GAAG,CAAC,OAAO,CAAC,CAAC,EAAO,EAAE,CAAS,EAAE,EAAE;oBACjC,MAAM,MAAM,GAAG,CAAC,IAAA,gBAAO,EAAC,EAAE,CAAC,IAAI,CAAC,IAAA,qBAAY,EAAC,EAAE,CAAC,CAAC;oBACjD,EAAE,CAAC;wBACD,KAAK,EAAE,EAAE;wBACT,GAAG,EAAE,GAAG;wBACR,KAAK,EAA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AC,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;qBACtF;iBACF;aACF;iBAAM,IAAI,IAAA,qBAAY,EAAC,GAAG,CAAC,EAAE;gBAC5B,KAAK,MAAM,IAAI,IAAI,IAAA,aAAI,EAAC,GAAG,CAAC,EAAE;oBAC5B,MAAM,MAAM,GAAG,CAAC,IAAA,gBAAO,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAA,qBAAY,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;oBAC/D,MAAM,EAAE,CAAC;wBACP,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC;wBAChB,GAAG,EAAE,IAAI;wBACT,MAAM,EAAE,GAAG;wBACX,KAAK,EAAE,IAAI;wBACX,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;wBAClC,MAAM,EAAE,MAAM;qBACf,CAAC,CAAC;oBACH,IAAI,CAAC,MAAM,EAAE;wBACX,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBAC5D;iBACF;aACF;iBAAM;gBACL,MAAM,EAAE,CAAC;oBACP,KAAK,EAAE,GAAG;oBACV,GAAG,EAAE,GAAG;oBACR,MAAM,EAAE,MAAM;oBACd,KAAK,EAAE,IAAI;oBACX,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC;oBACvB,MAAM,EAAE,IAAI;iBACb,CAAC,CAAC;aACJ;QACH,CAAC;QAED,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;CAGF;AA1GD,8BA0GC","file":"TreeUtils.js","sourcesContent":["import {isArray, isObjectLike, keys} from 'lodash';\n\nexport interface WalkValues {\n value: any;\n key: string | number;\n index: number;\n location: any;\n parent: any;\n isLeaf: boolean;\n}\n\nexport class TreeUtils {\n\n\n static walk(root: any, fn: (x: WalkValues) => void) {\n function walk(obj: any, parent: any = null, key: string | number = null, location: any[] = []) {\n if (obj === null || obj === undefined) {\n return;\n }\n if (isArray(obj)) {\n obj.forEach((el: any, j: number) => {\n const isLeaf = !isArray(el) && !isObjectLike(el);\n fn({\n value: el,\n key: key,\n index: j,\n location: [...location, ...[j]],\n parent: obj,\n isLeaf: isLeaf\n });\n if (!isLeaf) {\n walk(el, j, el, key ? [...location, ...[key], ...[j]] : [...location, ...[j]]);\n }\n });\n } else if (isObjectLike(obj)) {\n keys(obj).forEach((_key: string) => {\n const isLeaf = !isArray(obj[_key]) && !isObjectLike(obj[_key]);\n fn({\n value: obj[_key],\n key: _key,\n parent: obj,\n index: null,\n location: [...location, ...[_key]],\n isLeaf: isLeaf\n });\n if (!isLeaf) {\n walk(obj[_key], obj, _key, [...location, ...[_key]]);\n }\n });\n } else {\n fn({\n value: obj,\n key: key,\n parent: parent,\n index: null,\n location: [...location],\n isLeaf: true\n });\n }\n }\n\n walk(root);\n }\n\n\n static async walkAsync(root: any, fn: (x: WalkValues) => void) {\n async function walk(obj: any, parent: any = null, key: string | number = null, location: any[] = []) {\n if (obj === null || obj === undefined) {\n return;\n }\n if (isArray(obj)) {\n for (let j = 0; j < obj.length; j++) {\n const el = obj[j];\n const isLeaf = !isArray(el) && !isObjectLike(el);\n await fn({\n value: el,\n key: key,\n index: j,\n location: [...location, ...[j]],\n parent: obj,\n isLeaf: isLeaf\n });\n if (!isLeaf) {\n await walk(el, j, el, key ? [...location, ...[key], ...[j]] : [...location, ...[j]]);\n }\n }\n } else if (isObjectLike(obj)) {\n for (const _key of keys(obj)) {\n const isLeaf = !isArray(obj[_key]) && !isObjectLike(obj[_key]);\n await fn({\n value: obj[_key],\n key: _key,\n parent: obj,\n index: null,\n location: [...location, ...[_key]],\n isLeaf: isLeaf\n });\n if (!isLeaf) {\n await walk(obj[_key], obj, _key, [...location, ...[_key]]);\n }\n }\n } else {\n await fn({\n value: obj,\n key: key,\n parent: parent,\n index: null,\n location: [...location],\n isLeaf: true\n });\n }\n }\n\n await walk(root);\n }\n\n\n}\n"],"sourceRoot":".."}