@allgemein/base 1.9.1 → 1.10.1

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.
Files changed (64) hide show
  1. package/Constants.d.ts +2 -2
  2. package/Constants.js +5 -8
  3. package/Constants.js.map +1 -1
  4. package/MetaArgs.d.ts +1 -1
  5. package/MetaArgs.js +4 -8
  6. package/MetaArgs.js.map +1 -1
  7. package/MetadataStorage.js +6 -10
  8. package/MetadataStorage.js.map +1 -1
  9. package/README.md +71 -0
  10. package/browser.d.ts +2 -2
  11. package/browser.js +2 -27
  12. package/browser.js.map +1 -1
  13. package/exceptions/NestedException.js +1 -5
  14. package/exceptions/NestedException.js.map +1 -1
  15. package/exceptions/NotSupportedError.js +1 -5
  16. package/exceptions/NotSupportedError.js.map +1 -1
  17. package/exceptions/NotYetImplementedError.js +2 -6
  18. package/exceptions/NotYetImplementedError.js.map +1 -1
  19. package/exceptions/TodoException.js +1 -5
  20. package/exceptions/TodoException.js.map +1 -1
  21. package/fns/isPromiseLike.js +1 -4
  22. package/fns/isPromiseLike.js.map +1 -1
  23. package/generics.d.ts +60 -0
  24. package/generics.js +1465 -0
  25. package/generics.js.map +1 -0
  26. package/index.d.ts +5 -5
  27. package/index.js +5 -26
  28. package/index.js.map +1 -1
  29. package/locking/LockFactory.d.ts +1 -1
  30. package/locking/LockFactory.js +8 -12
  31. package/locking/LockFactory.js.map +1 -1
  32. package/locking/Semaphore.js +2 -7
  33. package/locking/Semaphore.js.map +1 -1
  34. package/package.json +2 -2
  35. package/shared.d.ts +18 -17
  36. package/shared.js +18 -41
  37. package/shared.js.map +1 -1
  38. package/utils/ArrayUtils.js +22 -26
  39. package/utils/ArrayUtils.js.map +1 -1
  40. package/utils/ClassLoader.d.ts +5 -5
  41. package/utils/ClassLoader.js +41 -46
  42. package/utils/ClassLoader.js.map +1 -1
  43. package/utils/ClassUtils.d.ts +2 -2
  44. package/utils/ClassUtils.js +11 -15
  45. package/utils/ClassUtils.js.map +1 -1
  46. package/utils/CryptUtils.js +1 -5
  47. package/utils/CryptUtils.js.map +1 -1
  48. package/utils/FileUtils.js +12 -16
  49. package/utils/FileUtils.js.map +1 -1
  50. package/utils/Glob.js +6 -10
  51. package/utils/Glob.js.map +1 -1
  52. package/utils/Interpolation.js +5 -10
  53. package/utils/Interpolation.js.map +1 -1
  54. package/utils/JsonUtils.js +8 -12
  55. package/utils/JsonUtils.js.map +1 -1
  56. package/utils/PlatformUtils.d.ts +2 -1
  57. package/utils/PlatformUtils.js +58 -65
  58. package/utils/PlatformUtils.js.map +1 -1
  59. package/utils/PlatformUtilsBrowser.js +27 -31
  60. package/utils/PlatformUtilsBrowser.js.map +1 -1
  61. package/utils/Serializer.js +23 -27
  62. package/utils/Serializer.js.map +1 -1
  63. package/utils/TreeUtils.js +9 -13
  64. package/utils/TreeUtils.js.map +1 -1
package/Constants.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export declare const __MODULNAME__ = "__MODULNAME__";
2
2
  export declare const __SOURCE__ = "__SOURCE__";
3
3
  export declare const __CLASS__ = "__CLASS__";
