@player-ui/player 0.8.0--canary.307.9621 → 0.8.0-next.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/dist/Player.native.js +11630 -0
- package/dist/Player.native.js.map +1 -0
- package/dist/cjs/index.cjs +5626 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/{index.esm.js → index.legacy-esm.js} +2044 -1667
- package/dist/{index.cjs.js → index.mjs} +2052 -1761
- package/dist/index.mjs.map +1 -0
- package/package.json +29 -63
- package/src/__tests__/data.test.ts +498 -0
- package/src/__tests__/flow.test.ts +312 -0
- package/src/__tests__/helpers/action-exp.plugin.ts +22 -0
- package/src/__tests__/helpers/actions.flow.ts +67 -0
- package/src/__tests__/helpers/binding.plugin.ts +125 -0
- package/src/__tests__/helpers/expression.plugin.ts +88 -0
- package/src/__tests__/helpers/transform-plugin.ts +19 -0
- package/src/__tests__/helpers/validation.flow.ts +56 -0
- package/src/__tests__/player.test.ts +597 -0
- package/src/__tests__/string-resolver.test.ts +186 -0
- package/src/__tests__/validation.test.ts +3555 -0
- package/src/__tests__/view.test.ts +715 -0
- package/src/binding/__tests__/binding.test.ts +113 -0
- package/src/binding/__tests__/index.test.ts +208 -0
- package/src/binding/__tests__/resolver.test.ts +83 -0
- package/src/binding/binding.ts +6 -6
- package/src/binding/index.ts +34 -34
- package/src/binding/resolver.ts +19 -19
- package/src/binding/utils.ts +7 -7
- package/src/binding-grammar/__tests__/parser.test.ts +64 -0
- package/src/binding-grammar/__tests__/test-utils/ast-cases.ts +198 -0
- package/src/binding-grammar/__tests__/test-utils/perf-test.ts +66 -0
- package/src/binding-grammar/ast.ts +11 -11
- package/src/binding-grammar/custom/index.ts +19 -22
- package/src/binding-grammar/ebnf/index.ts +20 -21
- package/src/binding-grammar/ebnf/types.ts +13 -13
- package/src/binding-grammar/index.ts +4 -4
- package/src/binding-grammar/parsimmon/index.ts +14 -14
- package/src/controllers/constants/__tests__/index.test.ts +106 -0
- package/src/controllers/constants/index.ts +3 -3
- package/src/controllers/constants/utils.ts +4 -4
- package/src/controllers/data/controller.ts +22 -22
- package/src/controllers/data/index.ts +1 -1
- package/src/controllers/data/utils.ts +7 -7
- package/src/controllers/flow/__tests__/controller.test.ts +195 -0
- package/src/controllers/flow/__tests__/flow.test.ts +381 -0
- package/src/controllers/flow/controller.ts +13 -13
- package/src/controllers/flow/flow.ts +23 -23
- package/src/controllers/flow/index.ts +2 -2
- package/src/controllers/index.ts +5 -5
- package/src/controllers/validation/binding-tracker.ts +71 -59
- package/src/controllers/validation/controller.ts +104 -104
- package/src/controllers/validation/index.ts +2 -2
- package/src/controllers/view/asset-transform.ts +20 -20
- package/src/controllers/view/controller.ts +27 -27
- package/src/controllers/view/index.ts +4 -4
- package/src/controllers/view/store.ts +3 -3
- package/src/controllers/view/types.ts +7 -7
- package/src/data/__tests__/__snapshots__/dependency-tracker.test.ts.snap +64 -0
- package/src/data/__tests__/dependency-tracker.test.ts +146 -0
- package/src/data/__tests__/local-model.test.ts +46 -0
- package/src/data/__tests__/model.test.ts +78 -0
- package/src/data/dependency-tracker.ts +16 -16
- package/src/data/index.ts +4 -4
- package/src/data/local-model.ts +6 -6
- package/src/data/model.ts +17 -17
- package/src/data/noop-model.ts +1 -1
- package/src/expressions/__tests__/__snapshots__/parser.test.ts.snap +854 -0
- package/src/expressions/__tests__/evaluator-functions.test.ts +47 -0
- package/src/expressions/__tests__/evaluator.test.ts +410 -0
- package/src/expressions/__tests__/parser.test.ts +115 -0
- package/src/expressions/__tests__/utils.test.ts +44 -0
- package/src/expressions/evaluator-functions.ts +6 -6
- package/src/expressions/evaluator.ts +71 -67
- package/src/expressions/index.ts +4 -4
- package/src/expressions/parser.ts +102 -105
- package/src/expressions/types.ts +29 -21
- package/src/expressions/utils.ts +32 -21
- package/src/index.ts +13 -13
- package/src/logger/__tests__/consoleLogger.test.ts +46 -0
- package/src/logger/__tests__/noopLogger.test.ts +13 -0
- package/src/logger/__tests__/proxyLogger.test.ts +31 -0
- package/src/logger/__tests__/tapableLogger.test.ts +41 -0
- package/src/logger/consoleLogger.ts +9 -9
- package/src/logger/index.ts +5 -5
- package/src/logger/noopLogger.ts +1 -1
- package/src/logger/proxyLogger.ts +6 -6
- package/src/logger/tapableLogger.ts +7 -7
- package/src/logger/types.ts +2 -2
- package/src/player.ts +60 -58
- package/src/plugins/default-exp-plugin.ts +10 -10
- package/src/plugins/default-view-plugin.ts +29 -0
- package/src/plugins/flow-exp-plugin.ts +6 -6
- package/src/schema/__tests__/schema.test.ts +243 -0
- package/src/schema/index.ts +2 -2
- package/src/schema/schema.ts +24 -24
- package/src/schema/types.ts +4 -4
- package/src/string-resolver/__tests__/index.test.ts +361 -0
- package/src/string-resolver/index.ts +17 -17
- package/src/types.ts +17 -17
- package/src/utils/__tests__/replaceParams.test.ts +33 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/replaceParams.ts +1 -1
- package/src/validator/__tests__/binding-map-splice.test.ts +53 -0
- package/src/validator/__tests__/validation-middleware.test.ts +127 -0
- package/src/validator/binding-map-splice.ts +5 -5
- package/src/validator/index.ts +4 -4
- package/src/validator/registry.ts +1 -1
- package/src/validator/types.ts +13 -13
- package/src/validator/validation-middleware.ts +15 -15
- package/src/view/__tests__/view.immutable.test.ts +269 -0
- package/src/view/__tests__/view.test.ts +959 -0
- package/src/view/builder/index.test.ts +69 -0
- package/src/view/builder/index.ts +3 -3
- package/src/view/index.ts +5 -5
- package/src/view/parser/__tests__/__snapshots__/parser.test.ts.snap +394 -0
- package/src/view/parser/__tests__/parser.test.ts +264 -0
- package/src/view/parser/index.ts +43 -33
- package/src/view/parser/types.ts +11 -11
- package/src/view/parser/utils.ts +5 -5
- package/src/view/plugins/__tests__/__snapshots__/template.test.ts.snap +278 -0
- package/src/view/plugins/__tests__/applicability.test.ts +265 -0
- package/src/view/plugins/__tests__/string.test.ts +122 -0
- package/src/view/plugins/__tests__/template.test.ts +724 -0
- package/src/view/plugins/applicability.ts +19 -19
- package/src/view/plugins/index.ts +4 -5
- package/src/view/plugins/options.ts +1 -1
- package/src/view/plugins/string-resolver.ts +22 -22
- package/src/view/plugins/switch.ts +22 -23
- package/src/view/plugins/template-plugin.ts +26 -27
- package/src/view/resolver/__tests__/dependencies.test.ts +321 -0
- package/src/view/resolver/__tests__/edgecases.test.ts +626 -0
- package/src/view/resolver/index.ts +42 -42
- package/src/view/resolver/types.ts +21 -20
- package/src/view/resolver/utils.ts +9 -9
- package/src/view/view.ts +32 -22
- package/types/binding/binding.d.ts +50 -0
- package/types/binding/index.d.ts +29 -0
- package/types/binding/resolver.d.ts +26 -0
- package/types/binding/utils.d.ts +12 -0
- package/types/binding-grammar/ast.d.ts +67 -0
- package/types/binding-grammar/custom/index.d.ts +4 -0
- package/types/binding-grammar/ebnf/index.d.ts +4 -0
- package/types/binding-grammar/ebnf/types.d.ts +75 -0
- package/types/binding-grammar/index.d.ts +5 -0
- package/types/binding-grammar/parsimmon/index.d.ts +4 -0
- package/types/controllers/constants/index.d.ts +45 -0
- package/types/controllers/constants/utils.d.ts +6 -0
- package/types/controllers/data/controller.d.ts +45 -0
- package/types/controllers/data/index.d.ts +2 -0
- package/types/controllers/data/utils.d.ts +14 -0
- package/types/controllers/flow/controller.d.ts +25 -0
- package/types/controllers/flow/flow.d.ts +50 -0
- package/types/controllers/flow/index.d.ts +3 -0
- package/types/controllers/index.d.ts +6 -0
- package/types/controllers/validation/binding-tracker.d.ts +32 -0
- package/types/controllers/validation/controller.d.ts +151 -0
- package/types/controllers/validation/index.d.ts +3 -0
- package/types/controllers/view/asset-transform.d.ts +19 -0
- package/types/controllers/view/controller.d.ts +37 -0
- package/types/controllers/view/index.d.ts +5 -0
- package/types/controllers/view/store.d.ts +20 -0
- package/types/controllers/view/types.d.ts +16 -0
- package/types/data/dependency-tracker.d.ts +49 -0
- package/types/data/index.d.ts +5 -0
- package/types/data/local-model.d.ts +16 -0
- package/types/data/model.d.ts +86 -0
- package/types/data/noop-model.d.ts +13 -0
- package/types/expressions/evaluator-functions.d.ts +15 -0
- package/types/expressions/evaluator.d.ts +52 -0
- package/types/expressions/index.d.ts +5 -0
- package/types/expressions/parser.d.ts +10 -0
- package/types/expressions/types.d.ts +144 -0
- package/types/expressions/utils.d.ts +12 -0
- package/types/index.d.ts +14 -0
- package/types/logger/consoleLogger.d.ts +17 -0
- package/types/logger/index.d.ts +6 -0
- package/types/logger/noopLogger.d.ts +10 -0
- package/types/logger/proxyLogger.d.ts +15 -0
- package/types/logger/tapableLogger.d.ts +23 -0
- package/types/logger/types.d.ts +6 -0
- package/types/player.d.ts +101 -0
- package/types/plugins/default-exp-plugin.d.ts +9 -0
- package/types/plugins/default-view-plugin.d.ts +9 -0
- package/types/plugins/flow-exp-plugin.d.ts +11 -0
- package/types/schema/index.d.ts +3 -0
- package/types/schema/schema.d.ts +36 -0
- package/types/schema/types.d.ts +38 -0
- package/types/string-resolver/index.d.ts +30 -0
- package/types/types.d.ts +73 -0
- package/types/utils/index.d.ts +2 -0
- package/types/utils/replaceParams.d.ts +9 -0
- package/types/validator/binding-map-splice.d.ts +10 -0
- package/types/validator/index.d.ts +5 -0
- package/types/validator/registry.d.ts +11 -0
- package/types/validator/types.d.ts +53 -0
- package/types/validator/validation-middleware.d.ts +36 -0
- package/types/view/builder/index.d.ts +35 -0
- package/types/view/index.d.ts +6 -0
- package/types/view/parser/index.d.ts +52 -0
- package/types/view/parser/types.d.ts +109 -0
- package/types/view/parser/utils.d.ts +6 -0
- package/types/view/plugins/applicability.d.ts +10 -0
- package/types/view/plugins/index.d.ts +5 -0
- package/types/view/plugins/options.d.ts +4 -0
- package/types/view/plugins/string-resolver.d.ts +13 -0
- package/types/view/plugins/switch.d.ts +14 -0
- package/types/view/plugins/template-plugin.d.ts +33 -0
- package/types/view/resolver/index.d.ts +73 -0
- package/types/view/resolver/types.d.ts +129 -0
- package/types/view/resolver/utils.d.ts +11 -0
- package/types/view/view.d.ts +37 -0
- package/dist/index.d.ts +0 -1814
- package/dist/player.dev.js +0 -11472
- package/dist/player.prod.js +0 -2
- package/src/view/plugins/plugin.ts +0 -21
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { BindingInstance } from
|
|
1
|
+
import type { BindingInstance } from "../binding";
|
|
2
2
|
import type {
|
|
3
3
|
BatchSetTransaction,
|
|
4
4
|
DataModelImpl,
|
|
5
5
|
DataModelMiddleware,
|
|
6
6
|
DataModelOptions,
|
|
7
7
|
Updates,
|
|
8
|
-
} from
|
|
8
|
+
} from "./model";
|
|
9
9
|
|
|
10
|
-
export type DependencySets =
|
|
10
|
+
export type DependencySets = "core" | "children";
|
|
11
11
|
|
|
12
12
|
/** A class to track usage of read/writes to/from a data model */
|
|
13
13
|
export class DependencyTracker {
|
|
@@ -31,10 +31,10 @@ export class DependencyTracker {
|
|
|
31
31
|
this.readDeps = new Set();
|
|
32
32
|
this.writeDeps = new Set();
|
|
33
33
|
this.namedDependencySets = {};
|
|
34
|
-
this.namedSet =
|
|
34
|
+
this.namedSet = "core";
|
|
35
35
|
|
|
36
|
-
this.createSubset(
|
|
37
|
-
this.createSubset(
|
|
36
|
+
this.createSubset("core");
|
|
37
|
+
this.createSubset("children");
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
protected createSubset(name: DependencySets, force = false): void {
|
|
@@ -61,7 +61,7 @@ export class DependencyTracker {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
public trackDefault() {
|
|
64
|
-
this.namedSet =
|
|
64
|
+
this.namedSet = "core";
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/** Grab all of the bindings this wrote to */
|
|
@@ -94,15 +94,15 @@ export class DependencyTracker {
|
|
|
94
94
|
this.readDeps = new Set();
|
|
95
95
|
this.writeDeps = new Set();
|
|
96
96
|
this.namedDependencySets = {};
|
|
97
|
-
this.namedSet =
|
|
97
|
+
this.namedSet = "core";
|
|
98
98
|
|
|
99
|
-
this.createSubset(
|
|
100
|
-
this.createSubset(
|
|
99
|
+
this.createSubset("core", true);
|
|
100
|
+
this.createSubset("children", true);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
protected addReadDep(
|
|
104
104
|
binding: BindingInstance,
|
|
105
|
-
namedSet = this.namedSet
|
|
105
|
+
namedSet = this.namedSet,
|
|
106
106
|
): void {
|
|
107
107
|
if (namedSet) {
|
|
108
108
|
this.namedDependencySets?.[namedSet]?.readDeps.add(binding);
|
|
@@ -113,7 +113,7 @@ export class DependencyTracker {
|
|
|
113
113
|
|
|
114
114
|
protected addWriteDep(
|
|
115
115
|
binding: BindingInstance,
|
|
116
|
-
namedSet = this.namedSet
|
|
116
|
+
namedSet = this.namedSet,
|
|
117
117
|
): void {
|
|
118
118
|
if (namedSet) {
|
|
119
119
|
this.namedDependencySets?.[namedSet]?.writeDeps.add(binding);
|
|
@@ -123,7 +123,7 @@ export class DependencyTracker {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
public addChildReadDep(binding: BindingInstance): void {
|
|
126
|
-
this.addReadDep(binding,
|
|
126
|
+
this.addReadDep(binding, "children");
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -141,7 +141,7 @@ export class DependencyMiddleware
|
|
|
141
141
|
public set(
|
|
142
142
|
transaction: BatchSetTransaction,
|
|
143
143
|
options?: DataModelOptions,
|
|
144
|
-
next?: DataModelImpl | undefined
|
|
144
|
+
next?: DataModelImpl | undefined,
|
|
145
145
|
): Updates {
|
|
146
146
|
transaction.forEach(([binding]) => this.addWriteDep(binding));
|
|
147
147
|
|
|
@@ -151,7 +151,7 @@ export class DependencyMiddleware
|
|
|
151
151
|
public get(
|
|
152
152
|
binding: BindingInstance,
|
|
153
153
|
options?: DataModelOptions,
|
|
154
|
-
next?: DataModelImpl | undefined
|
|
154
|
+
next?: DataModelImpl | undefined,
|
|
155
155
|
) {
|
|
156
156
|
this.addReadDep(binding);
|
|
157
157
|
|
|
@@ -161,7 +161,7 @@ export class DependencyMiddleware
|
|
|
161
161
|
public delete(
|
|
162
162
|
binding: BindingInstance,
|
|
163
163
|
options?: DataModelOptions,
|
|
164
|
-
next?: DataModelImpl | undefined
|
|
164
|
+
next?: DataModelImpl | undefined,
|
|
165
165
|
) {
|
|
166
166
|
this.addWriteDep(binding);
|
|
167
167
|
return next?.delete(binding, options);
|
package/src/data/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./dependency-tracker";
|
|
2
|
+
export * from "./model";
|
|
3
|
+
export * from "./noop-model";
|
|
4
|
+
export * from "./local-model";
|
package/src/data/local-model.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import get from
|
|
2
|
-
import { setIn, omit, removeAt } from
|
|
3
|
-
import type { BindingInstance } from
|
|
4
|
-
import type { BatchSetTransaction, DataModelImpl, Updates } from
|
|
1
|
+
import get from "dlv";
|
|
2
|
+
import { setIn, omit, removeAt } from "timm";
|
|
3
|
+
import type { BindingInstance } from "../binding";
|
|
4
|
+
import type { BatchSetTransaction, DataModelImpl, Updates } from "./model";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A data model that stores data in an in-memory JS object
|
|
@@ -50,13 +50,13 @@ export class LocalModel implements DataModelImpl {
|
|
|
50
50
|
this.model = setIn(
|
|
51
51
|
this.model,
|
|
52
52
|
parentBinding.asArray(),
|
|
53
|
-
removeAt(parentValue, binding.key() as number)
|
|
53
|
+
removeAt(parentValue, binding.key() as number),
|
|
54
54
|
) as any;
|
|
55
55
|
} else {
|
|
56
56
|
this.model = setIn(
|
|
57
57
|
this.model,
|
|
58
58
|
parentBinding.asArray(),
|
|
59
|
-
omit(parentValue, binding.key() as string)
|
|
59
|
+
omit(parentValue, binding.key() as string),
|
|
60
60
|
) as any;
|
|
61
61
|
}
|
|
62
62
|
}
|
package/src/data/model.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SyncHook } from
|
|
2
|
-
import type { BindingLike, BindingFactory } from
|
|
3
|
-
import { BindingInstance, isBinding } from
|
|
4
|
-
import { NOOP_MODEL } from
|
|
1
|
+
import { SyncHook } from "tapable-ts";
|
|
2
|
+
import type { BindingLike, BindingFactory } from "../binding";
|
|
3
|
+
import { BindingInstance, isBinding } from "../binding";
|
|
4
|
+
import { NOOP_MODEL } from "./noop-model";
|
|
5
5
|
|
|
6
6
|
export const ROOT_BINDING = new BindingInstance([]);
|
|
7
7
|
export type BatchSetTransaction = [BindingInstance, any][];
|
|
@@ -72,19 +72,19 @@ export interface DataModelMiddleware {
|
|
|
72
72
|
set(
|
|
73
73
|
transaction: BatchSetTransaction,
|
|
74
74
|
options?: DataModelOptions,
|
|
75
|
-
next?: DataModelImpl
|
|
75
|
+
next?: DataModelImpl,
|
|
76
76
|
): Updates;
|
|
77
77
|
|
|
78
78
|
get(
|
|
79
79
|
binding: BindingInstance,
|
|
80
80
|
options?: DataModelOptions,
|
|
81
|
-
next?: DataModelImpl
|
|
81
|
+
next?: DataModelImpl,
|
|
82
82
|
): any;
|
|
83
83
|
|
|
84
84
|
delete?(
|
|
85
85
|
binding: BindingInstance,
|
|
86
86
|
options?: DataModelOptions,
|
|
87
|
-
next?: DataModelImpl
|
|
87
|
+
next?: DataModelImpl,
|
|
88
88
|
): void;
|
|
89
89
|
|
|
90
90
|
reset?(): void;
|
|
@@ -93,12 +93,12 @@ export interface DataModelMiddleware {
|
|
|
93
93
|
/** Wrap the inputs of the DataModel with calls to parse raw binding inputs */
|
|
94
94
|
export function withParser<Options = unknown>(
|
|
95
95
|
model: DataModelImpl<Options>,
|
|
96
|
-
parseBinding: BindingFactory
|
|
96
|
+
parseBinding: BindingFactory,
|
|
97
97
|
): DataModelWithParser<Options> {
|
|
98
98
|
/** Parse something into a binding if it requires it */
|
|
99
99
|
function maybeParse(
|
|
100
100
|
binding: BindingLike,
|
|
101
|
-
readOnly: boolean
|
|
101
|
+
readOnly: boolean,
|
|
102
102
|
): BindingInstance {
|
|
103
103
|
const parsed = isBinding(binding)
|
|
104
104
|
? binding
|
|
@@ -109,7 +109,7 @@ export function withParser<Options = unknown>(
|
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
if (!parsed) {
|
|
112
|
-
throw new Error(
|
|
112
|
+
throw new Error("Unable to parse binding");
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
return parsed;
|
|
@@ -122,7 +122,7 @@ export function withParser<Options = unknown>(
|
|
|
122
122
|
set(transaction, options?: Options) {
|
|
123
123
|
return model.set(
|
|
124
124
|
transaction.map(([key, val]) => [maybeParse(key, false), val]),
|
|
125
|
-
options
|
|
125
|
+
options,
|
|
126
126
|
);
|
|
127
127
|
},
|
|
128
128
|
delete(binding, options?: Options) {
|
|
@@ -135,7 +135,7 @@ export function withParser<Options = unknown>(
|
|
|
135
135
|
export function toModel(
|
|
136
136
|
middleware: DataModelMiddleware,
|
|
137
137
|
defaultOptions?: DataModelOptions,
|
|
138
|
-
next?: DataModelImpl
|
|
138
|
+
next?: DataModelImpl,
|
|
139
139
|
): DataModelImpl {
|
|
140
140
|
if (!next) {
|
|
141
141
|
return middleware as DataModelImpl;
|
|
@@ -178,7 +178,7 @@ export type DataPipeline = Array<DataModelMiddleware | DataModelImpl>;
|
|
|
178
178
|
* Given a set of steps in a pipeline, create the effective data-model
|
|
179
179
|
*/
|
|
180
180
|
export function constructModelForPipeline(
|
|
181
|
-
pipeline: DataPipeline
|
|
181
|
+
pipeline: DataPipeline,
|
|
182
182
|
): DataModelImpl {
|
|
183
183
|
if (pipeline.length === 0) {
|
|
184
184
|
return NOOP_MODEL;
|
|
@@ -193,7 +193,7 @@ export function constructModelForPipeline(
|
|
|
193
193
|
const model: DataModelImpl =
|
|
194
194
|
pipeline.reduce<DataModelImpl | undefined>(
|
|
195
195
|
(nextModel, middleware) => toModel(middleware, options, nextModel),
|
|
196
|
-
undefined
|
|
196
|
+
undefined,
|
|
197
197
|
) ?? NOOP_MODEL;
|
|
198
198
|
|
|
199
199
|
return model;
|
|
@@ -238,7 +238,7 @@ export class PipelinedDataModel implements DataModelImpl {
|
|
|
238
238
|
|
|
239
239
|
public reset(model = {}) {
|
|
240
240
|
this.pipeline.forEach((middleware) => {
|
|
241
|
-
if (
|
|
241
|
+
if ("reset" in middleware) {
|
|
242
242
|
middleware.reset?.();
|
|
243
243
|
}
|
|
244
244
|
});
|
|
@@ -248,11 +248,11 @@ export class PipelinedDataModel implements DataModelImpl {
|
|
|
248
248
|
|
|
249
249
|
public set(
|
|
250
250
|
transaction: BatchSetTransaction,
|
|
251
|
-
options?: DataModelOptions
|
|
251
|
+
options?: DataModelOptions,
|
|
252
252
|
): Updates {
|
|
253
253
|
const appliedTransaction = this.effectiveDataModel.set(
|
|
254
254
|
transaction,
|
|
255
|
-
options
|
|
255
|
+
options,
|
|
256
256
|
);
|
|
257
257
|
this.hooks.onSet.call(transaction);
|
|
258
258
|
return appliedTransaction;
|
package/src/data/noop-model.ts
CHANGED