kiss-for-react 1.0.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +699 -156
- package/lib/cjs/ClassPersistor.js +177 -112
- package/lib/cjs/Esserializer/DeserializationOptions.js +4 -4
- package/lib/cjs/Esserializer/SerializeOptions.js +4 -4
- package/lib/cjs/Esserializer/builtins.js +258 -0
- package/lib/cjs/Esserializer/constant.js +39 -131
- package/lib/cjs/Esserializer/deserializer.js +226 -313
- package/lib/cjs/Esserializer/general.js +91 -39
- package/lib/cjs/Esserializer/index.js +47 -43
- package/lib/cjs/Esserializer/serializer.js +168 -133
- package/lib/cjs/Evt.js +132 -0
- package/lib/cjs/Hooks.js +1472 -969
- package/lib/cjs/KissAction.js +4635 -1333
- package/lib/cjs/LoadPages.js +336 -0
- package/lib/cjs/Persistor.js +189 -120
- package/lib/cjs/ProcessPersistence.js +579 -262
- package/lib/cjs/Store.js +4278 -1534
- package/lib/cjs/StoreException.js +162 -75
- package/lib/cjs/StoreProvider.js +88 -0
- package/lib/cjs/UserException.js +212 -218
- package/lib/cjs/Wait.js +309 -309
- package/lib/cjs/index.js +69 -42
- package/lib/cjs/server.js +54 -0
- package/lib/cjs/types/ClassPersistor.d.ts +143 -112
- package/lib/cjs/types/ClassPersistor.d.ts.map +1 -1
- package/lib/cjs/types/Esserializer/DeserializationOptions.d.ts +13 -6
- package/lib/cjs/types/Esserializer/DeserializationOptions.d.ts.map +1 -1
- package/lib/cjs/types/Esserializer/SerializeOptions.d.ts +11 -5
- package/lib/cjs/types/Esserializer/SerializeOptions.d.ts.map +1 -1
- package/lib/cjs/types/Esserializer/builtins.d.ts +36 -0
- package/lib/cjs/types/Esserializer/builtins.d.ts.map +1 -0
- package/lib/cjs/types/Esserializer/constant.d.ts +25 -49
- package/lib/cjs/types/Esserializer/constant.d.ts.map +1 -1
- package/lib/cjs/types/Esserializer/deserializer.d.ts +27 -17
- package/lib/cjs/types/Esserializer/deserializer.d.ts.map +1 -1
- package/lib/cjs/types/Esserializer/general.d.ts +28 -4
- package/lib/cjs/types/Esserializer/general.d.ts.map +1 -1
- package/lib/cjs/types/Esserializer/index.d.ts +33 -29
- package/lib/cjs/types/Esserializer/index.d.ts.map +1 -1
- package/lib/cjs/types/Esserializer/serializer.d.ts +14 -3
- package/lib/cjs/types/Esserializer/serializer.d.ts.map +1 -1
- package/lib/cjs/types/Evt.d.ts +124 -0
- package/lib/cjs/types/Evt.d.ts.map +1 -0
- package/lib/cjs/types/Hooks.d.ts +1174 -837
- package/lib/cjs/types/Hooks.d.ts.map +1 -1
- package/lib/cjs/types/KissAction.d.ts +5199 -1398
- package/lib/cjs/types/KissAction.d.ts.map +1 -1
- package/lib/cjs/types/LoadPages.d.ts +287 -0
- package/lib/cjs/types/LoadPages.d.ts.map +1 -0
- package/lib/cjs/types/Persistor.d.ts +187 -118
- package/lib/cjs/types/Persistor.d.ts.map +1 -1
- package/lib/cjs/types/ProcessPersistence.d.ts +197 -99
- package/lib/cjs/types/ProcessPersistence.d.ts.map +1 -1
- package/lib/cjs/types/Store.d.ts +2253 -1042
- package/lib/cjs/types/Store.d.ts.map +1 -1
- package/lib/cjs/types/StoreException.d.ts +97 -28
- package/lib/cjs/types/StoreException.d.ts.map +1 -1
- package/lib/cjs/types/StoreProvider.d.ts +80 -0
- package/lib/cjs/types/StoreProvider.d.ts.map +1 -0
- package/lib/cjs/types/UserException.d.ts +178 -169
- package/lib/cjs/types/UserException.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +12 -9
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/server.d.ts +12 -0
- package/lib/cjs/types/server.d.ts.map +1 -0
- package/lib/cjs/types/utils.d.ts +15 -1
- package/lib/cjs/types/utils.d.ts.map +1 -1
- package/lib/cjs/utils.js +45 -7
- package/lib/esm/ClassPersistor.mjs +177 -0
- package/lib/esm/Esserializer/{DeserializationOptions.js → DeserializationOptions.mjs} +3 -3
- package/lib/esm/Esserializer/{SerializeOptions.js → SerializeOptions.mjs} +3 -3
- package/lib/esm/Esserializer/builtins.mjs +254 -0
- package/lib/esm/Esserializer/constant.mjs +28 -0
- package/lib/esm/Esserializer/deserializer.mjs +221 -0
- package/lib/esm/Esserializer/general.mjs +81 -0
- package/lib/esm/Esserializer/index.mjs +43 -0
- package/lib/esm/Esserializer/serializer.mjs +164 -0
- package/lib/esm/Evt.mjs +151 -0
- package/lib/esm/Hooks.mjs +1446 -0
- package/lib/esm/KissAction.mjs +4689 -0
- package/lib/esm/LoadPages.mjs +340 -0
- package/lib/esm/Persistor.mjs +180 -0
- package/lib/esm/ProcessPersistence.mjs +581 -0
- package/lib/esm/Store.mjs +4400 -0
- package/lib/esm/StoreException.mjs +153 -0
- package/lib/esm/StoreProvider.mjs +80 -0
- package/lib/esm/{UserException.js → UserException.mjs} +240 -246
- package/lib/esm/{Wait.js → Wait.mjs} +309 -309
- package/lib/esm/index.mjs +12 -9
- package/lib/esm/server.mjs +23 -0
- package/lib/esm/types/ClassPersistor.d.ts +143 -112
- package/lib/esm/types/ClassPersistor.d.ts.map +1 -1
- package/lib/esm/types/Esserializer/DeserializationOptions.d.ts +13 -6
- package/lib/esm/types/Esserializer/DeserializationOptions.d.ts.map +1 -1
- package/lib/esm/types/Esserializer/SerializeOptions.d.ts +11 -5
- package/lib/esm/types/Esserializer/SerializeOptions.d.ts.map +1 -1
- package/lib/esm/types/Esserializer/builtins.d.ts +36 -0
- package/lib/esm/types/Esserializer/builtins.d.ts.map +1 -0
- package/lib/esm/types/Esserializer/constant.d.ts +25 -49
- package/lib/esm/types/Esserializer/constant.d.ts.map +1 -1
- package/lib/esm/types/Esserializer/deserializer.d.ts +27 -17
- package/lib/esm/types/Esserializer/deserializer.d.ts.map +1 -1
- package/lib/esm/types/Esserializer/general.d.ts +28 -4
- package/lib/esm/types/Esserializer/general.d.ts.map +1 -1
- package/lib/esm/types/Esserializer/index.d.ts +33 -29
- package/lib/esm/types/Esserializer/index.d.ts.map +1 -1
- package/lib/esm/types/Esserializer/serializer.d.ts +14 -3
- package/lib/esm/types/Esserializer/serializer.d.ts.map +1 -1
- package/lib/esm/types/Evt.d.ts +124 -0
- package/lib/esm/types/Evt.d.ts.map +1 -0
- package/lib/esm/types/Hooks.d.ts +1174 -837
- package/lib/esm/types/Hooks.d.ts.map +1 -1
- package/lib/esm/types/KissAction.d.ts +5199 -1398
- package/lib/esm/types/KissAction.d.ts.map +1 -1
- package/lib/esm/types/LoadPages.d.ts +287 -0
- package/lib/esm/types/LoadPages.d.ts.map +1 -0
- package/lib/esm/types/Persistor.d.ts +187 -118
- package/lib/esm/types/Persistor.d.ts.map +1 -1
- package/lib/esm/types/ProcessPersistence.d.ts +197 -99
- package/lib/esm/types/ProcessPersistence.d.ts.map +1 -1
- package/lib/esm/types/Store.d.ts +2253 -1042
- package/lib/esm/types/Store.d.ts.map +1 -1
- package/lib/esm/types/StoreException.d.ts +97 -28
- package/lib/esm/types/StoreException.d.ts.map +1 -1
- package/lib/esm/types/StoreProvider.d.ts +80 -0
- package/lib/esm/types/StoreProvider.d.ts.map +1 -0
- package/lib/esm/types/UserException.d.ts +178 -169
- package/lib/esm/types/UserException.d.ts.map +1 -1
- package/lib/esm/types/index.d.ts +12 -9
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/server.d.ts +12 -0
- package/lib/esm/types/server.d.ts.map +1 -0
- package/lib/esm/types/utils.d.ts +15 -1
- package/lib/esm/types/utils.d.ts.map +1 -1
- package/lib/esm/utils.mjs +38 -0
- package/package.json +55 -31
- package/lib/cjs/UnmodifiableSetView.js +0 -53
- package/lib/cjs/types/UnmodifiableSetView.d.ts +0 -24
- package/lib/cjs/types/UnmodifiableSetView.d.ts.map +0 -1
- package/lib/esm/ClassPersistor.js +0 -112
- package/lib/esm/Esserializer/constant.js +0 -81
- package/lib/esm/Esserializer/deserializer.js +0 -307
- package/lib/esm/Esserializer/general.js +0 -34
- package/lib/esm/Esserializer/index.js +0 -39
- package/lib/esm/Esserializer/serializer.js +0 -130
- package/lib/esm/Hooks.js +0 -955
- package/lib/esm/KissAction.js +0 -1459
- package/lib/esm/Persistor.js +0 -113
- package/lib/esm/ProcessPersistence.js +0 -262
- package/lib/esm/Store.js +0 -1606
- package/lib/esm/StoreException.js +0 -69
- package/lib/esm/UnmodifiableSetView.js +0 -50
- package/lib/esm/types/UnmodifiableSetView.d.ts +0 -24
- package/lib/esm/types/UnmodifiableSetView.d.ts.map +0 -1
- package/lib/esm/utils.js +0 -3
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
All exceptions thrown by Kiss are of type StoreException.
|
|
3
|
-
*/
|
|
4
|
-
export class StoreException extends Error {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'StoreException';
|
|
8
|
-
// Maintains proper stack trace for where our error was thrown (only available on V8).
|
|
9
|
-
if (Error.captureStackTrace) {
|
|
10
|
-
Error.captureStackTrace(this, StoreException);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export class TimeoutException extends Error {
|
|
15
|
-
/**
|
|
16
|
-
* The global default timeout for the wait functions (like `waitCondition` etc.) is 10 minutes.
|
|
17
|
-
* This value is not final and can be modified.
|
|
18
|
-
* To disable the timeout, modify this to a large value, like 300000000000 (almost 10 years).
|
|
19
|
-
*/
|
|
20
|
-
static defaultTimeoutMillis = 60 * 1000 * 10;
|
|
21
|
-
constructor(message) {
|
|
22
|
-
super(message);
|
|
23
|
-
this.name = 'TimeoutException';
|
|
24
|
-
// Maintains proper stack trace for where our error was thrown (only available on V8).
|
|
25
|
-
if (Error.captureStackTrace) {
|
|
26
|
-
Error.captureStackTrace(this, StoreException);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export class ExceptionUtils {
|
|
31
|
-
/**
|
|
32
|
-
Cuts the stack trace at the given string, to avoid showing internal Kiss lines,
|
|
33
|
-
which are not interesting to the user.
|
|
34
|
-
|
|
35
|
-
IMPORTANT: This should only be called during development. V8 only computes it if someone
|
|
36
|
-
actually reads the property, which improves performance dramatically for handable errors.
|
|
37
|
-
When you use this, you'll pay the cost even if your caller doesn't need the stack.
|
|
38
|
-
|
|
39
|
-
The given text will be found at the start of the line, like this: ` at ${text} `
|
|
40
|
-
*/
|
|
41
|
-
static sanitizedStackTrace(error, text) {
|
|
42
|
-
const stack = error.stack;
|
|
43
|
-
if (stack === undefined)
|
|
44
|
-
return error;
|
|
45
|
-
const stackLines = stack.split('\n');
|
|
46
|
-
let newStackStartIndex = -1;
|
|
47
|
-
// Be aware that `constructor.name` cannot be used with bundlers that mangle
|
|
48
|
-
// class or function names, because the error class name in the minified code
|
|
49
|
-
// might be shortened.
|
|
50
|
-
const errorLine = ` at ${text} `;
|
|
51
|
-
// Find the index where the exception was dispatched.
|
|
52
|
-
for (let i = 0; i < stackLines.length - 1; i++) {
|
|
53
|
-
if (stackLines[i].startsWith(errorLine)) {
|
|
54
|
-
newStackStartIndex = i + 1;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if (newStackStartIndex !== -1) {
|
|
59
|
-
// Reconstruct the stack trace from the desired start point
|
|
60
|
-
// Also, include the error name and message as the first line
|
|
61
|
-
const newStack = [
|
|
62
|
-
`${error.name}: ${error.message}`,
|
|
63
|
-
...stackLines.slice(newStackStartIndex)
|
|
64
|
-
].join('\n');
|
|
65
|
-
error.stack = newStack;
|
|
66
|
-
}
|
|
67
|
-
return error;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An unmodifiable set.
|
|
3
|
-
*
|
|
4
|
-
* An [UnmodifiableSetView] contains a [Set], and prevents that set from being changed through the view.
|
|
5
|
-
* Methods that could change the set, such as [add] and [remove], throw an [UnsupportedError].
|
|
6
|
-
* Permitted operations defer to the wrapped set.
|
|
7
|
-
*/
|
|
8
|
-
export class UnmodifiableSetView {
|
|
9
|
-
_set;
|
|
10
|
-
constructor(set) {
|
|
11
|
-
this._set = set;
|
|
12
|
-
}
|
|
13
|
-
has(value) {
|
|
14
|
-
return this._set.has(value);
|
|
15
|
-
}
|
|
16
|
-
get size() {
|
|
17
|
-
return this._set.size;
|
|
18
|
-
}
|
|
19
|
-
forEach(callbackfn, thisArg) {
|
|
20
|
-
return this._set.forEach(callbackfn, thisArg);
|
|
21
|
-
}
|
|
22
|
-
[Symbol.iterator]() {
|
|
23
|
-
return this._set[Symbol.iterator]();
|
|
24
|
-
}
|
|
25
|
-
entries() {
|
|
26
|
-
return this._set.entries();
|
|
27
|
-
}
|
|
28
|
-
values() {
|
|
29
|
-
return this._set.values();
|
|
30
|
-
}
|
|
31
|
-
keys() {
|
|
32
|
-
return this._set.keys();
|
|
33
|
-
}
|
|
34
|
-
add(value) {
|
|
35
|
-
throw new Error('Cannot modify the set. Create a copy in necessary.');
|
|
36
|
-
}
|
|
37
|
-
clear() {
|
|
38
|
-
throw new Error('Cannot modify the set. Create a copy in necessary.');
|
|
39
|
-
}
|
|
40
|
-
delete(value) {
|
|
41
|
-
throw new Error('Cannot modify the set. Create a copy in necessary.');
|
|
42
|
-
}
|
|
43
|
-
get [Symbol.toStringTag]() {
|
|
44
|
-
return this._set[Symbol.toStringTag];
|
|
45
|
-
}
|
|
46
|
-
toString() {
|
|
47
|
-
return Array.from(this).toString();
|
|
48
|
-
}
|
|
49
|
-
;
|
|
50
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An unmodifiable set.
|
|
3
|
-
*
|
|
4
|
-
* An [UnmodifiableSetView] contains a [Set], and prevents that set from being changed through the view.
|
|
5
|
-
* Methods that could change the set, such as [add] and [remove], throw an [UnsupportedError].
|
|
6
|
-
* Permitted operations defer to the wrapped set.
|
|
7
|
-
*/
|
|
8
|
-
export declare class UnmodifiableSetView<T> implements Set<T> {
|
|
9
|
-
private readonly _set;
|
|
10
|
-
constructor(set: Set<T>);
|
|
11
|
-
has(value: T): boolean;
|
|
12
|
-
get size(): number;
|
|
13
|
-
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
|
|
14
|
-
[Symbol.iterator](): IterableIterator<T>;
|
|
15
|
-
entries(): IterableIterator<[T, T]>;
|
|
16
|
-
values(): IterableIterator<T>;
|
|
17
|
-
keys(): IterableIterator<T>;
|
|
18
|
-
add(value: T): this;
|
|
19
|
-
clear(): void;
|
|
20
|
-
delete(value: T): boolean;
|
|
21
|
-
get [Symbol.toStringTag](): string;
|
|
22
|
-
toString(): string;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=UnmodifiableSetView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UnmodifiableSetView.d.ts","sourceRoot":"","sources":["../../../src/UnmodifiableSetView.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qBAAa,mBAAmB,CAAC,CAAC,CAAE,YAAW,GAAG,CAAC,CAAC,CAAC;IACnD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;gBAElB,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAIvB,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO;IAItB,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAIpF,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAIxC,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAInC,MAAM,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAI7B,IAAI,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAI3B,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAInB,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO;IAIzB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IAED,QAAQ;CAGT"}
|
package/lib/esm/utils.js
DELETED