4
- export type FuntionWithProps = (Function & {
4
+ export type FunctionWithProps = (Function & {
5
5
  [__SOURCE__]?: string;
6
6
  [__CLASS__]?: string;
7
7
  [__MODULNAME__]?: string;
8
8
  });
9
- export type StringOrFunction = string | FuntionWithProps;
9
+ export type StringOrFunction = string | FunctionWithProps;
10
10
  export declare const C_DEFAULT = "default";
11
11
  export declare const ISO8601: RegExp;
package/Constants.js CHANGED
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ISO8601 = exports.C_DEFAULT = exports.__CLASS__ = exports.__SOURCE__ = exports.__MODULNAME__ = void 0;
4
- exports.__MODULNAME__ = '__MODULNAME__';
5
- exports.__SOURCE__ = '__SOURCE__';
6
- exports.__CLASS__ = '__CLASS__';
7
- exports.C_DEFAULT = 'default';
8
- exports.ISO8601 = /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(([+-]\d\d:\d\d)|Z)?$/i;
1
+ export const __MODULNAME__ = '__MODULNAME__';
2
+ export const __SOURCE__ = '__SOURCE__';
3
+ export const __CLASS__ = '__CLASS__';
4
+ export const C_DEFAULT = 'default';
5
+ export const ISO8601 = /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(([+-]\d\d:\d\d)|Z)?$/i;
9
6
  //# sourceMappingURL=Constants.js.map
package/Constants.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,UAAU,GAAG,YAAY,CAAC;AAC1B,QAAA,SAAS,GAAG,WAAW,CAAC;AAKxB,QAAA,SAAS,GAAG,SAAS,CAAC;AACtB,QAAA,OAAO,GAAG,+DAA+D,CAAC"}
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;AACvC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AAKrC,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AACnC,MAAM,CAAC,MAAM,OAAO,GAAG,+DAA+D,CAAC"}
package/MetaArgs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { MetadataStorage } from './MetadataStorage';
1
+ import { MetadataStorage } from './MetadataStorage.js';
2
2
  /**
3
3
  * Replaced in future by MetadataStorage
4
4
  */
package/MetaArgs.js CHANGED
@@ -1,20 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MetaArgs = void 0;
4
- const MetadataStorage_1 = require("./MetadataStorage");
1
+ import { MetadataStorage } from './MetadataStorage.js';
5
2
  /**
6
3
  * Replaced in future by MetadataStorage
7
4
  */
8
- class MetaArgs {
5
+ export class MetaArgs {
9
6
  static $() {
10
- return MetadataStorage_1.MetadataStorage.$();
7
+ return MetadataStorage.$();
11
8
  }
12
9
  static key(k) {
13
10
  return this.$().key(k);
14
11
  }
15
12
  static clear() {
16
- return MetadataStorage_1.MetadataStorage.clear();
13
+ return MetadataStorage.clear();
17
14
  }
18
15
  }
19
- exports.MetaArgs = MetaArgs;
20
16
  //# sourceMappingURL=MetaArgs.js.map
package/MetaArgs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"MetaArgs.js","sourceRoot":"","sources":["../../src/MetaArgs.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAElD;;GAEG;AACH,MAAa,QAAQ;IAGnB,MAAM,CAAC,CAAC;QACN,OAAO,iCAAe,CAAC,CAAC,EAAE,CAAC;IAC7B,CAAC;IAGD,MAAM,CAAC,GAAG,CAAC,CAAS;QAClB,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAGD,MAAM,CAAC,KAAK;QACV,OAAO,iCAAe,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;CAGF;AAlBD,4BAkBC"}
1
+ {"version":3,"file":"MetaArgs.js","sourceRoot":"","sources":["../../src/MetaArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,QAAQ;IAGnB,MAAM,CAAC,CAAC;QACN,OAAO,eAAe,CAAC,CAAC,EAAE,CAAC;IAC7B,CAAC;IAGD,MAAM,CAAC,GAAG,CAAC,CAAS;QAClB,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAGD,MAAM,CAAC,KAAK;QACV,OAAO,eAAe,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;CAGF"}
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MetadataStorage = void 0;
4
- const lodash_1 = require("lodash");
5
- class MetadataStorage {
1
+ import { has } from './generics.js';
2
+ export class MetadataStorage {
6
3
  static $() {
7
4
  if (!this.$self) {
8
5
  this.$self = new MetadataStorage();
@@ -22,25 +19,24 @@ class MetadataStorage {
22
19
  * @param initial
23
20
  */
24
21
  key(key, initial = []) {
25
- if (!(0, lodash_1.has)(this, key)) {
22
+ if (!has(this, key)) {
26
23
  this[key] = initial;
27
24
  }
28
25
  return this[key];
29
26
  }
30
27
  has(path) {
31
- return (0, lodash_1.has)(this, path);
28
+ return has(this, path);
32
29
  }
33
30
  get(key) {
34
- if ((0, lodash_1.has)(this, key)) {
31
+ if (has(this, key)) {
35
32
  return this[key];
36
33
  }
37
34
  return undefined;
38
35
  }
39
36
  remove(key) {
40
- if ((0, lodash_1.has)(this, key)) {
37
+ if (has(this, key)) {
41
38
  delete this[key];
42
39
  }
43
40
  }
44
41
  }
45
- exports.MetadataStorage = MetadataStorage;
46
42
  //# sourceMappingURL=MetadataStorage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MetadataStorage.js","sourceRoot":"","sources":["../../src/MetadataStorage.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAG3B,MAAa,eAAe;IAS1B,MAAM,CAAC,CAAC;QACN,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAGD,MAAM,CAAC,GAAG,CAAC,CAAS;QAClB,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAGD,MAAM,CAAC,KAAK;QACV,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,GAAW,EAAE,UAAe,EAAE;QAChC,IAAI,CAAC,IAAA,YAAG,EAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IAGD,GAAG,CAAC,IAAY;QACd,OAAO,IAAA,YAAG,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACzB,CAAC;IAGD,GAAG,CAAC,GAAW;QACb,IAAI,IAAA,YAAG,EAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAGD,MAAM,CAAC,GAAW;QAChB,IAAI,IAAA,YAAG,EAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;CAEF;AA3DD,0CA2DC"}
1
+ {"version":3,"file":"MetadataStorage.js","sourceRoot":"","sources":["../../src/MetadataStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAGlC,MAAM,OAAO,eAAe;IAS1B,MAAM,CAAC,CAAC;QACN,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAGD,MAAM,CAAC,GAAG,CAAC,CAAS;QAClB,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAGD,MAAM,CAAC,KAAK;QACV,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,GAAW,EAAE,OAAO,GAAQ,EAAE;QAChC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IAGD,GAAG,CAAC,IAAY;QACd,OAAO,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACzB,CAAC;IAGD,GAAG,CAAC,GAAW;QACb,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAGD,MAAM,CAAC,GAAW;QAChB,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;CAEF"}
package/README.md CHANGED
@@ -4,3 +4,74 @@
4
4
  [![Build Status](https://travis-ci.org/allgemein-node/base.svg?branch=master)](https://travis-ci.org/allgemein-node/base)
5
5
  [![codecov](https://codecov.io/gh/allgemein-node/base/branch/master/graph/badge.svg)](https://codecov.io/gh/allgemein-node/base)
6
6
  [![Dependency Status](https://david-dm.org/allgemein-node/base.svg)](https://david-dm.org/allgemein-node/base)
7
+
8
+ `@allgemein/base` is a collection of common, framework-agnostic building blocks
9
+ used across the `@allgemein` node packages. It bundles a set of lodash-like
10
+ generic helper functions, filesystem/platform utilities, class loading &
11
+ reflection helpers, exception classes and simple async locking primitives, so
12
+ that other modules don't have to reimplement them.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ npm i @allgemein/base
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ### Generic helpers
23
+
24
+ ```ts
25
+ import {get, set, merge, isString, cloneDeep} from '@allgemein/base';
26
+
27
+ const obj = {a: {b: 1}};
28
+ const value = get(obj, 'a.b'); // => 1
29
+ set(obj, 'a.c', 2);
30
+ const merged = merge({}, obj, {a: {d: 3}});
31
+ ```
32
+
33
+ ### Class loading
34
+
35
+ ```ts
36
+ import {ClassLoader, PlatformUtils} from '@allgemein/base';
37
+
38
+ const classes = ClassLoader.importClassesFromDirectories([
39
+ PlatformUtils.pathResolve('./lib/**/*.ts')
40
+ ]);
41
+ ```
42
+
43
+ ### Exceptions
44
+
45
+ ```ts
46
+ import {NestedException, NotYetImplementedError} from '@allgemein/base';
47
+
48
+ try {
49
+ throw new Error('root cause');
50
+ } catch (err) {
51
+ throw new NestedException(err as Error, 'MY_ERROR_CODE');
52
+ }
53
+ ```
54
+
55
+ ### Locking
56
+
57
+ ```ts
58
+ import {LockFactory} from '@allgemein/base';
59
+
60
+ const semaphore = LockFactory.$().semaphore(1);
61
+ await semaphore.acquire();
62
+ try {
63
+ // critical section
64
+ } finally {
65
+ semaphore.release();
66
+ }
67
+ ```
68
+
69
+ ## Features
70
+
71
+ * Typescript support
72
+ * Generic, lodash-like utility functions (`get`, `set`, `merge`, `cloneDeep`, `isEqual`, ...)
73
+ * `ClassLoader` / `ClassUtils` for dynamically loading and identifying classes
74
+ * `PlatformUtils` / `FileUtils` / `Glob` for filesystem and platform-specific operations
75
+ * Common exception classes (`NestedException`, `NotSupportedError`, `NotYetImplementedError`, `TodoException`)
76
+ * `LockFactory` / `Semaphore` for simple async locking
77
+ * `Interpolation` and `TreeUtils` for working with nested object structures
package/browser.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { JsonUtils, TreeUtils, WalkValues, ArrayUtils, CryptUtils, ClassUtils, NotSupportedError, NotYetImplementedError, TodoException, NestedException, MetaArgs, StringOrFunction, ISO8601, __SOURCE__, C_DEFAULT, MetadataStorage, Semaphore, LockFactory, Serializer, IMergeChange, isPromiseLike, Interpolation, FuntionWithProps, __MODULNAME__, __CLASS__ } from './shared';
2
- export { PlatformUtils } from './utils/PlatformUtilsBrowser';
1
+ export * from './shared.js';
2
+ export { PlatformUtils } from './utils/PlatformUtilsBrowser.js';
package/browser.js CHANGED
@@ -1,28 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformUtils = exports.__CLASS__ = exports.__MODULNAME__ = exports.Interpolation = exports.isPromiseLike = exports.Serializer = exports.LockFactory = exports.Semaphore = exports.MetadataStorage = exports.C_DEFAULT = exports.__SOURCE__ = exports.ISO8601 = exports.MetaArgs = exports.NestedException = exports.TodoException = exports.NotYetImplementedError = exports.NotSupportedError = exports.ClassUtils = exports.CryptUtils = exports.ArrayUtils = exports.TreeUtils = exports.JsonUtils = void 0;
4
- var shared_1 = require("./shared");
5
- Object.defineProperty(exports, "JsonUtils", { enumerable: true, get: function () { return shared_1.JsonUtils; } });
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; } });
8
- Object.defineProperty(exports, "CryptUtils", { enumerable: true, get: function () { return shared_1.CryptUtils; } });
9
- Object.defineProperty(exports, "ClassUtils", { enumerable: true, get: function () { return shared_1.ClassUtils; } });
10
- Object.defineProperty(exports, "NotSupportedError", { enumerable: true, get: function () { return shared_1.NotSupportedError; } });
11
- Object.defineProperty(exports, "NotYetImplementedError", { enumerable: true, get: function () { return shared_1.NotYetImplementedError; } });
12
- Object.defineProperty(exports, "TodoException", { enumerable: true, get: function () { return shared_1.TodoException; } });
13
- Object.defineProperty(exports, "NestedException", { enumerable: true, get: function () { return shared_1.NestedException; } });
14
- Object.defineProperty(exports, "MetaArgs", { enumerable: true, get: function () { return shared_1.MetaArgs; } });
15
- Object.defineProperty(exports, "ISO8601", { enumerable: true, get: function () { return shared_1.ISO8601; } });
16
- Object.defineProperty(exports, "__SOURCE__", { enumerable: true, get: function () { return shared_1.__SOURCE__; } });
17
- Object.defineProperty(exports, "C_DEFAULT", { enumerable: true, get: function () { return shared_1.C_DEFAULT; } });
18
- Object.defineProperty(exports, "MetadataStorage", { enumerable: true, get: function () { return shared_1.MetadataStorage; } });
19
- Object.defineProperty(exports, "Semaphore", { enumerable: true, get: function () { return shared_1.Semaphore; } });
20
- Object.defineProperty(exports, "LockFactory", { enumerable: true, get: function () { return shared_1.LockFactory; } });
21
- Object.defineProperty(exports, "Serializer", { enumerable: true, get: function () { return shared_1.Serializer; } });
22
- Object.defineProperty(exports, "isPromiseLike", { enumerable: true, get: function () { return shared_1.isPromiseLike; } });
23
- Object.defineProperty(exports, "Interpolation", { enumerable: true, get: function () { return shared_1.Interpolation; } });
24
- Object.defineProperty(exports, "__MODULNAME__", { enumerable: true, get: function () { return shared_1.__MODULNAME__; } });
25
- Object.defineProperty(exports, "__CLASS__", { enumerable: true, get: function () { return shared_1.__CLASS__; } });
26
- var PlatformUtilsBrowser_1 = require("./utils/PlatformUtilsBrowser");
27
- Object.defineProperty(exports, "PlatformUtils", { enumerable: true, get: function () { return PlatformUtilsBrowser_1.PlatformUtils; } });
1
+ export * from './shared.js';
2
+ export { PlatformUtils } from './utils/PlatformUtilsBrowser.js';
28
3
  //# sourceMappingURL=browser.js.map
package/browser.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":";;;AAAA,mCA0BkB;AAzBhB,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,kGAAA,QAAQ,OAAA;AAER,iGAAA,OAAO,OAAA;AACP,oGAAA,UAAU,OAAA;AACV,mGAAA,SAAS,OAAA;AACT,yGAAA,eAAe,OAAA;AACf,mGAAA,SAAS,OAAA;AACT,qGAAA,WAAW,OAAA;AACX,oGAAA,UAAU,OAAA;AAEV,uGAAA,aAAa,OAAA;AACb,uGAAA,aAAa,OAAA;AAEb,uGAAA,aAAa,OAAA;AACb,mGAAA,SAAS,OAAA;AAEX,qEAA2D;AAAnD,qHAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC"}
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NestedException = void 0;
4
- class NestedException extends Error {
1
+ export class NestedException extends Error {
5
2
  constructor(err, code) {
6
3
  super();
7
4
  this._error = err;
@@ -26,5 +23,4 @@ class NestedException extends Error {
26
23
  return [this.name, this.message].join(': ');
27
24
  }
28
25
  }
29
- exports.NestedException = NestedException;
30
26
  //# sourceMappingURL=NestedException.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NestedException.js","sourceRoot":"","sources":["../../../src/exceptions/NestedException.ts"],"names":[],"mappings":";;;AAEA,MAAa,eAAgB,SAAQ,KAAK;IAMtC,YAAY,GAAU,EAAE,IAAW;QAC/B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IACrB,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;IAC3B,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAA;IACrB,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAA;IAC1B,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAA;IAC7B,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,MAAM,CAAA;IACtB,CAAC;IAED,QAAQ;QACJ,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/C,CAAC;CAEJ;AApCD,0CAoCC"}
1
+ {"version":3,"file":"NestedException.js","sourceRoot":"","sources":["../../../src/exceptions/NestedException.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAMxC,YAAY,GAAU,EAAE,IAAY;QAClC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAC5B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;CAEF"}
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotSupportedError = void 0;
4
- class NotSupportedError extends Error {
1
+ export class NotSupportedError extends Error {
5
2
  constructor(msg) {
6
3
  super(msg);
7
4
  }
8
5
  }
9
- exports.NotSupportedError = NotSupportedError;
10
6
  //# sourceMappingURL=NotSupportedError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotSupportedError.js","sourceRoot":"","sources":["../../../src/exceptions/NotSupportedError.ts"],"names":[],"mappings":";;;AAEA,MAAa,iBAAkB,SAAQ,KAAK;IAE1C,YAAY,GAAU;QACpB,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;CACF;AALD,8CAKC"}
1
+ {"version":3,"file":"NotSupportedError.js","sourceRoot":"","sources":["../../../src/exceptions/NotSupportedError.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAE1C,YAAY,GAAW;QACrB,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;CACF"}
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotYetImplementedError = void 0;
4
- class NotYetImplementedError extends Error {
5
- constructor(msg = "please make an issue ...") {
1
+ export class NotYetImplementedError extends Error {
2
+ constructor(msg = 'please make an issue ...') {
6
3
  super('Not yet implemented. Planned or forgotten ;) ' + msg);
7
4
  }
8
5
  }
9
- exports.NotYetImplementedError = NotYetImplementedError;
10
6
  //# sourceMappingURL=NotYetImplementedError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotYetImplementedError.js","sourceRoot":"","sources":["../../../src/exceptions/NotYetImplementedError.ts"],"names":[],"mappings":";;;AAAA,MAAa,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,MAAa,0BAA0B;QACjD,KAAK,CAAC,+CAA+C,GAAC,GAAG,CAAC,CAAC;IAC7D,CAAC;CACF;AAJD,wDAIC"}
1
+ {"version":3,"file":"NotYetImplementedError.js","sourceRoot":"","sources":["../../../src/exceptions/NotYetImplementedError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,GAAG,GAAW,0BAA0B;QAClD,KAAK,CAAC,+CAA+C,GAAC,GAAG,CAAC,CAAC;IAC7D,CAAC;CACF"}
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TodoException = void 0;
4
- class TodoException extends Error {
1
+ export class TodoException extends Error {
5
2
  constructor(msg = 'TODO EXCEPTION') {
6
3
  super(msg);
7
4
  }
8
5
  }
9
- exports.TodoException = TodoException;
10
6
  //# sourceMappingURL=TodoException.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TodoException.js","sourceRoot":"","sources":["../../../src/exceptions/TodoException.ts"],"names":[],"mappings":";;;AACA,MAAa,aAAc,SAAQ,KAAK;IACpC,YAAY,MAAa,gBAAgB;QACrC,KAAK,CAAC,GAAG,CAAC,CAAA;IACd,CAAC;CACJ;AAJD,sCAIC"}
1
+ {"version":3,"file":"TodoException.js","sourceRoot":"","sources":["../../../src/exceptions/TodoException.ts"],"names":[],"mappings":"AACA,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,GAAG,GAAW,gBAAgB;QACxC,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;CACF"}
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isPromiseLike = isPromiseLike;
4
- function isPromiseLike(obj) {
1
+ export function isPromiseLike(obj) {
5
2
  return (obj !== null) &&
6
3
  ((typeof obj === 'object' || typeof obj === 'function') &&
7
4
  typeof obj.then === 'function');
@@ -1 +1 @@
1
- {"version":3,"file":"isPromiseLike.js","sourceRoot":"","sources":["../../../src/fns/isPromiseLike.ts"],"names":[],"mappings":";;AAAA,sCAIC;AAJD,SAAgB,aAAa,CAAC,GAAQ;IACpC,OAAO,CAAC,GAAG,KAAK,IAAI,CAAC;QACnB,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,UAAU,CAAC;YACrD,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"isPromiseLike.js","sourceRoot":"","sources":["../../../src/fns/isPromiseLike.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,GAAQ;IACpC,OAAO,CAAC,GAAG,KAAK,IAAI,CAAC;QACnB,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,UAAU,CAAC;YACrD,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;AACtC,CAAC"}
package/generics.d.ts ADDED
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Generic utility functions replacing lodash.
3
+ *
4
+ * The implementations follow lodash 4.17.21 semantics (iteratee shorthands,
5
+ * path handling, SameValueZero comparisons, clone/merge rules, unicode aware
6
+ * string casing), without depending on lodash itself.
7
+ */
8
+ export declare function upperFirst(string?: any): string;
9
+ export declare function isArray(value?: any): value is any[];
10
+ export declare function isNull(value?: any): value is null;
11
+ export declare function isObject(value?: any): value is Record<string | number | symbol, any>;
12
+ export declare function isObjectLike(value?: any): value is Record<string | number | symbol, any>;
13
+ export declare function isBoolean(value?: any): value is boolean;
14
+ export declare function isDate(value?: any): value is Date;
15
+ export declare function isFunction(value?: any): value is (...args: any[]) => any;
16
+ export declare function isNumber(value?: any): value is number;
17
+ export declare function isPlainObject(value?: any): boolean;
18
+ export declare function isRegExp(value?: any): value is RegExp;
19
+ export declare function isSet(value?: any): value is Set<any>;
20
+ export declare function isString(value?: any): value is string;
21
+ export declare function isUndefined(value?: any): value is undefined;
22
+ export declare function isEmpty(value?: any): boolean;
23
+ export declare function isEqual(value?: any, other?: any): boolean;
24
+ export declare function first<T = any>(array?: ArrayLike<T> | null): T | undefined;
25
+ export declare const head: typeof first;
26
+ export declare function last<T = any>(array?: ArrayLike<T> | null): T | undefined;
27
+ export declare function concat<T = any>(array?: T[] | T | null, ...values: any[]): any[];
28
+ export declare function filter<T>(collection: T[] | Record<string, T> | null | undefined, predicate: (item: T, indexOrKey: any, coll: any) => boolean): T[];
29
+ export declare function filter<T>(collection: T[] | Record<string, T> | null | undefined, predicate?: any): T[];
30
+ export declare function find<T>(collection: T[] | Record<string, T> | null | undefined, predicate: (item: T, indexOrKey: any, coll: any) => boolean, fromIndex?: number): T | undefined;
31
+ export declare function find<T>(collection: T[] | Record<string, T> | null | undefined, predicate?: any, fromIndex?: number): T | undefined;
32
+ export declare function findIndex<T>(array: ArrayLike<T> | null | undefined, predicate: (item: T, index: number, arr: any) => boolean, fromIndex?: number): number;
33
+ export declare function findIndex<T>(array: ArrayLike<T> | null | undefined, predicate?: any, fromIndex?: number): number;
34
+ export declare function map<T, R>(collection: T[], iteratee: (item: T, index: number, coll: T[]) => R): R[];
35
+ export declare function map<T, R>(collection: Record<string, T>, iteratee: (item: T, key: string, coll: Record<string, T>) => R): R[];
36
+ export declare function map<T = any, R = any>(collection: any, iteratee?: ((item: T, indexOrKey: any, coll: any) => R) | string): R[];
37
+ export declare function remove<T>(array: T[] | null | undefined, predicate: (value: T, index: number, array: T[]) => boolean): T[];
38
+ export declare function remove<T>(array: T[] | null | undefined, predicate?: any): T[];
39
+ export declare function uniq<T = any>(array?: ArrayLike<T> | null): T[];
40
+ export declare function uniqBy<T>(array: T[] | null | undefined, iteratee: (item: T) => any): T[];
41
+ export declare function uniqBy<T>(array: T[] | null | undefined, iteratee?: string | any): T[];
42
+ export declare function intersection<T = any>(...arrays: (ArrayLike<T> | null | undefined)[]): T[];
43
+ export declare function orderBy<T>(collection: T[] | Record<string, T> | null | undefined, iteratees?: ((item: T) => any) | string | (((item: T) => any) | string | string[])[], orders?: ('asc' | 'desc' | boolean)[] | ('asc' | 'desc' | boolean)): T[];
44
+ export declare function keys(object?: any): string[];
45
+ export declare function values<T = any>(object?: any): T[];
46
+ export declare function assign<T extends object = any>(target?: any, ...sources: any[]): T & any;
47
+ export declare function clone<T = any>(value?: any): T;
48
+ export declare function cloneDeep<T = any>(value?: any): T;
49
+ export declare function defaults<T extends object = any>(object?: any, ...sources: any[]): T;
50
+ export declare function defaultsDeep<T extends object = any>(object?: any, ...sources: any[]): T;
51
+ export declare function merge<T extends object = any>(target?: any, ...sources: any[]): T;
52
+ export declare function mergeWith<T extends object = any>(target?: any, ...args: any[]): T;
53
+ export declare function get(object?: any, path?: any, defaultValue?: any): any;
54
+ export declare function set(object?: any, path?: any, value?: any): any;
55
+ export declare function has(object?: any, path?: any): boolean;
56
+ export declare function unset(object?: any, path?: any): boolean;
57
+ export declare const camelCase: (string?: any) => string;
58
+ export declare const kebabCase: (string?: any) => string;
59
+ export declare const snakeCase: (string?: any) => string;
60
+ export declare function capitalize(string?: any): string;