@ibyar/core 2.2.1 → 2.4.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.
Files changed (87) hide show
  1. package/annotation/options.d.ts +6 -2
  2. package/annotation/options.d.ts.map +1 -1
  3. package/annotation/options.js.map +1 -1
  4. package/binding/binding.expressions.d.ts +2 -2
  5. package/binding/binding.expressions.d.ts.map +1 -1
  6. package/binding/binding.expressions.js.map +1 -1
  7. package/component/component.d.ts +2 -1
  8. package/component/component.d.ts.map +1 -1
  9. package/component/component.js +9 -1
  10. package/component/component.js.map +1 -1
  11. package/directive/directive.d.ts +3 -2
  12. package/directive/directive.d.ts.map +1 -1
  13. package/directive/directive.js +6 -3
  14. package/directive/directive.js.map +1 -1
  15. package/html/deserialize.d.ts.map +1 -1
  16. package/html/deserialize.js +11 -2
  17. package/html/deserialize.js.map +1 -1
  18. package/html/expression.d.ts +2 -1
  19. package/html/expression.d.ts.map +1 -1
  20. package/html/expression.js +18 -6
  21. package/html/expression.js.map +1 -1
  22. package/html/types.d.ts +6 -0
  23. package/html/types.d.ts.map +1 -1
  24. package/html/types.js.map +1 -1
  25. package/package.json +8 -8
  26. package/providers/provider.d.ts +6 -2
  27. package/providers/provider.d.ts.map +1 -1
  28. package/providers/provider.js +42 -6
  29. package/providers/provider.js.map +1 -1
  30. package/view/base-view.js +1 -1
  31. package/view/base-view.js.map +1 -1
  32. package/view/form-view.d.ts.map +1 -1
  33. package/view/form-view.js +2 -1
  34. package/view/form-view.js.map +1 -1
  35. package/view/render.d.ts +2 -1
  36. package/view/render.d.ts.map +1 -1
  37. package/view/render.js +16 -6
  38. package/view/render.js.map +1 -1
  39. package/view/view.d.ts.map +1 -1
  40. package/view/view.js +12 -5
  41. package/view/view.js.map +1 -1
  42. package/zone/zone.js +1 -1
  43. package/zone/zone.js.map +1 -1
  44. package/di/token.d.ts +0 -7
  45. package/di/token.d.ts.map +0 -1
  46. package/di/token.js +0 -11
  47. package/di/token.js.map +0 -1
  48. package/di/types.d.ts +0 -1
  49. package/di/types.d.ts.map +0 -1
  50. package/di/types.js +0 -2
  51. package/di/types.js.map +0 -1
  52. package/html/binding.d.ts +0 -16
  53. package/html/binding.d.ts.map +0 -1
  54. package/html/binding.js +0 -58
  55. package/html/binding.js.map +0 -1
  56. package/scope/scope.d.ts +0 -29
  57. package/scope/scope.d.ts.map +0 -1
  58. package/scope/scope.js +0 -82
  59. package/scope/scope.js.map +0 -1
  60. package/scope/signals.d.ts +0 -15
  61. package/scope/signals.d.ts.map +0 -1
  62. package/scope/signals.js +0 -49
  63. package/scope/signals.js.map +0 -1
  64. package/scope/stream.d.ts +0 -1
  65. package/scope/stream.d.ts.map +0 -1
  66. package/scope/stream.js +0 -8
  67. package/scope/stream.js.map +0 -1
  68. package/scope/variables.d.ts +0 -19
  69. package/scope/variables.d.ts.map +0 -1
  70. package/scope/variables.js +0 -38
  71. package/scope/variables.js.map +0 -1
  72. package/scope/web-scope.d.ts +0 -4
  73. package/scope/web-scope.d.ts.map +0 -1
  74. package/scope/web-scope.js +0 -2
  75. package/scope/web-scope.js.map +0 -1
  76. package/signals/proposal-signals.d.ts +0 -4
  77. package/signals/proposal-signals.d.ts.map +0 -1
  78. package/signals/proposal-signals.js +0 -11
  79. package/signals/proposal-signals.js.map +0 -1
  80. package/signals/proposal-sugnal.d.ts +0 -1
  81. package/signals/proposal-sugnal.d.ts.map +0 -1
  82. package/signals/proposal-sugnal.js +0 -2
  83. package/signals/proposal-sugnal.js.map +0 -1
  84. package/zone/task.d.ts +0 -1
  85. package/zone/task.d.ts.map +0 -1
  86. package/zone/task.js +0 -128
  87. package/zone/task.js.map +0 -1
