@jbrowse/mobx-state-tree 5.6.10 → 5.7.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/dist/core/action.js.map +1 -1
- package/dist/core/actionContext.js.map +1 -1
- package/dist/core/flow.js.map +1 -1
- package/dist/core/json-patch.js.map +1 -1
- package/dist/core/mst-operations.js.map +1 -1
- package/dist/core/node/BaseNode.js.map +1 -1
- package/dist/core/node/Hook.js.map +1 -1
- package/dist/core/node/create-node.js.map +1 -1
- package/dist/core/node/identifier-cache.js.map +1 -1
- package/dist/core/node/livelinessChecking.js.map +1 -1
- package/dist/core/node/node-utils.js.map +1 -1
- package/dist/core/node/object-node.d.ts +3 -1
- package/dist/core/node/object-node.js +2 -1
- package/dist/core/node/object-node.js.map +1 -1
- package/dist/core/node/scalar-node.d.ts +3 -1
- package/dist/core/node/scalar-node.js +2 -1
- package/dist/core/node/scalar-node.js.map +1 -1
- package/dist/core/process.js.map +1 -1
- package/dist/core/type/type-checker.js.map +1 -1
- package/dist/core/type/type.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/middlewares/create-action-tracking-middleware.js.map +1 -1
- package/dist/middlewares/createActionTrackingMiddleware2.js.map +1 -1
- package/dist/middlewares/on-action.js.map +1 -1
- package/dist/package.json +1 -0
- package/dist/types/complex-types/array.d.ts +2 -1
- package/dist/types/complex-types/array.js +2 -1
- package/dist/types/complex-types/array.js.map +1 -1
- package/dist/types/complex-types/map.d.ts +2 -1
- package/dist/types/complex-types/map.js +2 -1
- package/dist/types/complex-types/map.js.map +1 -1
- package/dist/types/complex-types/model.d.ts +2 -1
- package/dist/types/complex-types/model.js +2 -1
- package/dist/types/complex-types/model.js.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/primitives.d.ts +2 -1
- package/dist/types/primitives.js +2 -1
- package/dist/types/primitives.js.map +1 -1
- package/dist/types/utility-types/custom.d.ts +2 -1
- package/dist/types/utility-types/custom.js +2 -1
- package/dist/types/utility-types/custom.js.map +1 -1
- package/dist/types/utility-types/enumeration.js.map +1 -1
- package/dist/types/utility-types/frozen.d.ts +2 -1
- package/dist/types/utility-types/frozen.js +2 -1
- package/dist/types/utility-types/frozen.js.map +1 -1
- package/dist/types/utility-types/identifier.d.ts +2 -1
- package/dist/types/utility-types/identifier.js +2 -1
- package/dist/types/utility-types/identifier.js.map +1 -1
- package/dist/types/utility-types/late.js +2 -1
- package/dist/types/utility-types/late.js.map +1 -1
- package/dist/types/utility-types/lazy.d.ts +2 -1
- package/dist/types/utility-types/lazy.js +2 -1
- package/dist/types/utility-types/lazy.js.map +1 -1
- package/dist/types/utility-types/literal.d.ts +2 -1
- package/dist/types/utility-types/literal.js +2 -1
- package/dist/types/utility-types/literal.js.map +1 -1
- package/dist/types/utility-types/maybe.js.map +1 -1
- package/dist/types/utility-types/optional.d.ts +2 -1
- package/dist/types/utility-types/optional.js +2 -1
- package/dist/types/utility-types/optional.js.map +1 -1
- package/dist/types/utility-types/reference.d.ts +2 -1
- package/dist/types/utility-types/reference.js +2 -1
- package/dist/types/utility-types/reference.js.map +1 -1
- package/dist/types/utility-types/refinement.js +2 -1
- package/dist/types/utility-types/refinement.js.map +1 -1
- package/dist/types/utility-types/resilient.js +2 -1
- package/dist/types/utility-types/resilient.js.map +1 -1
- package/dist/types/utility-types/snapshotProcessor.js +3 -2
- package/dist/types/utility-types/snapshotProcessor.js.map +1 -1
- package/dist/types/utility-types/union.d.ts +2 -1
- package/dist/types/utility-types/union.js +2 -1
- package/dist/types/utility-types/union.js.map +1 -1
- package/dist/utils.js.map +1 -1
- package/esm/core/action.d.ts +87 -0
- package/esm/core/action.js +219 -0
- package/esm/core/action.js.map +1 -0
- package/esm/core/actionContext.d.ts +27 -0
- package/esm/core/actionContext.js +37 -0
- package/esm/core/actionContext.js.map +1 -0
- package/esm/core/flow.d.ts +69 -0
- package/esm/core/flow.js +173 -0
- package/esm/core/flow.js.map +1 -0
- package/esm/core/json-patch.d.ts +46 -0
- package/esm/core/json-patch.js +125 -0
- package/esm/core/json-patch.js.map +1 -0
- package/esm/core/mst-operations.d.ts +459 -0
- package/esm/core/mst-operations.js +844 -0
- package/esm/core/mst-operations.js.map +1 -0
- package/esm/core/node/BaseNode.d.ts +62 -0
- package/esm/core/node/BaseNode.js +148 -0
- package/esm/core/node/BaseNode.js.map +1 -0
- package/esm/core/node/Hook.d.ts +17 -0
- package/esm/core/node/Hook.js +12 -0
- package/esm/core/node/Hook.js.map +1 -0
- package/esm/core/node/create-node.d.ts +16 -0
- package/esm/core/node/create-node.js +36 -0
- package/esm/core/node/create-node.js.map +1 -0
- package/esm/core/node/identifier-cache.d.ts +19 -0
- package/esm/core/node/identifier-cache.js +111 -0
- package/esm/core/node/identifier-cache.js.map +1 -0
- package/esm/core/node/livelinessChecking.d.ts +37 -0
- package/esm/core/node/livelinessChecking.js +33 -0
- package/esm/core/node/livelinessChecking.js.map +1 -0
- package/esm/core/node/node-utils.d.ts +83 -0
- package/esm/core/node/node-utils.js +153 -0
- package/esm/core/node/node-utils.js.map +1 -0
- package/esm/core/node/object-node.d.ts +101 -0
- package/esm/core/node/object-node.js +542 -0
- package/esm/core/node/object-node.js.map +1 -0
- package/esm/core/node/scalar-node.d.ts +21 -0
- package/esm/core/node/scalar-node.js +86 -0
- package/esm/core/node/scalar-node.js.map +1 -0
- package/esm/core/process.d.ts +50 -0
- package/esm/core/process.js +35 -0
- package/esm/core/process.js.map +1 -0
- package/esm/core/type/type-checker.d.ts +69 -0
- package/esm/core/type/type-checker.js +144 -0
- package/esm/core/type/type-checker.js.map +1 -0
- package/esm/core/type/type.d.ts +317 -0
- package/esm/core/type/type.js +243 -0
- package/esm/core/type/type.js.map +1 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -0
- package/esm/internal.d.ts +39 -0
- package/esm/internal.js +44 -0
- package/esm/internal.js.map +1 -0
- package/esm/middlewares/create-action-tracking-middleware.d.ts +24 -0
- package/esm/middlewares/create-action-tracking-middleware.js +78 -0
- package/esm/middlewares/create-action-tracking-middleware.js.map +1 -0
- package/esm/middlewares/createActionTrackingMiddleware2.d.ts +34 -0
- package/esm/middlewares/createActionTrackingMiddleware2.js +130 -0
- package/esm/middlewares/createActionTrackingMiddleware2.js.map +1 -0
- package/esm/middlewares/on-action.d.ts +87 -0
- package/esm/middlewares/on-action.js +210 -0
- package/esm/middlewares/on-action.js.map +1 -0
- package/esm/types/complex-types/array.d.ts +81 -0
- package/esm/types/complex-types/array.js +347 -0
- package/esm/types/complex-types/array.js.map +1 -0
- package/esm/types/complex-types/map.d.ts +111 -0
- package/esm/types/complex-types/map.js +356 -0
- package/esm/types/complex-types/map.js.map +1 -0
- package/esm/types/complex-types/model.d.ts +193 -0
- package/esm/types/complex-types/model.js +471 -0
- package/esm/types/complex-types/model.js.map +1 -0
- package/esm/types/index.d.ts +33 -0
- package/esm/types/index.js +35 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/primitives.d.ts +125 -0
- package/esm/types/primitives.js +177 -0
- package/esm/types/primitives.js.map +1 -0
- package/esm/types/utility-types/custom.d.ts +75 -0
- package/esm/types/utility-types/custom.js +106 -0
- package/esm/types/utility-types/custom.js.map +1 -0
- package/esm/types/utility-types/enumeration.d.ts +5 -0
- package/esm/types/utility-types/enumeration.js +31 -0
- package/esm/types/utility-types/enumeration.js.map +1 -0
- package/esm/types/utility-types/frozen.d.ts +24 -0
- package/esm/types/utility-types/frozen.js +92 -0
- package/esm/types/utility-types/frozen.js.map +1 -0
- package/esm/types/utility-types/identifier.d.ts +87 -0
- package/esm/types/utility-types/identifier.js +121 -0
- package/esm/types/utility-types/identifier.js.map +1 -0
- package/esm/types/utility-types/late.d.ts +10 -0
- package/esm/types/utility-types/late.js +106 -0
- package/esm/types/utility-types/late.js.map +1 -0
- package/esm/types/utility-types/lazy.d.ts +23 -0
- package/esm/types/utility-types/lazy.js +72 -0
- package/esm/types/utility-types/lazy.js.map +1 -0
- package/esm/types/utility-types/literal.d.ts +38 -0
- package/esm/types/utility-types/literal.js +58 -0
- package/esm/types/utility-types/literal.js.map +1 -0
- package/esm/types/utility-types/maybe.d.ts +26 -0
- package/esm/types/utility-types/maybe.js +26 -0
- package/esm/types/utility-types/maybe.js.map +1 -0
- package/esm/types/utility-types/optional.d.ts +42 -0
- package/esm/types/utility-types/optional.js +135 -0
- package/esm/types/utility-types/optional.js.map +1 -0
- package/esm/types/utility-types/reference.d.ts +90 -0
- package/esm/types/utility-types/reference.js +383 -0
- package/esm/types/utility-types/reference.js.map +1 -0
- package/esm/types/utility-types/refinement.d.ts +10 -0
- package/esm/types/utility-types/refinement.js +82 -0
- package/esm/types/utility-types/refinement.js.map +1 -0
- package/esm/types/utility-types/resilient.d.ts +18 -0
- package/esm/types/utility-types/resilient.js +118 -0
- package/esm/types/utility-types/resilient.js.map +1 -0
- package/esm/types/utility-types/snapshotProcessor.d.ts +63 -0
- package/esm/types/utility-types/snapshotProcessor.js +159 -0
- package/esm/types/utility-types/snapshotProcessor.js.map +1 -0
- package/esm/types/utility-types/union.d.ts +78 -0
- package/esm/types/utility-types/union.js +240 -0
- package/esm/types/utility-types/union.js.map +1 -0
- package/esm/utils.d.ts +230 -0
- package/esm/utils.js +449 -0
- package/esm/utils.js.map +1 -0
- package/package.json +23 -22
- package/dist/mobx-state-tree.js +0 -86
- package/dist/mobx-state-tree.js.map +0 -1
- package/dist/mobx-state-tree.module.js +0 -84
- package/dist/mobx-state-tree.module.js.map +0 -1
package/esm/utils.js
ADDED
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import { _getGlobalState, defineProperty as mobxDefineProperty, isObservableArray, isObservableObject } from "mobx";
|
|
2
|
+
const plainObjectString = Object.toString();
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export const EMPTY_ARRAY = Object.freeze([]);
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export const EMPTY_OBJECT = Object.freeze({});
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export const mobxShallow = _getGlobalState().useProxies
|
|
18
|
+
? { deep: false }
|
|
19
|
+
: { deep: false, proxy: false };
|
|
20
|
+
Object.freeze(mobxShallow);
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
export function fail(message = "Illegal state") {
|
|
26
|
+
return new Error("[mobx-state-tree] " + message);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export function identity(_) {
|
|
33
|
+
return _;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
* @hidden
|
|
38
|
+
*/
|
|
39
|
+
export function noop() { }
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
* @hidden
|
|
43
|
+
*/
|
|
44
|
+
export const isInteger = Number.isInteger;
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
export function isFloat(val) {
|
|
50
|
+
return Number(val) === val && val % 1 !== 0;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
* @hidden
|
|
55
|
+
*/
|
|
56
|
+
export function isFinite(val) {
|
|
57
|
+
return Number.isFinite(val);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
export function isArray(val) {
|
|
64
|
+
return Array.isArray(val) || isObservableArray(val);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
* @hidden
|
|
69
|
+
*/
|
|
70
|
+
export function asArray(val) {
|
|
71
|
+
if (!val) {
|
|
72
|
+
return EMPTY_ARRAY;
|
|
73
|
+
}
|
|
74
|
+
if (isArray(val)) {
|
|
75
|
+
return val;
|
|
76
|
+
}
|
|
77
|
+
return [val];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
* @hidden
|
|
82
|
+
*/
|
|
83
|
+
export function extend(a, ...b) {
|
|
84
|
+
for (let i = 0; i < b.length; i++) {
|
|
85
|
+
const current = b[i];
|
|
86
|
+
for (const key in current) {
|
|
87
|
+
a[key] = current[key];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return a;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
* @hidden
|
|
95
|
+
*/
|
|
96
|
+
export function isPlainObject(value) {
|
|
97
|
+
if (value === null || typeof value !== "object") {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
const proto = Object.getPrototypeOf(value);
|
|
101
|
+
if (proto == null) {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
return proto.constructor?.toString() === plainObjectString;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @internal
|
|
108
|
+
* @hidden
|
|
109
|
+
*/
|
|
110
|
+
export function isMutable(value) {
|
|
111
|
+
return (value !== null &&
|
|
112
|
+
typeof value === "object" &&
|
|
113
|
+
!(value instanceof Date) &&
|
|
114
|
+
!(value instanceof RegExp));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* @internal
|
|
118
|
+
* @hidden
|
|
119
|
+
*/
|
|
120
|
+
export function isPrimitive(value, includeDate = true) {
|
|
121
|
+
return (value === null ||
|
|
122
|
+
value === undefined ||
|
|
123
|
+
typeof value === "string" ||
|
|
124
|
+
typeof value === "number" ||
|
|
125
|
+
typeof value === "boolean" ||
|
|
126
|
+
(includeDate && value instanceof Date));
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @internal
|
|
130
|
+
* @hidden
|
|
131
|
+
* Freeze a value and return it (if not in production)
|
|
132
|
+
*/
|
|
133
|
+
export function freeze(value) {
|
|
134
|
+
if (!devMode()) {
|
|
135
|
+
return value;
|
|
136
|
+
}
|
|
137
|
+
return isPrimitive(value) || isObservableArray(value)
|
|
138
|
+
? value
|
|
139
|
+
: Object.freeze(value);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @internal
|
|
143
|
+
* @hidden
|
|
144
|
+
* Recursively freeze a value (if not in production)
|
|
145
|
+
*/
|
|
146
|
+
export function deepFreeze(value) {
|
|
147
|
+
if (!devMode()) {
|
|
148
|
+
return value;
|
|
149
|
+
}
|
|
150
|
+
freeze(value);
|
|
151
|
+
if (isPlainObject(value)) {
|
|
152
|
+
Object.keys(value).forEach(propKey => {
|
|
153
|
+
if (!isPrimitive(value[propKey]) &&
|
|
154
|
+
!Object.isFrozen(value[propKey])) {
|
|
155
|
+
deepFreeze(value[propKey]);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return value;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @internal
|
|
163
|
+
* @hidden
|
|
164
|
+
*/
|
|
165
|
+
export function isSerializable(value) {
|
|
166
|
+
return typeof value !== "function";
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* @internal
|
|
170
|
+
* @hidden
|
|
171
|
+
*/
|
|
172
|
+
export function defineProperty(object, key, descriptor) {
|
|
173
|
+
if (isObservableObject(object)) {
|
|
174
|
+
mobxDefineProperty(object, key, descriptor);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
Object.defineProperty(object, key, descriptor);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* @internal
|
|
182
|
+
* @hidden
|
|
183
|
+
*/
|
|
184
|
+
export function addHiddenFinalProp(object, propName, value) {
|
|
185
|
+
defineProperty(object, propName, {
|
|
186
|
+
enumerable: false,
|
|
187
|
+
writable: false,
|
|
188
|
+
configurable: true,
|
|
189
|
+
value
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* @internal
|
|
194
|
+
* @hidden
|
|
195
|
+
*/
|
|
196
|
+
export function addHiddenWritableProp(object, propName, value) {
|
|
197
|
+
defineProperty(object, propName, {
|
|
198
|
+
enumerable: false,
|
|
199
|
+
writable: true,
|
|
200
|
+
configurable: true,
|
|
201
|
+
value
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* @internal
|
|
206
|
+
* @hidden
|
|
207
|
+
*/
|
|
208
|
+
class EventHandler {
|
|
209
|
+
handlers = [];
|
|
210
|
+
emitting = false;
|
|
211
|
+
pendingUnregisters = null;
|
|
212
|
+
get hasSubscribers() {
|
|
213
|
+
return this.handlers.length > 0;
|
|
214
|
+
}
|
|
215
|
+
register(fn, atTheBeginning = false) {
|
|
216
|
+
if (atTheBeginning) {
|
|
217
|
+
this.handlers.unshift(fn);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
this.handlers.push(fn);
|
|
221
|
+
}
|
|
222
|
+
return () => {
|
|
223
|
+
this.unregister(fn);
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
has(fn) {
|
|
227
|
+
return this.handlers.indexOf(fn) >= 0;
|
|
228
|
+
}
|
|
229
|
+
unregister(fn) {
|
|
230
|
+
if (this.emitting) {
|
|
231
|
+
// defer unregistration until emit is done
|
|
232
|
+
if (!this.pendingUnregisters) {
|
|
233
|
+
this.pendingUnregisters = [];
|
|
234
|
+
}
|
|
235
|
+
this.pendingUnregisters.push(fn);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
const index = this.handlers.indexOf(fn);
|
|
239
|
+
if (index >= 0) {
|
|
240
|
+
this.handlers.splice(index, 1);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
clear() {
|
|
244
|
+
this.handlers.length = 0;
|
|
245
|
+
}
|
|
246
|
+
emit(...args) {
|
|
247
|
+
// use emitting flag to defer unregistrations instead of copying array
|
|
248
|
+
this.emitting = true;
|
|
249
|
+
try {
|
|
250
|
+
for (const f of this.handlers) {
|
|
251
|
+
f(...args);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
finally {
|
|
255
|
+
this.emitting = false;
|
|
256
|
+
// process any deferred unregistrations
|
|
257
|
+
if (this.pendingUnregisters) {
|
|
258
|
+
for (const fn of this.pendingUnregisters) {
|
|
259
|
+
const index = this.handlers.indexOf(fn);
|
|
260
|
+
if (index >= 0) {
|
|
261
|
+
this.handlers.splice(index, 1);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
this.pendingUnregisters = null;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @internal
|
|
271
|
+
* @hidden
|
|
272
|
+
*/
|
|
273
|
+
export class EventHandlers {
|
|
274
|
+
eventHandlers;
|
|
275
|
+
hasSubscribers(event) {
|
|
276
|
+
const handler = this.eventHandlers && this.eventHandlers[event];
|
|
277
|
+
return !!handler && handler.hasSubscribers;
|
|
278
|
+
}
|
|
279
|
+
register(event, fn, atTheBeginning = false) {
|
|
280
|
+
if (!this.eventHandlers) {
|
|
281
|
+
this.eventHandlers = {};
|
|
282
|
+
}
|
|
283
|
+
let handler = this.eventHandlers[event];
|
|
284
|
+
if (!handler) {
|
|
285
|
+
handler = this.eventHandlers[event] = new EventHandler();
|
|
286
|
+
}
|
|
287
|
+
return handler.register(fn, atTheBeginning);
|
|
288
|
+
}
|
|
289
|
+
has(event, fn) {
|
|
290
|
+
const handler = this.eventHandlers && this.eventHandlers[event];
|
|
291
|
+
return !!handler && handler.has(fn);
|
|
292
|
+
}
|
|
293
|
+
unregister(event, fn) {
|
|
294
|
+
const handler = this.eventHandlers && this.eventHandlers[event];
|
|
295
|
+
if (handler) {
|
|
296
|
+
handler.unregister(fn);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
clear(event) {
|
|
300
|
+
if (this.eventHandlers) {
|
|
301
|
+
delete this.eventHandlers[event];
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
clearAll() {
|
|
305
|
+
this.eventHandlers = undefined;
|
|
306
|
+
}
|
|
307
|
+
emit(event, ...args) {
|
|
308
|
+
const handler = this.eventHandlers && this.eventHandlers[event];
|
|
309
|
+
if (handler) {
|
|
310
|
+
;
|
|
311
|
+
handler.emit(...args);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
const prototypeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
316
|
+
/**
|
|
317
|
+
* @internal
|
|
318
|
+
* @hidden
|
|
319
|
+
*/
|
|
320
|
+
export function hasOwnProperty(object, propName) {
|
|
321
|
+
return prototypeHasOwnProperty.call(object, propName);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* @internal
|
|
325
|
+
* @hidden
|
|
326
|
+
*/
|
|
327
|
+
export function argsToArray(args) {
|
|
328
|
+
const res = new Array(args.length);
|
|
329
|
+
for (let i = 0; i < args.length; i++) {
|
|
330
|
+
res[i] = args[i];
|
|
331
|
+
}
|
|
332
|
+
return res;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* @internal
|
|
336
|
+
* @hidden
|
|
337
|
+
*/
|
|
338
|
+
export function stringStartsWith(str, beginning) {
|
|
339
|
+
return str.indexOf(beginning) === 0;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* @internal
|
|
343
|
+
* @hidden
|
|
344
|
+
*/
|
|
345
|
+
export const deprecated = function (id, message) {
|
|
346
|
+
// skip if running production
|
|
347
|
+
if (!devMode()) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
// warn if hasn't been warned before
|
|
351
|
+
if (deprecated.ids && !deprecated.ids.hasOwnProperty(id)) {
|
|
352
|
+
warnError("Deprecation warning: " + message);
|
|
353
|
+
}
|
|
354
|
+
// mark as warned to avoid duplicate warn message
|
|
355
|
+
if (deprecated.ids) {
|
|
356
|
+
deprecated.ids[id] = true;
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
deprecated.ids = {};
|
|
360
|
+
/**
|
|
361
|
+
* @internal
|
|
362
|
+
* @hidden
|
|
363
|
+
*/
|
|
364
|
+
export function warnError(msg) {
|
|
365
|
+
console.warn(new Error(`[mobx-state-tree] ${msg}`));
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* @internal
|
|
369
|
+
* @hidden
|
|
370
|
+
*/
|
|
371
|
+
export function isTypeCheckingEnabled() {
|
|
372
|
+
return (devMode() ||
|
|
373
|
+
(typeof process !== "undefined" &&
|
|
374
|
+
process.env &&
|
|
375
|
+
process.env.ENABLE_TYPE_CHECK === "true"));
|
|
376
|
+
}
|
|
377
|
+
let _devMode = process.env.NODE_ENV !== "production";
|
|
378
|
+
/**
|
|
379
|
+
* @internal
|
|
380
|
+
* @hidden
|
|
381
|
+
*/
|
|
382
|
+
export function devMode() {
|
|
383
|
+
return _devMode;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* @internal
|
|
387
|
+
* @hidden
|
|
388
|
+
*/
|
|
389
|
+
export function setDevMode(value) {
|
|
390
|
+
_devMode = value;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* @internal
|
|
394
|
+
* @hidden
|
|
395
|
+
*/
|
|
396
|
+
export function assertArg(value, fn, typeName, argNumber) {
|
|
397
|
+
if (devMode()) {
|
|
398
|
+
if (!fn(value)) {
|
|
399
|
+
// istanbul ignore next
|
|
400
|
+
throw fail(`expected ${typeName} as argument ${asArray(argNumber).join(" or ")}, got ${value} instead`);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* @internal
|
|
406
|
+
* @hidden
|
|
407
|
+
*/
|
|
408
|
+
export function assertIsFunction(value, argNumber) {
|
|
409
|
+
assertArg(value, fn => typeof fn === "function", "function", argNumber);
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* @internal
|
|
413
|
+
* @hidden
|
|
414
|
+
*/
|
|
415
|
+
export function assertIsNumber(value, argNumber, min, max) {
|
|
416
|
+
assertArg(value, n => typeof n === "number", "number", argNumber);
|
|
417
|
+
if (min !== undefined) {
|
|
418
|
+
assertArg(value, n => n >= min, `number greater than ${min}`, argNumber);
|
|
419
|
+
}
|
|
420
|
+
if (max !== undefined) {
|
|
421
|
+
assertArg(value, n => n <= max, `number lesser than ${max}`, argNumber);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* @internal
|
|
426
|
+
* @hidden
|
|
427
|
+
*/
|
|
428
|
+
export function assertIsString(value, argNumber, canBeEmpty = true) {
|
|
429
|
+
assertArg(value, s => typeof s === "string", "string", argNumber);
|
|
430
|
+
if (!canBeEmpty) {
|
|
431
|
+
assertArg(value, s => s !== "", "not empty string", argNumber);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* @internal
|
|
436
|
+
* @hidden
|
|
437
|
+
*/
|
|
438
|
+
export function setImmediateWithFallback(fn) {
|
|
439
|
+
if (typeof queueMicrotask === "function") {
|
|
440
|
+
queueMicrotask(fn);
|
|
441
|
+
}
|
|
442
|
+
else if (typeof setImmediate === "function") {
|
|
443
|
+
setImmediate(fn);
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
setTimeout(fn, 1);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
//# sourceMappingURL=utils.js.map
|
package/esm/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,cAAc,IAAI,kBAAkB,EACpC,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,MAAM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Aa,EACb,SAA4B,EAC5B,UAAU,GAAG,IAAI;IAEjB,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;IACjE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,SAAS,CAAC,CAAA;IAChE,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,EAA4B;IACnE,IAAI,OAAO,cAAc,KAAK,UAAU,EAAE,CAAC;QACzC,cAAc,CAAC,EAAE,CAAC,CAAA;IACpB,CAAC;SAAM,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE,CAAC;QAC9C,YAAY,CAAC,EAAE,CAAC,CAAA;IAClB,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IACnB,CAAC;AACH,CAAC","sourcesContent":["import {\n _getGlobalState,\n defineProperty as mobxDefineProperty,\n isObservableArray,\n isObservableObject\n} from \"mobx\"\n\nimport type { Primitives } from \"./core/type/type.ts\"\n\nconst plainObjectString = Object.toString()\n\n/**\n * @internal\n * @hidden\n */\nexport const EMPTY_ARRAY: ReadonlyArray<any> = Object.freeze([])\n\n/**\n * @internal\n * @hidden\n */\n\nexport const EMPTY_OBJECT: {} = Object.freeze({})\n\n/**\n * @internal\n * @hidden\n */\nexport const mobxShallow = _getGlobalState().useProxies\n ? { deep: false }\n : { deep: false, proxy: false }\nObject.freeze(mobxShallow)\n\n/**\n * A generic disposer.\n */\nexport type IDisposer = () => void\n\n/**\n * @internal\n * @hidden\n */\nexport function fail(message = \"Illegal state\"): Error {\n return new Error(\"[mobx-state-tree] \" + message)\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function identity(_: any): any {\n return _\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function noop() {}\n\n/**\n * @internal\n * @hidden\n */\nexport const isInteger = Number.isInteger\n\n/**\n * @internal\n * @hidden\n */\nexport function isFloat(val: any) {\n return Number(val) === val && val % 1 !== 0\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function isFinite(val: any) {\n return Number.isFinite(val)\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function isArray(val: any): val is any[] {\n return Array.isArray(val) || isObservableArray(val)\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function asArray<T>(\n val: undefined | null | T | T[] | ReadonlyArray<T>\n): T[] {\n if (!val) {\n return EMPTY_ARRAY as any as T[]\n }\n if (isArray(val)) {\n return val as T[]\n }\n return [val] as T[]\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function extend<A, B>(a: A, b: B): A & B\n/**\n * @internal\n * @hidden\n */\nexport function extend<A, B, C>(a: A, b: B, c: C): A & B & C\n/**\n * @internal\n * @hidden\n */\nexport function extend<A, B, C, D>(a: A, b: B, c: C, d: D): A & B & C & D\n/**\n * @internal\n * @hidden\n */\nexport function extend(a: any, ...b: any[]): any\n/**\n * @internal\n * @hidden\n */\nexport function extend(a: any, ...b: any[]) {\n for (let i = 0; i < b.length; i++) {\n const current = b[i]\n for (const key in current) {\n a[key] = current[key]\n }\n }\n return a\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function isPlainObject(value: any): value is { [k: string]: any } {\n if (value === null || typeof value !== \"object\") {\n return false\n }\n const proto = Object.getPrototypeOf(value)\n if (proto == null) {\n return true\n }\n return proto.constructor?.toString() === plainObjectString\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function isMutable(value: any) {\n return (\n value !== null &&\n typeof value === \"object\" &&\n !(value instanceof Date) &&\n !(value instanceof RegExp)\n )\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function isPrimitive(\n value: any,\n includeDate = true\n): value is Primitives {\n return (\n value === null ||\n value === undefined ||\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n (includeDate && value instanceof Date)\n )\n}\n\n/**\n * @internal\n * @hidden\n * Freeze a value and return it (if not in production)\n */\nexport function freeze<T>(value: T): T {\n if (!devMode()) {\n return value\n }\n return isPrimitive(value) || isObservableArray(value)\n ? value\n : Object.freeze(value)\n}\n\n/**\n * @internal\n * @hidden\n * Recursively freeze a value (if not in production)\n */\nexport function deepFreeze<T>(value: T): T {\n if (!devMode()) {\n return value\n }\n freeze(value)\n\n if (isPlainObject(value)) {\n Object.keys(value).forEach(propKey => {\n if (\n !isPrimitive((value as any)[propKey]) &&\n !Object.isFrozen((value as any)[propKey])\n ) {\n deepFreeze((value as any)[propKey])\n }\n })\n }\n\n return value\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function isSerializable(value: any) {\n return typeof value !== \"function\"\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function defineProperty(\n object: any,\n key: PropertyKey,\n descriptor: PropertyDescriptor\n) {\n if (isObservableObject(object)) {\n mobxDefineProperty(object, key, descriptor)\n } else {\n Object.defineProperty(object, key, descriptor)\n }\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function addHiddenFinalProp(object: any, propName: string, value: any) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value\n })\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function addHiddenWritableProp(\n object: any,\n propName: string,\n value: any\n) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value\n })\n}\n\n/**\n * @internal\n * @hidden\n */\nexport type ArgumentTypes<F extends Function> = F extends (\n ...args: infer A\n) => any\n ? A\n : never\n\n/**\n * @internal\n * @hidden\n */\nclass EventHandler<F extends Function> {\n private handlers: F[] = []\n private emitting = false\n private pendingUnregisters: F[] | null = null\n\n get hasSubscribers(): boolean {\n return this.handlers.length > 0\n }\n\n register(fn: F, atTheBeginning = false): IDisposer {\n if (atTheBeginning) {\n this.handlers.unshift(fn)\n } else {\n this.handlers.push(fn)\n }\n return () => {\n this.unregister(fn)\n }\n }\n\n has(fn: F): boolean {\n return this.handlers.indexOf(fn) >= 0\n }\n\n unregister(fn: F) {\n if (this.emitting) {\n // defer unregistration until emit is done\n if (!this.pendingUnregisters) {\n this.pendingUnregisters = []\n }\n this.pendingUnregisters.push(fn)\n return\n }\n const index = this.handlers.indexOf(fn)\n if (index >= 0) {\n this.handlers.splice(index, 1)\n }\n }\n\n clear() {\n this.handlers.length = 0\n }\n\n emit(...args: ArgumentTypes<F>) {\n // use emitting flag to defer unregistrations instead of copying array\n this.emitting = true\n try {\n for (const f of this.handlers) {\n f(...args)\n }\n } finally {\n this.emitting = false\n // process any deferred unregistrations\n if (this.pendingUnregisters) {\n for (const fn of this.pendingUnregisters) {\n const index = this.handlers.indexOf(fn)\n if (index >= 0) {\n this.handlers.splice(index, 1)\n }\n }\n this.pendingUnregisters = null\n }\n }\n }\n}\n\n/**\n * @internal\n * @hidden\n */\nexport class EventHandlers<E extends { [k: string]: Function }> {\n private eventHandlers?: { [k in keyof E]?: EventHandler<Function> }\n\n hasSubscribers(event: keyof E): boolean {\n const handler = this.eventHandlers && this.eventHandlers[event]\n return !!handler && handler!.hasSubscribers\n }\n\n register<N extends keyof E>(\n event: N,\n fn: E[N],\n atTheBeginning = false\n ): IDisposer {\n if (!this.eventHandlers) {\n this.eventHandlers = {}\n }\n let handler = this.eventHandlers[event]\n if (!handler) {\n handler = this.eventHandlers[event] = new EventHandler()\n }\n return handler.register(fn, atTheBeginning)\n }\n\n has<N extends keyof E>(event: N, fn: E[N]): boolean {\n const handler = this.eventHandlers && this.eventHandlers[event]\n return !!handler && handler!.has(fn)\n }\n\n unregister<N extends keyof E>(event: N, fn: E[N]) {\n const handler = this.eventHandlers && this.eventHandlers[event]\n if (handler) {\n handler!.unregister(fn)\n }\n }\n\n clear<N extends keyof E>(event: N) {\n if (this.eventHandlers) {\n delete this.eventHandlers[event]\n }\n }\n\n clearAll() {\n this.eventHandlers = undefined\n }\n\n emit<N extends keyof E>(event: N, ...args: ArgumentTypes<E[N]>) {\n const handler = this.eventHandlers && this.eventHandlers[event]\n if (handler) {\n ;(handler!.emit as any)(...args)\n }\n }\n}\n\nconst prototypeHasOwnProperty = Object.prototype.hasOwnProperty\n\n/**\n * @internal\n * @hidden\n */\nexport function hasOwnProperty(object: object, propName: string) {\n return prototypeHasOwnProperty.call(object, propName)\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function argsToArray(args: IArguments): any[] {\n const res = new Array(args.length)\n for (let i = 0; i < args.length; i++) {\n res[i] = args[i]\n }\n return res\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function stringStartsWith(str: string, beginning: string) {\n return str.indexOf(beginning) === 0\n}\n\n/**\n * @internal\n * @hidden\n */\nexport type DeprecatedFunction = Function & { ids?: { [id: string]: true } }\n\n/**\n * @internal\n * @hidden\n */\nexport const deprecated: DeprecatedFunction = function (\n id: string,\n message: string\n): void {\n // skip if running production\n if (!devMode()) {\n return\n }\n // warn if hasn't been warned before\n if (deprecated.ids && !deprecated.ids.hasOwnProperty(id)) {\n warnError(\"Deprecation warning: \" + message)\n }\n // mark as warned to avoid duplicate warn message\n if (deprecated.ids) {\n deprecated.ids[id] = true\n }\n}\ndeprecated.ids = {}\n\n/**\n * @internal\n * @hidden\n */\nexport function warnError(msg: string) {\n console.warn(new Error(`[mobx-state-tree] ${msg}`))\n}\n/**\n * @internal\n * @hidden\n */\nexport function isTypeCheckingEnabled() {\n return (\n devMode() ||\n (typeof process !== \"undefined\" &&\n process.env &&\n process.env.ENABLE_TYPE_CHECK === \"true\")\n )\n}\n\nlet _devMode = process.env.NODE_ENV !== \"production\"\n\n/**\n * @internal\n * @hidden\n */\nexport function devMode() {\n return _devMode\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function setDevMode(value: boolean) {\n _devMode = value\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function assertArg<T>(\n value: T,\n fn: (value: T) => boolean,\n typeName: string,\n argNumber: number | number[]\n) {\n if (devMode()) {\n if (!fn(value)) {\n // istanbul ignore next\n throw fail(\n `expected ${typeName} as argument ${asArray(argNumber).join(\" or \")}, got ${value} instead`\n )\n }\n }\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function assertIsFunction(\n value: Function,\n argNumber: number | number[]\n) {\n assertArg(value, fn => typeof fn === \"function\", \"function\", argNumber)\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function assertIsNumber(\n value: number,\n argNumber: number | number[],\n min?: number,\n max?: number\n) {\n assertArg(value, n => typeof n === \"number\", \"number\", argNumber)\n if (min !== undefined) {\n assertArg(value, n => n >= min, `number greater than ${min}`, argNumber)\n }\n if (max !== undefined) {\n assertArg(value, n => n <= max, `number lesser than ${max}`, argNumber)\n }\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function assertIsString(\n value: string,\n argNumber: number | number[],\n canBeEmpty = true\n) {\n assertArg(value, s => typeof s === \"string\", \"string\", argNumber)\n if (!canBeEmpty) {\n assertArg(value, s => s !== \"\", \"not empty string\", argNumber)\n }\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function setImmediateWithFallback(fn: (...args: any[]) => void) {\n if (typeof queueMicrotask === \"function\") {\n queueMicrotask(fn)\n } else if (typeof setImmediate === \"function\") {\n setImmediate(fn)\n } else {\n setTimeout(fn, 1)\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/mobx-state-tree",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.1",
|
|
4
4
|
"description": "Fork of mobx-state-tree starting from v5.4.2 for use in jbrowse 2",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/GMOD/mobx-state-tree.git"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "dist/index.js",
|
|
8
12
|
"exports": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"import": "./dist/mobx-state-tree.module.js",
|
|
12
|
-
"require": "./dist/mobx-state-tree.js"
|
|
13
|
-
},
|
|
14
|
-
"./package.json": "./package.json"
|
|
13
|
+
"import": "./esm/index.js",
|
|
14
|
+
"require": "./dist/index.js"
|
|
15
15
|
},
|
|
16
16
|
"sideEffects": false,
|
|
17
|
+
"author": "Michel Weststrate",
|
|
18
|
+
"files": [
|
|
19
|
+
"esm",
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
17
22
|
"scripts": {
|
|
18
|
-
"
|
|
23
|
+
"clean": "rimraf esm dist",
|
|
19
24
|
"format": "prettier --write .",
|
|
20
|
-
"
|
|
25
|
+
"lint": "eslint --report-unused-disable-directives --max-warnings 0",
|
|
26
|
+
"prebuild": "pnpm clean",
|
|
27
|
+
"build:esm": "tsc --outDir esm",
|
|
28
|
+
"build:es5": "tsc --module commonjs --moduleResolution bundler --outDir dist",
|
|
29
|
+
"postbuild:es5": "echo '{\"type\": \"commonjs\"}' > dist/package.json",
|
|
30
|
+
"build": "pnpm build:esm && pnpm build:es5",
|
|
21
31
|
"test": "vitest",
|
|
22
32
|
"test-ci": "pnpm test:dev --run && pnpm test:prod --run",
|
|
23
33
|
"test:dev": "NODE_ENV=development vitest",
|
|
@@ -27,15 +37,6 @@
|
|
|
27
37
|
"preversion": "pnpm build && pnpm test-ci",
|
|
28
38
|
"postversion": "git push --follow-tags"
|
|
29
39
|
},
|
|
30
|
-
"repository": {
|
|
31
|
-
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/GMOD/mobx-state-tree.git"
|
|
33
|
-
},
|
|
34
|
-
"author": "Michel Weststrate",
|
|
35
|
-
"license": "MIT",
|
|
36
|
-
"files": [
|
|
37
|
-
"dist/"
|
|
38
|
-
],
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@eslint/js": "^10.0.1",
|
|
41
42
|
"@types/node": "^25.9.1",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"eslint-plugin-import": "^2.32.0",
|
|
44
45
|
"mobx": "^6.15.3",
|
|
45
46
|
"prettier": "^3.8.3",
|
|
46
|
-
"
|
|
47
|
+
"rimraf": "^6.0.1",
|
|
47
48
|
"spec.ts": "^1.1.3",
|
|
48
49
|
"typescript": "^6.0.3",
|
|
49
50
|
"typescript-eslint": "^8.59.4",
|
package/dist/mobx-state-tree.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isRefinementType = exports.isReferenceType = exports.isProtected = exports.isPrimitiveType = exports.isOptionalType = exports.isModelType = exports.isMapType = exports.isLiteralType = exports.isLateType = exports.isIdentifierType = exports.isFrozenType = exports.isArrayType = exports.isAlive = exports.isActionContextThisOrChildOf = exports.isActionContextChildOf = exports.hasParentOfType = exports.hasParent = exports.getType = exports.getSnapshot = exports.getRunningActionContext = exports.getRoot = exports.getRelativePath = exports.getPropertyMembers = exports.getPathParts = exports.getPath = exports.getParentOfType = exports.getParent = exports.getNodeId = exports.getMembers = exports.getLivelinessChecking = exports.getIdentifier = exports.getEnv = exports.getChildType = exports.flow = exports.escapeJsonPath = exports.detach = exports.destroy = exports.decorate = exports.createActionTrackingMiddleware = exports.createActionTrackingMiddleware2 = exports.clone = exports.castToSnapshot = exports.castToReferenceSnapshot = exports.castFlowReturn = exports.cast = exports.applySnapshot = exports.applyPatch = exports.applyAction = exports.addMiddleware = exports.addDisposer = void 0;
|
|
5
|
-
exports.setDevMode = exports.walk = exports.unprotect = exports.unescapeJsonPath = exports.t = exports.types = exports.typecheck = exports.tryResolve = exports.tryReference = exports.toGeneratorFunction = exports.toGenerator = exports.splitJsonPath = exports.setLivelynessChecking = exports.setLivelinessChecking = exports.resolvePath = exports.resolveIdentifier = exports.recordPatches = exports.recordActions = exports.protect = exports.process = exports.onSnapshot = exports.onPatch = exports.onAction = exports.joinJsonPath = exports.isValidReference = exports.isUnionType = exports.isType = exports.isStateTreeNode = exports.isRoot = void 0;
|
|
6
|
-
var internal_ts_1 = require("./internal.js");
|
|
7
|
-
Object.defineProperty(exports, "addDisposer", { enumerable: true, get: function () { return internal_ts_1.addDisposer; } });
|
|
8
|
-
Object.defineProperty(exports, "addMiddleware", { enumerable: true, get: function () { return internal_ts_1.addMiddleware; } });
|
|
9
|
-
Object.defineProperty(exports, "applyAction", { enumerable: true, get: function () { return internal_ts_1.applyAction; } });
|
|
10
|
-
Object.defineProperty(exports, "applyPatch", { enumerable: true, get: function () { return internal_ts_1.applyPatch; } });
|
|
11
|
-
Object.defineProperty(exports, "applySnapshot", { enumerable: true, get: function () { return internal_ts_1.applySnapshot; } });
|
|
12
|
-
Object.defineProperty(exports, "cast", { enumerable: true, get: function () { return internal_ts_1.cast; } });
|
|
13
|
-
Object.defineProperty(exports, "castFlowReturn", { enumerable: true, get: function () { return internal_ts_1.castFlowReturn; } });
|
|
14
|
-
Object.defineProperty(exports, "castToReferenceSnapshot", { enumerable: true, get: function () { return internal_ts_1.castToReferenceSnapshot; } });
|
|
15
|
-
Object.defineProperty(exports, "castToSnapshot", { enumerable: true, get: function () { return internal_ts_1.castToSnapshot; } });
|
|
16
|
-
Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return internal_ts_1.clone; } });
|
|
17
|
-
Object.defineProperty(exports, "createActionTrackingMiddleware2", { enumerable: true, get: function () { return internal_ts_1.createActionTrackingMiddleware2; } });
|
|
18
|
-
Object.defineProperty(exports, "createActionTrackingMiddleware", { enumerable: true, get: function () { return internal_ts_1.createActionTrackingMiddleware; } });
|
|
19
|
-
Object.defineProperty(exports, "decorate", { enumerable: true, get: function () { return internal_ts_1.decorate; } });
|
|
20
|
-
Object.defineProperty(exports, "destroy", { enumerable: true, get: function () { return internal_ts_1.destroy; } });
|
|
21
|
-
Object.defineProperty(exports, "detach", { enumerable: true, get: function () { return internal_ts_1.detach; } });
|
|
22
|
-
Object.defineProperty(exports, "escapeJsonPath", { enumerable: true, get: function () { return internal_ts_1.escapeJsonPath; } });
|
|
23
|
-
Object.defineProperty(exports, "flow", { enumerable: true, get: function () { return internal_ts_1.flow; } });
|
|
24
|
-
Object.defineProperty(exports, "getChildType", { enumerable: true, get: function () { return internal_ts_1.getChildType; } });
|
|
25
|
-
Object.defineProperty(exports, "getEnv", { enumerable: true, get: function () { return internal_ts_1.getEnv; } });
|
|
26
|
-
Object.defineProperty(exports, "getIdentifier", { enumerable: true, get: function () { return internal_ts_1.getIdentifier; } });
|
|
27
|
-
Object.defineProperty(exports, "getLivelinessChecking", { enumerable: true, get: function () { return internal_ts_1.getLivelinessChecking; } });
|
|
28
|
-
Object.defineProperty(exports, "getMembers", { enumerable: true, get: function () { return internal_ts_1.getMembers; } });
|
|
29
|
-
Object.defineProperty(exports, "getNodeId", { enumerable: true, get: function () { return internal_ts_1.getNodeId; } });
|
|
30
|
-
Object.defineProperty(exports, "getParent", { enumerable: true, get: function () { return internal_ts_1.getParent; } });
|
|
31
|
-
Object.defineProperty(exports, "getParentOfType", { enumerable: true, get: function () { return internal_ts_1.getParentOfType; } });
|
|
32
|
-
Object.defineProperty(exports, "getPath", { enumerable: true, get: function () { return internal_ts_1.getPath; } });
|
|
33
|
-
Object.defineProperty(exports, "getPathParts", { enumerable: true, get: function () { return internal_ts_1.getPathParts; } });
|
|
34
|
-
Object.defineProperty(exports, "getPropertyMembers", { enumerable: true, get: function () { return internal_ts_1.getPropertyMembers; } });
|
|
35
|
-
Object.defineProperty(exports, "getRelativePath", { enumerable: true, get: function () { return internal_ts_1.getRelativePath; } });
|
|
36
|
-
Object.defineProperty(exports, "getRoot", { enumerable: true, get: function () { return internal_ts_1.getRoot; } });
|
|
37
|
-
Object.defineProperty(exports, "getRunningActionContext", { enumerable: true, get: function () { return internal_ts_1.getRunningActionContext; } });
|
|
38
|
-
Object.defineProperty(exports, "getSnapshot", { enumerable: true, get: function () { return internal_ts_1.getSnapshot; } });
|
|
39
|
-
Object.defineProperty(exports, "getType", { enumerable: true, get: function () { return internal_ts_1.getType; } });
|
|
40
|
-
Object.defineProperty(exports, "hasParent", { enumerable: true, get: function () { return internal_ts_1.hasParent; } });
|
|
41
|
-
Object.defineProperty(exports, "hasParentOfType", { enumerable: true, get: function () { return internal_ts_1.hasParentOfType; } });
|
|
42
|
-
Object.defineProperty(exports, "isActionContextChildOf", { enumerable: true, get: function () { return internal_ts_1.isActionContextChildOf; } });
|
|
43
|
-
Object.defineProperty(exports, "isActionContextThisOrChildOf", { enumerable: true, get: function () { return internal_ts_1.isActionContextThisOrChildOf; } });
|
|
44
|
-
Object.defineProperty(exports, "isAlive", { enumerable: true, get: function () { return internal_ts_1.isAlive; } });
|
|
45
|
-
Object.defineProperty(exports, "isArrayType", { enumerable: true, get: function () { return internal_ts_1.isArrayType; } });
|
|
46
|
-
Object.defineProperty(exports, "isFrozenType", { enumerable: true, get: function () { return internal_ts_1.isFrozenType; } });
|
|
47
|
-
Object.defineProperty(exports, "isIdentifierType", { enumerable: true, get: function () { return internal_ts_1.isIdentifierType; } });
|
|
48
|
-
Object.defineProperty(exports, "isLateType", { enumerable: true, get: function () { return internal_ts_1.isLateType; } });
|
|
49
|
-
Object.defineProperty(exports, "isLiteralType", { enumerable: true, get: function () { return internal_ts_1.isLiteralType; } });
|
|
50
|
-
Object.defineProperty(exports, "isMapType", { enumerable: true, get: function () { return internal_ts_1.isMapType; } });
|
|
51
|
-
Object.defineProperty(exports, "isModelType", { enumerable: true, get: function () { return internal_ts_1.isModelType; } });
|
|
52
|
-
Object.defineProperty(exports, "isOptionalType", { enumerable: true, get: function () { return internal_ts_1.isOptionalType; } });
|
|
53
|
-
Object.defineProperty(exports, "isPrimitiveType", { enumerable: true, get: function () { return internal_ts_1.isPrimitiveType; } });
|
|
54
|
-
Object.defineProperty(exports, "isProtected", { enumerable: true, get: function () { return internal_ts_1.isProtected; } });
|
|
55
|
-
Object.defineProperty(exports, "isReferenceType", { enumerable: true, get: function () { return internal_ts_1.isReferenceType; } });
|
|
56
|
-
Object.defineProperty(exports, "isRefinementType", { enumerable: true, get: function () { return internal_ts_1.isRefinementType; } });
|
|
57
|
-
Object.defineProperty(exports, "isRoot", { enumerable: true, get: function () { return internal_ts_1.isRoot; } });
|
|
58
|
-
Object.defineProperty(exports, "isStateTreeNode", { enumerable: true, get: function () { return internal_ts_1.isStateTreeNode; } });
|
|
59
|
-
Object.defineProperty(exports, "isType", { enumerable: true, get: function () { return internal_ts_1.isType; } });
|
|
60
|
-
Object.defineProperty(exports, "isUnionType", { enumerable: true, get: function () { return internal_ts_1.isUnionType; } });
|
|
61
|
-
Object.defineProperty(exports, "isValidReference", { enumerable: true, get: function () { return internal_ts_1.isValidReference; } });
|
|
62
|
-
Object.defineProperty(exports, "joinJsonPath", { enumerable: true, get: function () { return internal_ts_1.joinJsonPath; } });
|
|
63
|
-
Object.defineProperty(exports, "onAction", { enumerable: true, get: function () { return internal_ts_1.onAction; } });
|
|
64
|
-
Object.defineProperty(exports, "onPatch", { enumerable: true, get: function () { return internal_ts_1.onPatch; } });
|
|
65
|
-
Object.defineProperty(exports, "onSnapshot", { enumerable: true, get: function () { return internal_ts_1.onSnapshot; } });
|
|
66
|
-
Object.defineProperty(exports, "process", { enumerable: true, get: function () { return internal_ts_1.process; } });
|
|
67
|
-
Object.defineProperty(exports, "protect", { enumerable: true, get: function () { return internal_ts_1.protect; } });
|
|
68
|
-
Object.defineProperty(exports, "recordActions", { enumerable: true, get: function () { return internal_ts_1.recordActions; } });
|
|
69
|
-
Object.defineProperty(exports, "recordPatches", { enumerable: true, get: function () { return internal_ts_1.recordPatches; } });
|
|
70
|
-
Object.defineProperty(exports, "resolveIdentifier", { enumerable: true, get: function () { return internal_ts_1.resolveIdentifier; } });
|
|
71
|
-
Object.defineProperty(exports, "resolvePath", { enumerable: true, get: function () { return internal_ts_1.resolvePath; } });
|
|
72
|
-
Object.defineProperty(exports, "setLivelinessChecking", { enumerable: true, get: function () { return internal_ts_1.setLivelinessChecking; } });
|
|
73
|
-
Object.defineProperty(exports, "setLivelynessChecking", { enumerable: true, get: function () { return internal_ts_1.setLivelynessChecking; } });
|
|
74
|
-
Object.defineProperty(exports, "splitJsonPath", { enumerable: true, get: function () { return internal_ts_1.splitJsonPath; } });
|
|
75
|
-
Object.defineProperty(exports, "toGenerator", { enumerable: true, get: function () { return internal_ts_1.toGenerator; } });
|
|
76
|
-
Object.defineProperty(exports, "toGeneratorFunction", { enumerable: true, get: function () { return internal_ts_1.toGeneratorFunction; } });
|
|
77
|
-
Object.defineProperty(exports, "tryReference", { enumerable: true, get: function () { return internal_ts_1.tryReference; } });
|
|
78
|
-
Object.defineProperty(exports, "tryResolve", { enumerable: true, get: function () { return internal_ts_1.tryResolve; } });
|
|
79
|
-
Object.defineProperty(exports, "typecheck", { enumerable: true, get: function () { return internal_ts_1.typecheck; } });
|
|
80
|
-
Object.defineProperty(exports, "types", { enumerable: true, get: function () { return internal_ts_1.types; } });
|
|
81
|
-
Object.defineProperty(exports, "t", { enumerable: true, get: function () { return internal_ts_1.types; } });
|
|
82
|
-
Object.defineProperty(exports, "unescapeJsonPath", { enumerable: true, get: function () { return internal_ts_1.unescapeJsonPath; } });
|
|
83
|
-
Object.defineProperty(exports, "unprotect", { enumerable: true, get: function () { return internal_ts_1.unprotect; } });
|
|
84
|
-
Object.defineProperty(exports, "walk", { enumerable: true, get: function () { return internal_ts_1.walk; } });
|
|
85
|
-
Object.defineProperty(exports, "setDevMode", { enumerable: true, get: function () { return internal_ts_1.setDevMode; } });
|
|
86
|
-
//# sourceMappingURL=mobx-state-tree.js.map
|