@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.
- package/Constants.d.ts +2 -2
- package/Constants.js +5 -8
- package/Constants.js.map +1 -1
- package/MetaArgs.d.ts +1 -1
- package/MetaArgs.js +4 -8
- package/MetaArgs.js.map +1 -1
- package/MetadataStorage.js +6 -10
- package/MetadataStorage.js.map +1 -1
- package/README.md +71 -0
- package/browser.d.ts +2 -2
- package/browser.js +2 -27
- package/browser.js.map +1 -1
- package/exceptions/NestedException.js +1 -5
- package/exceptions/NestedException.js.map +1 -1
- package/exceptions/NotSupportedError.js +1 -5
- package/exceptions/NotSupportedError.js.map +1 -1
- package/exceptions/NotYetImplementedError.js +2 -6
- package/exceptions/NotYetImplementedError.js.map +1 -1
- package/exceptions/TodoException.js +1 -5
- package/exceptions/TodoException.js.map +1 -1
- package/fns/isPromiseLike.js +1 -4
- package/fns/isPromiseLike.js.map +1 -1
- package/generics.d.ts +60 -0
- package/generics.js +1465 -0
- package/generics.js.map +1 -0
- package/index.d.ts +5 -5
- package/index.js +5 -26
- package/index.js.map +1 -1
- package/locking/LockFactory.d.ts +1 -1
- package/locking/LockFactory.js +8 -12
- package/locking/LockFactory.js.map +1 -1
- package/locking/Semaphore.js +2 -7
- package/locking/Semaphore.js.map +1 -1
- package/package.json +2 -2
- package/shared.d.ts +18 -17
- package/shared.js +18 -41
- package/shared.js.map +1 -1
- package/utils/ArrayUtils.js +22 -26
- package/utils/ArrayUtils.js.map +1 -1
- package/utils/ClassLoader.d.ts +5 -5
- package/utils/ClassLoader.js +41 -46
- package/utils/ClassLoader.js.map +1 -1
- package/utils/ClassUtils.d.ts +2 -2
- package/utils/ClassUtils.js +11 -15
- package/utils/ClassUtils.js.map +1 -1
- package/utils/CryptUtils.js +1 -5
- package/utils/CryptUtils.js.map +1 -1
- package/utils/FileUtils.js +12 -16
- package/utils/FileUtils.js.map +1 -1
- package/utils/Glob.js +6 -10
- package/utils/Glob.js.map +1 -1
- package/utils/Interpolation.js +5 -10
- package/utils/Interpolation.js.map +1 -1
- package/utils/JsonUtils.js +8 -12
- package/utils/JsonUtils.js.map +1 -1
- package/utils/PlatformUtils.d.ts +2 -1
- package/utils/PlatformUtils.js +58 -65
- package/utils/PlatformUtils.js.map +1 -1
- package/utils/PlatformUtilsBrowser.js +27 -31
- package/utils/PlatformUtilsBrowser.js.map +1 -1
- package/utils/Serializer.js +23 -27
- package/utils/Serializer.js.map +1 -1
- package/utils/TreeUtils.js +9 -13
- 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
|
|
4
|
+
export type FunctionWithProps = (Function & {
|
|
5
5
|
[__SOURCE__]?: string;
|
|
6
6
|
[__CLASS__]?: string;
|
|
7
7
|
[__MODULNAME__]?: string;
|
|
8
8
|
});
|
|
9
|
-
export type StringOrFunction = string |
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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":"
|
|
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
package/MetaArgs.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
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
|
|
7
|
+
return MetadataStorage.$();
|
|
11
8
|
}
|
|
12
9
|
static key(k) {
|
|
13
10
|
return this.$().key(k);
|
|
14
11
|
}
|
|
15
12
|
static clear() {
|
|
16
|
-
return
|
|
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":"
|
|
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"}
|
package/MetadataStorage.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 (!
|
|
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
|
|
28
|
+
return has(this, path);
|
|
32
29
|
}
|
|
33
30
|
get(key) {
|
|
34
|
-
if (
|
|
31
|
+
if (has(this, key)) {
|
|
35
32
|
return this[key];
|
|
36
33
|
}
|
|
37
34
|
return undefined;
|
|
38
35
|
}
|
|
39
36
|
remove(key) {
|
|
40
|
-
if (
|
|
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
|
package/MetadataStorage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetadataStorage.js","sourceRoot":"","sources":["../../src/MetadataStorage.ts"],"names":[],"mappings":"
|
|
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
|
[](https://travis-ci.org/allgemein-node/base)
|
|
5
5
|
[](https://codecov.io/gh/allgemein-node/base)
|
|
6
6
|
[](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
|
|
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
|
-
|
|
2
|
-
|
|
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":"
|
|
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
|
-
|
|
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":"
|
|
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
|
-
|
|
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":"
|
|
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
|
-
|
|
2
|
-
|
|
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":"
|
|
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
|
-
|
|
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":"
|
|
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"}
|
package/fns/isPromiseLike.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
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');
|
package/fns/isPromiseLike.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPromiseLike.js","sourceRoot":"","sources":["../../../src/fns/isPromiseLike.ts"],"names":[],"mappings":"
|
|
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;
|