package/scope/scope.js DELETED
@@ -1,82 +0,0 @@
1
- import { ReactiveScope } from '@ibyar/expressions';
2
- function compute(computation) {
3
- try {
4
- return computation();
5
- }
6
- catch (error) {
7
- return error;
8
- }
9
- }
10
- export class VariableScope extends ReactiveScope {
11
- state = [];
12
- constructor() {
13
- super([]);
14
- }
15
- createVariable(initValue) {
16
- return new WritableVariable(this, this.getContext().length, initValue);
17
- }
18
- createLazyComputed(computation) {
19
- return new LazyVariable(this, this.getContext().length, computation);
20
- }
21
- createComputed(computation) {
22
- const index = this.getContext().length;
23
- this.watchState();
24
- const value = compute(computation);
25
- const variable = new Variable(this, index, value);
26
- this.observeState(index, computation);
27
- this.restoreState();
28
- return variable;
29
- }
30
- watchState() {
31
- this.state.push([]);
32
- }
33
- observeIndex(index) {
34
- this.state.at(-1)?.push(index);
35
- }
36
- observeState(index, computation) {
37
- this.unsubscribe(index);
38
- const update = () => this.set(index, compute(computation));
39
- const dependencies = this.state.at(-1);
40
- dependencies?.forEach(i => this.subscribe(i, update));
41
- }
42
- restoreState() {
43
- this.state.pop();
44
- }
45
- }
46
- export class Variable {
47
- scope;
48
- index;
49
- constructor(scope, index, initValue) {
50
- this.scope = scope;
51
- this.index = index;
52
- this.scope.set(index, initValue);
53
- }
54
- get() {
55
- this.scope.observeIndex(this.index);
56
- return this.scope.get(this.index);
57
- }
58
- }
59
- export class LazyVariable extends Variable {
60
- computation;
61
- constructor(scope, index, computation) {
62
- super(scope, index, compute(computation));
63
- this.computation = computation;
64
- }
65
- get() {
66
- const value = compute(this.computation);
67
- this.scope.set(this.index, value);
68
- return super.get();
69
- }
70
- }
71
- export class WritableVariable extends Variable {
72
- constructor(scope, index, initValue) {
73
- super(scope, index, initValue);
74
- }
75
- set(value) {
76
- this.scope.set(this.index, value);
77
- }
78
- update(mutFn) {
79
- this.set(mutFn(this.get()));
80
- }
81
- }
82
- //# sourceMappingURL=scope.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/core/scope/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,SAAS,OAAO,CAAI,WAAoB;IACvC,IAAI,CAAC;QACJ,OAAO,WAAW,EAAE,CAAC;IACtB,CAAC;IAAC,OAAO,KAA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AAE,KAAa,EAAE,SAAY;QAC5D,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAChC,CAAC;IAED,GAAG,CAAC,KAAQ;QACX,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,KAAsB;QAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;CAED","sourcesContent":["import { ReactiveScope } from '@ibyar/expressions';\n\nfunction compute<T>(computation: () => T): T | unknown {\n\ttry {\n\t\treturn computation();\n\t} catch (error) {\n\t\treturn error;\n\t}\n}\n\nexport class VariableScope extends ReactiveScope<Array<any>> {\n\n\tprivate state: number[][] = [];\n\n\tconstructor() {\n\t\tsuper([]);\n\t}\n\n\tcreateVariable<T>(initValue: T): WritableVariable<T> {\n\t\treturn new WritableVariable<T>(this, this.getContext().length, initValue);\n\t}\n\n\tcreateLazyComputed<T>(computation: () => T): LazyVariable<T> {\n\t\treturn new LazyVariable<T>(this, this.getContext().length, computation);\n\t}\n\n\tcreateComputed<T>(computation: () => T): Variable<T> {\n\t\tconst index = this.getContext().length;\n\t\tthis.watchState();\n\t\tconst value = compute(computation);\n\t\tconst variable = new Variable<T>(this, index, value as T);\n\t\tthis.observeState(index, computation);\n\t\tthis.restoreState();\n\t\treturn variable;\n\t}\n\n\twatchState() {\n\t\tthis.state.push([]);\n\t}\n\n\tobserveIndex(index: number) {\n\t\tthis.state.at(-1)?.push(index);\n\t}\n\n\tobserveState(index: number, computation: () => any) {\n\t\tthis.unsubscribe(index);\n\t\tconst update = () => this.set(index, compute(computation));\n\t\tconst dependencies = this.state.at(-1);\n\t\tdependencies?.forEach(i => this.subscribe(i, update));\n\t}\n\n\trestoreState() {\n\t\tthis.state.pop();\n\t}\n\n}\n\nexport class Variable<T> {\n\n\tconstructor(protected scope: VariableScope, protected index: number, initValue: T) {\n\t\tthis.scope.set(index, initValue);\n\t}\n\n\tget(): T {\n\t\tthis.scope.observeIndex(this.index);\n\t\treturn this.scope.get(this.index);\n\t}\n\n}\n\nexport class LazyVariable<T> extends Variable<T> {\n\n\tconstructor(scope: VariableScope, index: number, protected computation: () => T) {\n\t\tsuper(scope, index, compute(computation) as T);\n\t}\n\n\toverride get(): T {\n\t\tconst value = compute(this.computation);\n\t\tthis.scope.set(this.index, value);\n\t\treturn super.get();\n\t}\n\n}\n\nexport class WritableVariable<T> extends Variable<T>{\n\n\tconstructor(scope: VariableScope, index: number, initValue: T) {\n\t\tsuper(scope, index, initValue);\n\t}\n\n\tset(value: T) {\n\t\tthis.scope.set(this.index, value);\n\t}\n\n\tupdate(mutFn: (value: T) => T): void {\n\t\tthis.set(mutFn(this.get()));\n\t}\n\n}\n"]}
@@ -1,15 +0,0 @@
1
- export declare function signal<T>(initialValue: T): import("@ibyar/expressions").Signal<T>;
2
- export declare function computed<T>(computation: () => T): import("@ibyar/expressions").Computed<T>;
3
- export declare function lazy<T>(computation: () => T): import("@ibyar/expressions").Lazy<T>;
4
- export declare function signalFn<T>(initialValue: T): {
5
- (): T;
6
- set(value: T): void;
7
- update(updateFn: (value: T) => T): void;
8
- };
9
- export declare function computedFn<T>(computation: () => T): () => T;
10
- export declare function lazyFn<T>(computation: () => T): () => T;
11
- export declare function effect<T>(effectFn: (onCleanup?: (clean: () => void) => void) => void): {
12
- destroy(): void;
13
- };
14
- export declare function untracked<T>(nonReactiveReadsFn: () => T): T;
15
- //# sourceMappingURL=signals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../../src/core/scope/signals.ts"],"names":[],"mappings":"AAIA,wBAAgB,MAAM,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,0CAExC;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,4CAE/C;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,wCAE3C;AAGD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC;;;;EAE1C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAEjD;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAE7C;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,IAAI,KAAK,IAAI,KAAK,IAAI;;EAEpF;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,kBAAkB,EAAE,MAAM,CAAC,GAAG,CAAC,CAK3D"}
package/scope/signals.js DELETED
@@ -1,49 +0,0 @@
1
- import { SignalScope } from '@ibyar/expressions';
2
- const watchScope = new SignalScope();
3
- export function signal(initialValue) {
4
- return watchScope.createSignal(initialValue);
5
- }
6
- export function computed(computation) {
7
- return watchScope.createComputed(computation);
8
- }
9
- export function lazy(computation) {
10
- return watchScope.createLazy(computation);
11
- }
12
- export function signalFn(initialValue) {
13
- return watchScope.createSignalFn(initialValue);
14
- }
15
- export function computedFn(computation) {
16
- return watchScope.createComputedFn(computation);
17
- }
18
- export function lazyFn(computation) {
19
- return watchScope.createLazyFn(computation);
20
- }
21
- export function effect(effectFn) {
22
- return watchScope.createEffect(effectFn);
23
- }
24
- export function untracked(nonReactiveReadsFn) {
25
- watchScope.untrack();
26
- const value = nonReactiveReadsFn();
27
- watchScope.track();
28
- return value;
29
- }
30
- Object.assign(window, { signal, computed, lazy, signalFn, computedFn, lazyFn, effect, untracked, watchScope });
31
- const x = signal(6);
32
- const y = signal(4);
33
- const z = signal(20);
34
- const a = signal(true);
35
- const g = computed(() => {
36
- if (a.get()) {
37
- return x.get() + y.get();
38
- }
39
- return x.get() + z.get();
40
- });
41
- const h = computedFn(() => g.get());
42
- console.log('g = ', g.get());
43
- untracked(() => x.get() + y.get() + y.get());
44
- const e = effect(() => {
45
- console.log('x', x.get(), 'y', y.get(), 'z', z.get());
46
- console.log('a', a.get(), 'g', untracked(g.get), 'h', untracked(h));
47
- });
48
- Object.assign(window, { x, y, z, a, g, h, e });
49
- //# sourceMappingURL=signals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signals.js","sourceRoot":"","sources":["../../../src/core/scope/signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,GAAG,IAAI,WAAW,EAAE,CAAC;AAErC,MAAM,UAAU,MAAM,CAAI,YAAe;IACxC,OAAO,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,QAAQ,CAAI,WAAoB;IAC/C,OAAO,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,IAAI,CAAI,WAAoB;IAC3C,OAAO,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC;AAGD,MAAM,UAAU,QAAQ,CAAI,YAAe;IAC1C,OAAO,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,UAAU,CAAI,WAAoB;IACjD,OAAO,UAAU,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,MAAM,CAAI,WAAoB;IAC7C,OAAO,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,MAAM,CAAI,QAA2D;IACpF,OAAO,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,SAAS,CAAI,kBAA2B;IACvD,UAAU,CAAC,OAAO,EAAE,CAAC;IACrB,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAC;IAC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EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { SignalScope } from '@ibyar/expressions';\n\nconst watchScope = new SignalScope();\n\nexport function signal<T>(initialValue: T) {\n\treturn watchScope.createSignal(initialValue);\n}\n\nexport function computed<T>(computation: () => T) {\n\treturn watchScope.createComputed(computation);\n}\n\nexport function lazy<T>(computation: () => T) {\n\treturn watchScope.createLazy(computation);\n}\n\n\nexport function signalFn<T>(initialValue: T) {\n\treturn watchScope.createSignalFn(initialValue);\n}\n\nexport function computedFn<T>(computation: () => T) {\n\treturn watchScope.createComputedFn(computation);\n}\n\nexport function lazyFn<T>(computation: () => T) {\n\treturn watchScope.createLazyFn(computation);\n}\n\nexport function effect<T>(effectFn: (onCleanup?: (clean: () => void) => void) => void) {\n\treturn watchScope.createEffect(effectFn);\n}\n\nexport function untracked<T>(nonReactiveReadsFn: () => T): T {\n\twatchScope.untrack();\n\tconst value = nonReactiveReadsFn();\n\twatchScope.track();\n\treturn value;\n}\n\nObject.assign(window, { signal, computed, lazy, signalFn, computedFn, lazyFn, effect, untracked, watchScope });\n\nconst x = signal(6);\nconst y = signal(4);\nconst z = signal(20);\nconst a = signal(true);\n\nconst g = computed(() => {\n\tif (a.get()) {\n\t\treturn x.get() + y.get();\n\t}\n\treturn x.get() + z.get();\n});\n\nconst h = computedFn(() => g.get());\n\nconsole.log('g = ', g.get());\n\nuntracked(() => x.get() + y.get() + y.get());\n\nconst e = effect(() => {\n\tconsole.log('x', x.get(), 'y', y.get(), 'z', z.get());\n\tconsole.log('a', a.get(), 'g', untracked(g.get), 'h', untracked(h));\n});\n\n\nObject.assign(window, { x, y, z, a, g, h, e });\n\n"]}
package/scope/stream.d.ts DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=stream.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../src/core/scope/stream.ts"],"names":[],"mappings":""}
package/scope/stream.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- // map
3
- // filter
4
- // tap
5
- // other operators
6
- // operation
7
- // create/delete/change/update
8
- //# sourceMappingURL=stream.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../src/core/scope/stream.ts"],"names":[],"mappings":";AACA,MAAM;AACN,SAAS;AACT,MAAM;AACN,kBAAkB;AAClB,YAAY;AACZ,8BAA8B","sourcesContent":["\n// map\n// filter\n// tap\n// other operators\n// operation\n// create/delete/change/update"]}
@@ -1,19 +0,0 @@
1
- import { Context, ReactiveScope } from '@ibyar/expressions';
2
- export interface ScopeVariable<T> {
3
- readonly name: string;
4
- get(): T | undefined;
5
- set(value: T | undefined): void;
6
- }
7
- export declare class ScopeVariable<T> implements ScopeVariable<T> {
8
- readonly name: string;
9
- private scope;
10
- constructor(name: string, scope: ReactiveScope<Context>, value?: T);
11
- }
12
- export declare class ScopeEdit {
13
- private scopes;
14
- getScope<T extends Context>(): ReactiveScope<T>;
15
- pushScope<T extends Context>(scope: ReactiveScope<T>): void;
16
- popScope<T extends Context>(): ReactiveScope<T> | undefined;
17
- }
18
- export declare function input<T>(name: string, value?: T): ScopeVariable<T>;
19
- //# sourceMappingURL=variables.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../../src/core/scope/variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,aAAa,CAAC,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IACrB,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;CAChC;AAED,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IAE5C,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,OAAO,CAAC,KAAK;gBAA3B,IAAI,EAAE,MAAM,EAAU,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;CAYnF;AAED,qBAAa,SAAS;IAErB,OAAO,CAAC,MAAM,CAAgC;IAE9C,QAAQ,CAAC,CAAC,SAAS,OAAO,KAAK,aAAa,CAAC,CAAC,CAAC;IAS/C,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC;IAIpD,QAAQ,CAAC,CAAC,SAAS,OAAO,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS;CAI3D;AAID,wBAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAElE"}
@@ -1,38 +0,0 @@
1
- import { ReactiveScope } from '@ibyar/expressions';
2
- export class ScopeVariable {
3
- name;
4
- scope;
5
- constructor(name, scope, value) {
6
- this.name = name;
7
- this.scope = scope;
8
- this.scope.set(name, value);
9
- }
10
- get() {
11
- return this.scope.get(this.name);
12
- }
13
- set(value) {
14
- this.scope.set(this.name, value);
15
- }
16
- }
17
- export class ScopeEdit {
18
- scopes = [];
19
- getScope() {
20
- if (this.scopes.length == 0) {
21
- const scope = ReactiveScope.blockScope();
22
- this.scopes.push(scope);
23
- return scope;
24
- }
25
- return this.scopes.at(-1);
26
- }
27
- pushScope(scope) {
28
- this.scopes.push(scope);
29
- }
30
- popScope() {
31
- return this.scopes.pop();
32
- }
33
- }
34
- let scopeEditor = new ScopeEdit();
35
- export function input(name, value) {
36
- return new ScopeVariable(name, scopeEditor.getScope(), value);
37
- }
38
- //# sourceMappingURL=variables.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variables.js","sourceRoot":"","sources":["../../../src/core/scope/variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQ5D,MAAM,OAAO,aAAa;IAEJ;IAAsB;IAA3C,YAAqB,IAAY,EAAU,KAA6B,EAAE,KAAS;QAA9D,SAAI,GAAJ,IAAI,CAAQ;QAAU,UAAK,GAAL,KAAK,CAAwB;QACvE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,GAAG;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,GAAG,CAAC,KAAoB;QACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;CAED;AAED,MAAM,OAAO,SAAS;IAEb,MAAM,GAA6B,EAAE,CAAC;IAE9C,QAAQ;QACP,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAC7B,MAAM,KAAK,GAAG,aAAa,CAAC,UAAU,EAAK,CAAC;YAC5C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAqB,CAAC;IAC/C,CAAC;IAED,SAAS,CAAoB,KAAuB;QACnD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED,QAAQ;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;IAC1B,CAAC;CAED;AAED,IAAI,WAAW,GAAG,IAAI,SAAS,EAAE,CAAC;AAElC,MAAM,UAAU,KAAK,CAAI,IAAY,EAAE,KAAS;IAC/C,OAAO,IAAI,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["import { Context, ReactiveScope } from '@ibyar/expressions';\n\nexport interface ScopeVariable<T> {\n\treadonly name: string;\n\tget(): T | undefined;\n\tset(value: T | undefined): void;\n}\n\nexport class ScopeVariable<T> implements ScopeVariable<T> {\n\n\tconstructor(readonly name: string, private scope: ReactiveScope<Context>, value?: T) {\n\t\tthis.scope.set(name, value);\n\t}\n\n\tget(): T | undefined {\n\t\treturn this.scope.get(this.name);\n\t}\n\n\tset(value: T | undefined): void {\n\t\tthis.scope.set(this.name, value);\n\t}\n\n}\n\nexport class ScopeEdit {\n\n\tprivate scopes: ReactiveScope<Context>[] = [];\n\n\tgetScope<T extends Context>(): ReactiveScope<T> {\n\t\tif (this.scopes.length == 0) {\n\t\t\tconst scope = ReactiveScope.blockScope<T>();\n\t\t\tthis.scopes.push(scope);\n\t\t\treturn scope;\n\t\t}\n\t\treturn this.scopes.at(-1) as ReactiveScope<T>;\n\t}\n\n\tpushScope<T extends Context>(scope: ReactiveScope<T>) {\n\t\tthis.scopes.push(scope);\n\t}\n\n\tpopScope<T extends Context>(): ReactiveScope<T> | undefined {\n\t\treturn this.scopes.pop();\n\t}\n\n}\n\nlet scopeEditor = new ScopeEdit();\n\nexport function input<T>(name: string, value?: T): ScopeVariable<T> {\n\treturn new ScopeVariable(name, scopeEditor.getScope(), value);\n}\n"]}
@@ -1,4 +0,0 @@
1
- import { Context, Scope } from '@ibyar/expressions';
2
- export interface WebScope<T extends Context> extends Scope<T> {
3
- }
4
- //# sourceMappingURL=web-scope.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-scope.d.ts","sourceRoot":"","sources":["../../../src/core/scope/web-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,OAAO,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;CAE5D"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=web-scope.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-scope.js","sourceRoot":"","sources":["../../../src/core/scope/web-scope.ts"],"names":[],"mappings":"","sourcesContent":["import { Context, Scope } from '@ibyar/expressions';\n\n\nexport interface WebScope<T extends Context> extends Scope<T> {\n\n}\n\n"]}
@@ -1,4 +0,0 @@
1
- import { ReactiveScope } from '@ibyar/expressions';
2
- import { Signal } from 'signal-polyfill';
3
- export declare function setupScopesForSignal(signal: Signal.State<any> | Signal.Computed<any>, parent: ReactiveScope<any>, name: string): ReactiveScope<Signal.State<any> | Signal.Computed<any>>;
4
- //# sourceMappingURL=proposal-signals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposal-signals.d.ts","sourceRoot":"","sources":["../../../src/core/signals/proposal-signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,2DAU9H"}
@@ -1,11 +0,0 @@
1
- import { ReactiveScope } from '@ibyar/expressions';
2
- export function setupScopesForSignal(signal, parent, name) {
3
- const symbols = Object.getOwnPropertySymbols(signal);
4
- const scope = new ReactiveScope(signal, symbols, name, parent);
5
- parent.setInnerScope(name, scope);
6
- const symbol = symbols[0];
7
- const contextScope = new ReactiveScope(signal, ['value', 'version'], symbol, scope);
8
- scope.setInnerScope(symbol, contextScope);
9
- return scope;
10
- }
11
- //# sourceMappingURL=proposal-signals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposal-signals.js","sourceRoot":"","sources":["../../../src/core/signals/proposal-signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAInD,MAAM,UAAU,oBAAoB,CAAC,MAAgD,EAAE,MAA0B,EAAE,IAAY;IAC9H,MAAM,OAAO,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,OAAc,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACtE,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAElC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC1B,MAAM,YAAY,GAAG,IAAI,aAAa,CAAC,MAAqB,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACnG,KAAK,CAAC,aAAa,CAAC,MAAa,EAAE,YAAY,CAAC,CAAC;IAEjD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { ReactiveScope } from '@ibyar/expressions';\nimport { Signal } from 'signal-polyfill';\n\n\nexport function setupScopesForSignal(signal: Signal.State<any> | Signal.Computed<any>, parent: ReactiveScope<any>, name: string) {\n\tconst symbols = Object.getOwnPropertySymbols(signal);\n\tconst scope = new ReactiveScope(signal, symbols as any, name, parent);\n\tparent.setInnerScope(name, scope);\n\n\tconst symbol = symbols[0];\n\tconst contextScope = new ReactiveScope(signal as any[symbol], ['value', 'version'], symbol, scope);\n\tscope.setInnerScope(symbol as any, contextScope);\n\n\treturn scope;\n}\n"]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=proposal-sugnal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposal-sugnal.d.ts","sourceRoot":"","sources":["../../../src/core/signals/proposal-sugnal.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=proposal-sugnal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposal-sugnal.js","sourceRoot":"","sources":["../../../src/core/signals/proposal-sugnal.ts"],"names":[],"mappings":"","sourcesContent":[""]}
package/zone/task.d.ts DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=task.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../../src/core/zone/task.ts"],"names":[],"mappings":""}
package/zone/task.js DELETED
@@ -1,128 +0,0 @@
1
- "use strict";
2
- // /// <reference types='zone.js' />
3
- // import { ReactiveScopeControl, Context, Stack } from '@ibyar/expressions';
4
- // const notScheduled: 'notScheduled' = 'notScheduled',
5
- // scheduling: 'scheduling' = 'scheduling',
6
- // scheduled: 'scheduled' = 'scheduled',
7
- // running: 'running' = 'running',
8
- // canceling: 'canceling' = 'canceling',
9
- // unknown: 'unknown' = 'unknown';
10
- // const microTask: 'microTask' = 'microTask',
11
- // macroTask: 'macroTask' = 'macroTask',
12
- // eventTask: 'eventTask' = 'eventTask';
13
- // export abstract class AbstractTask<T extends TaskType> implements Task {
14
- // public runCount: number = 0;
15
- // _zone: Zone | null = null;
16
- // _state: TaskState = 'notScheduled';
17
- // constructor(
18
- // public type: T,
19
- // public source: string,
20
- // public callback: Function,
21
- // public data?: TaskData,
22
- // public scheduleFn?: (task: Task) => void,
23
- // public cancelFn?: (task: Task) => void) {
24
- // if (!callback) {
25
- // throw new Error('callback is not defined');
26
- // }
27
- // }
28
- // get zone(): Zone {
29
- // return this._zone!;
30
- // }
31
- // get state(): TaskState {
32
- // return this._state;
33
- // }
34
- // public cancelScheduleRequest() {
35
- // this._transitionTo(notScheduled, scheduling);
36
- // }
37
- // _transitionTo(toState: TaskState, fromState1: TaskState, fromState2?: TaskState) {
38
- // if (this._state === fromState1 || this._state === fromState2) {
39
- // this._state = toState;
40
- // } else {
41
- // throw new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? ' or \'' + fromState2 + '\'' : ''}, was '${this._state}'.`);
42
- // }
43
- // }
44
- // public toString() {
45
- // if (this.data && typeof this.data.handleId !== 'undefined') {
46
- // return this.data.handleId.toString();
47
- // } else {
48
- // return Object.prototype.toString.call(this);
49
- // }
50
- // }
51
- // public toJSON() {
52
- // return {
53
- // type: this.type,
54
- // state: this.state,
55
- // source: this.source,
56
- // zone: this.zone.name,
57
- // runCount: this.runCount
58
- // };
59
- // }
60
- // abstract invoke(task: any, target: any, args: any): any;
61
- // }
62
- // export class ScopeTask<T extends TaskType> extends AbstractTask<T> {
63
- // static microTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void) {
64
- // return new ScopeTask(scope, microTask, source, callback, data, customSchedule, undefined);
65
- // }
66
- // static macroTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {
67
- // return new ScopeTask(scope, macroTask, source, callback, data, customSchedule, customCancel);
68
- // }
69
- // static eventTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {
70
- // return new ScopeTask(scope, eventTask, source, callback, data, customSchedule, customCancel);
71
- // }
72
- // constructor(
73
- // public scope: ReactiveScopeControl<any>,
74
- // type: T,
75
- // source: string,
76
- // callback: Function,
77
- // data?: TaskData,
78
- // scheduleFn?: (task: Task) => void,
79
- // cancelFn?: (task: Task) => void) {
80
- // super(type, source, callback, data, scheduleFn, cancelFn);
81
- // }
82
- // invoke(task: any, target: any, args: any) {
83
- // try {
84
- // this.runCount++;
85
- // this.scope.detach();
86
- // return this.zone.runTask(task, target, args);
87
- // } finally {
88
- // this.scope.reattach();
89
- // }
90
- // }
91
- // public toJSON() {
92
- // return Object.assign(super.toJSON(), { scope: this.scope });
93
- // }
94
- // }
95
- // export class StackTask<T extends TaskType> extends AbstractTask<T> {
96
- // static microTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void) {
97
- // return new StackTask(stack, microTask, source, callback, data, customSchedule, undefined);
98
- // }
99
- // static macroTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {
100
- // return new StackTask(stack, macroTask, source, callback, data, customSchedule, customCancel);
101
- // }
102
- // static eventTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {
103
- // return new StackTask(stack, eventTask, source, callback, data, customSchedule, customCancel);
104
- // }
105
- // constructor(
106
- // public stack: Stack,
107
- // type: T,
108
- // source: string,
109
- // callback: Function,
110
- // data: TaskData | undefined,
111
- // scheduleFn: ((task: Task) => void) | undefined,
112
- // cancelFn: ((task: Task) => void) | undefined) {
113
- // super(type, source, callback, data, scheduleFn, cancelFn);
114
- // }
115
- // invoke(task: any, target: any, args: any) {
116
- // try {
117
- // this.runCount++;
118
- // this.stack.detach();
119
- // return this.zone.runTask(task, target, args);
120
- // } finally {
121
- // this.stack.reattach();
122
- // }
123
- // }
124
- // public toJSON() {
125
- // return Object.assign(super.toJSON(), { stack: this.stack });
126
- // }
127
- // }
128
- //# sourceMappingURL=task.js.map
package/zone/task.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"task.js","sourceRoot":"","sources":["../../../src/core/zone/task.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,6EAA6E;AAE7E,uDAAuD;AACvD,4CAA4C;AAC5C,yCAAyC;AACzC,mCAAmC;AACnC,yCAAyC;AACzC,mCAAmC;AAEnC,8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ACL,qKAAqK;AACrK,kGAAkG;AAClG,KAAK;AACL,qKAAqK;AACrK,kGAAkG;AAClG,KAAK;AAEL,gBAAgB;AAChB,yBAAyB;AACzB,aAAa;AACb,oBAAoB;AACpB,wBAAwB;AACxB,gCAAgC;AAChC,oDAAoD;AACpD,oDAAoD;AACpD,+DAA+D;AAC/D,KAAK;AACL,+CAA+C;AAC/C,UAAU;AACV,sBAAsB;AACtB,0BAA0B;AAC1B,mDAAmD;AACnD,gBAAgB;AAChB,4BAA4B;AAC5B,MAAM;AACN,KAAK;AACL,qBAAqB;AACrB,iEAAiE;AACjE,KAAK;AACL,IAAI","sourcesContent":["// /// <reference types='zone.js' />\n// import { ReactiveScopeControl, Context, Stack } from '@ibyar/expressions';\n\n// const notScheduled: 'notScheduled' = 'notScheduled',\n// \tscheduling: 'scheduling' = 'scheduling',\n// \tscheduled: 'scheduled' = 'scheduled',\n// \trunning: 'running' = 'running',\n// \tcanceling: 'canceling' = 'canceling',\n// \tunknown: 'unknown' = 'unknown';\n\n// const microTask: 'microTask' = 'microTask',\n// \tmacroTask: 'macroTask' = 'macroTask',\n// \teventTask: 'eventTask' = 'eventTask';\n\n// export abstract class AbstractTask<T extends TaskType> implements Task {\n\n// \tpublic runCount: number = 0;\n// \t_zone: Zone | null = null;\n// \t_state: TaskState = 'notScheduled';\n\n// \tconstructor(\n// \t\tpublic type: T,\n// \t\tpublic source: string,\n// \t\tpublic callback: Function,\n// \t\tpublic data?: TaskData,\n// \t\tpublic scheduleFn?: (task: Task) => void,\n// \t\tpublic cancelFn?: (task: Task) => void) {\n// \t\tif (!callback) {\n// \t\t\tthrow new Error('callback is not defined');\n// \t\t}\n// \t}\n\n// \tget zone(): Zone {\n// \t\treturn this._zone!;\n// \t}\n\n// \tget state(): TaskState {\n// \t\treturn this._state;\n// \t}\n\n// \tpublic cancelScheduleRequest() {\n// \t\tthis._transitionTo(notScheduled, scheduling);\n// \t}\n\n// \t_transitionTo(toState: TaskState, fromState1: TaskState, fromState2?: TaskState) {\n// \t\tif (this._state === fromState1 || this._state === fromState2) {\n// \t\t\tthis._state = toState;\n// \t\t} else {\n// \t\t\tthrow new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? ' or \\'' + fromState2 + '\\'' : ''}, was '${this._state}'.`);\n// \t\t}\n// \t}\n\n// \tpublic toString() {\n// \t\tif (this.data && typeof this.data.handleId !== 'undefined') {\n// \t\t\treturn this.data.handleId.toString();\n// \t\t} else {\n// \t\t\treturn Object.prototype.toString.call(this);\n// \t\t}\n// \t}\n// \tpublic toJSON() {\n// \t\treturn {\n// \t\t\ttype: this.type,\n// \t\t\tstate: this.state,\n// \t\t\tsource: this.source,\n// \t\t\tzone: this.zone.name,\n// \t\t\trunCount: this.runCount\n// \t\t};\n// \t}\n\n// \tabstract invoke(task: any, target: any, args: any): any;\n// }\n\n// export class ScopeTask<T extends TaskType> extends AbstractTask<T> {\n// \tstatic microTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void) {\n// \t\treturn new ScopeTask(scope, microTask, source, callback, data, customSchedule, undefined);\n// \t}\n// \tstatic macroTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {\n// \t\treturn new ScopeTask(scope, macroTask, source, callback, data, customSchedule, customCancel);\n// \t}\n// \tstatic eventTask(scope: ReactiveScopeControl<any>, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {\n// \t\treturn new ScopeTask(scope, eventTask, source, callback, data, customSchedule, customCancel);\n// \t}\n\n// \tconstructor(\n// \t\tpublic scope: ReactiveScopeControl<any>,\n// \t\ttype: T,\n// \t\tsource: string,\n// \t\tcallback: Function,\n// \t\tdata?: TaskData,\n// \t\tscheduleFn?: (task: Task) => void,\n// \t\tcancelFn?: (task: Task) => void) {\n// \t\tsuper(type, source, callback, data, scheduleFn, cancelFn);\n// \t}\n// \tinvoke(task: any, target: any, args: any) {\n// \t\ttry {\n// \t\t\tthis.runCount++;\n// \t\t\tthis.scope.detach();\n// \t\t\treturn this.zone.runTask(task, target, args);\n// \t\t} finally {\n// \t\t\tthis.scope.reattach();\n// \t\t}\n// \t}\n// \tpublic toJSON() {\n// \t\treturn Object.assign(super.toJSON(), { scope: this.scope });\n// \t}\n// }\n\n// export class StackTask<T extends TaskType> extends AbstractTask<T> {\n\n// \tstatic microTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void) {\n// \t\treturn new StackTask(stack, microTask, source, callback, data, customSchedule, undefined);\n// \t}\n// \tstatic macroTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {\n// \t\treturn new StackTask(stack, macroTask, source, callback, data, customSchedule, customCancel);\n// \t}\n// \tstatic eventTask(stack: Stack, source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void) {\n// \t\treturn new StackTask(stack, eventTask, source, callback, data, customSchedule, customCancel);\n// \t}\n\n// \tconstructor(\n// \t\tpublic stack: Stack,\n// \t\ttype: T,\n// \t\tsource: string,\n// \t\tcallback: Function,\n// \t\tdata: TaskData | undefined,\n// \t\tscheduleFn: ((task: Task) => void) | undefined,\n// \t\tcancelFn: ((task: Task) => void) | undefined) {\n// \t\tsuper(type, source, callback, data, scheduleFn, cancelFn);\n// \t}\n// \tinvoke(task: any, target: any, args: any) {\n// \t\ttry {\n// \t\t\tthis.runCount++;\n// \t\t\tthis.stack.detach();\n// \t\t\treturn this.zone.runTask(task, target, args);\n// \t\t} finally {\n// \t\t\tthis.stack.reattach();\n// \t\t}\n// \t}\n// \tpublic toJSON() {\n// \t\treturn Object.assign(super.toJSON(), { stack: this.stack });\n// \t}\n// }\n"]}