mutts 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/browser.d.ts +2 -0
- package/dist/browser.esm.js +70 -0
- package/dist/browser.esm.js.map +1 -0
- package/dist/browser.js +161 -0
- package/dist/browser.js.map +1 -0
- package/dist/chunks/{index-Cvxdw6Ax.js → index-BFYK02LG.js} +5377 -4059
- package/dist/chunks/index-BFYK02LG.js.map +1 -0
- package/dist/chunks/{index-qiWwozOc.esm.js → index-CNR6QRUl.esm.js} +5247 -3963
- package/dist/chunks/index-CNR6QRUl.esm.js.map +1 -0
- package/dist/mutts.umd.js +1 -1
- package/dist/mutts.umd.js.map +1 -1
- package/dist/mutts.umd.min.js +1 -1
- package/dist/mutts.umd.min.js.map +1 -1
- package/dist/node.d.ts +2 -0
- package/dist/node.esm.js +45 -0
- package/dist/node.esm.js.map +1 -0
- package/dist/node.js +136 -0
- package/dist/node.js.map +1 -0
- package/docs/ai/api-reference.md +0 -2
- package/docs/ai/manual.md +14 -95
- package/docs/reactive/advanced.md +7 -111
- package/docs/reactive/collections.md +0 -125
- package/docs/reactive/core.md +27 -24
- package/docs/reactive/debugging.md +168 -0
- package/docs/reactive/project.md +1 -1
- package/docs/reactive/scan.md +78 -0
- package/docs/reactive.md +8 -6
- package/docs/std-decorators.md +1 -0
- package/docs/zone.md +88 -0
- package/package.json +47 -65
- package/src/async/browser.ts +87 -0
- package/src/async/index.ts +8 -0
- package/src/async/node.ts +46 -0
- package/src/decorator.ts +15 -9
- package/src/destroyable.ts +4 -4
- package/src/index.ts +54 -0
- package/src/indexable.ts +42 -0
- package/src/mixins.ts +2 -2
- package/src/reactive/array.ts +149 -141
- package/src/reactive/buffer.ts +168 -0
- package/src/reactive/change.ts +3 -3
- package/src/reactive/debug.ts +1 -1
- package/src/reactive/deep-touch.ts +1 -1
- package/src/reactive/deep-watch.ts +1 -1
- package/src/reactive/effect-context.ts +15 -91
- package/src/reactive/effects.ts +138 -170
- package/src/reactive/index.ts +10 -13
- package/src/reactive/interface.ts +20 -33
- package/src/reactive/map.ts +48 -61
- package/src/reactive/memoize.ts +87 -31
- package/src/reactive/project.ts +43 -22
- package/src/reactive/proxy.ts +18 -43
- package/src/reactive/record.ts +3 -3
- package/src/reactive/register.ts +5 -7
- package/src/reactive/registry.ts +59 -0
- package/src/reactive/set.ts +42 -56
- package/src/reactive/tracking.ts +5 -62
- package/src/reactive/types.ts +79 -19
- package/src/std-decorators.ts +9 -9
- package/src/utils.ts +203 -19
- package/src/zone.ts +127 -0
- package/dist/chunks/_tslib-BgjropY9.js +0 -81
- package/dist/chunks/_tslib-BgjropY9.js.map +0 -1
- package/dist/chunks/_tslib-Mzh1rNsX.esm.js +0 -75
- package/dist/chunks/_tslib-Mzh1rNsX.esm.js.map +0 -1
- package/dist/chunks/decorator-DLvrD0UF.js +0 -265
- package/dist/chunks/decorator-DLvrD0UF.js.map +0 -1
- package/dist/chunks/decorator-DqiszP7i.esm.js +0 -253
- package/dist/chunks/decorator-DqiszP7i.esm.js.map +0 -1
- package/dist/chunks/index-Cvxdw6Ax.js.map +0 -1
- package/dist/chunks/index-qiWwozOc.esm.js.map +0 -1
- package/dist/decorator.d.ts +0 -107
- package/dist/decorator.esm.js +0 -2
- package/dist/decorator.esm.js.map +0 -1
- package/dist/decorator.js +0 -11
- package/dist/decorator.js.map +0 -1
- package/dist/destroyable.d.ts +0 -90
- package/dist/destroyable.esm.js +0 -109
- package/dist/destroyable.esm.js.map +0 -1
- package/dist/destroyable.js +0 -116
- package/dist/destroyable.js.map +0 -1
- package/dist/eventful.d.ts +0 -20
- package/dist/eventful.esm.js +0 -66
- package/dist/eventful.esm.js.map +0 -1
- package/dist/eventful.js +0 -68
- package/dist/eventful.js.map +0 -1
- package/dist/index.d.ts +0 -19
- package/dist/index.esm.js +0 -8
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -95
- package/dist/index.js.map +0 -1
- package/dist/indexable.d.ts +0 -243
- package/dist/indexable.esm.js +0 -285
- package/dist/indexable.esm.js.map +0 -1
- package/dist/indexable.js +0 -291
- package/dist/indexable.js.map +0 -1
- package/dist/promiseChain.d.ts +0 -21
- package/dist/promiseChain.esm.js +0 -78
- package/dist/promiseChain.esm.js.map +0 -1
- package/dist/promiseChain.js +0 -80
- package/dist/promiseChain.js.map +0 -1
- package/dist/reactive.d.ts +0 -885
- package/dist/reactive.esm.js +0 -5
- package/dist/reactive.esm.js.map +0 -1
- package/dist/reactive.js +0 -59
- package/dist/reactive.js.map +0 -1
- package/dist/std-decorators.d.ts +0 -52
- package/dist/std-decorators.esm.js +0 -196
- package/dist/std-decorators.esm.js.map +0 -1
- package/dist/std-decorators.js +0 -204
- package/dist/std-decorators.js.map +0 -1
- package/src/reactive/mapped.ts +0 -129
- package/src/reactive/zone.ts +0 -208
package/src/utils.ts
CHANGED
|
@@ -86,32 +86,216 @@ export function renamed<F extends Function>(fct: F, name: string): F {
|
|
|
86
86
|
},
|
|
87
87
|
})
|
|
88
88
|
}
|
|
89
|
+
export const FoolProof = {
|
|
90
|
+
get(obj: any, prop: any, receiver: any) {
|
|
91
|
+
// Check if Node is available and obj is an instance of Node
|
|
92
|
+
if (typeof Node !== 'undefined' && obj instanceof Node) return (obj as any)[prop]
|
|
93
|
+
return Reflect.get(obj, prop, receiver)
|
|
94
|
+
},
|
|
95
|
+
set(obj: any, prop: any, value: any, receiver: any) {
|
|
96
|
+
// Check if Node is available and obj is an instance of Node
|
|
97
|
+
if (typeof Node !== 'undefined' && obj instanceof Node) {
|
|
98
|
+
;(obj as any)[prop] = value
|
|
99
|
+
return true
|
|
100
|
+
}
|
|
101
|
+
if (!(obj instanceof Object) && !Reflect.has(obj, prop)) {
|
|
102
|
+
Object.defineProperty(obj, prop, {
|
|
103
|
+
value,
|
|
104
|
+
configurable: true,
|
|
105
|
+
writable: true,
|
|
106
|
+
enumerable: true,
|
|
107
|
+
})
|
|
108
|
+
return true
|
|
109
|
+
}
|
|
110
|
+
return Reflect.set(obj, prop, value, receiver)
|
|
111
|
+
},
|
|
112
|
+
}
|
|
89
113
|
|
|
90
|
-
export function
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return Reflect.get(obj, prop, receiver)
|
|
114
|
+
export function isOwnAccessor(obj: any, prop: any) {
|
|
115
|
+
const opd = Object.getOwnPropertyDescriptor(obj, prop)
|
|
116
|
+
return !!(opd?.get || opd?.set)
|
|
94
117
|
}
|
|
95
118
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Deeply compares two values.
|
|
121
|
+
* For objects, compares prototypes with === and then own properties recursively.
|
|
122
|
+
* Uses a cache to handle circular references.
|
|
123
|
+
* @param a - First value
|
|
124
|
+
* @param b - Second value
|
|
125
|
+
* @param cache - Map for circular reference protection (internal use)
|
|
126
|
+
* @returns True if values are deeply equal
|
|
127
|
+
*/
|
|
128
|
+
export function deepCompare(a: any, b: any, cache = new Map<object, Set<object>>()): boolean {
|
|
129
|
+
if (a === b) return true
|
|
130
|
+
|
|
131
|
+
if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) {
|
|
132
|
+
return a === b
|
|
101
133
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
134
|
+
|
|
135
|
+
// Prototype check
|
|
136
|
+
const protoA = Object.getPrototypeOf(a)
|
|
137
|
+
const protoB = Object.getPrototypeOf(b)
|
|
138
|
+
if (protoA !== protoB) {
|
|
139
|
+
console.warn(`[deepCompare] prototype mismatch:`, {
|
|
140
|
+
nameA: a?.constructor?.name,
|
|
141
|
+
nameB: b?.constructor?.name,
|
|
108
142
|
})
|
|
143
|
+
return false
|
|
144
|
+
}
|
|
145
|
+
// Circular reference protection
|
|
146
|
+
let compared = cache.get(a)
|
|
147
|
+
if (compared?.has(b)) return true
|
|
148
|
+
if (!compared) {
|
|
149
|
+
compared = new Set()
|
|
150
|
+
cache.set(a, compared)
|
|
151
|
+
}
|
|
152
|
+
compared.add(b)
|
|
153
|
+
|
|
154
|
+
// Handle specific object types
|
|
155
|
+
if (Array.isArray(a)) {
|
|
156
|
+
if (!Array.isArray(b)) {
|
|
157
|
+
console.warn(`[deepCompare] B is not an array`)
|
|
158
|
+
return false
|
|
159
|
+
}
|
|
160
|
+
if (a.length !== b.length) {
|
|
161
|
+
console.warn(`[deepCompare] array length mismatch:`, { lenA: a.length, lenB: b.length })
|
|
162
|
+
return false
|
|
163
|
+
}
|
|
164
|
+
for (let i = 0; i < a.length; i++) {
|
|
165
|
+
if (!deepCompare(a[i], b[i], cache)) {
|
|
166
|
+
console.warn(`[deepCompare] array element mismatch at index ${i}`)
|
|
167
|
+
return false
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return true
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (a instanceof Date) {
|
|
174
|
+
const match = b instanceof Date && a.getTime() === b.getTime()
|
|
175
|
+
if (!match) console.warn(`[deepCompare] Date mismatch`)
|
|
176
|
+
return match
|
|
177
|
+
}
|
|
178
|
+
if (a instanceof RegExp) {
|
|
179
|
+
const match = b instanceof RegExp && a.toString() === b.toString()
|
|
180
|
+
if (!match) console.warn(`[deepCompare] RegExp mismatch`)
|
|
181
|
+
return match
|
|
182
|
+
}
|
|
183
|
+
if (a instanceof Set) {
|
|
184
|
+
if (!(b instanceof Set) || a.size !== b.size) {
|
|
185
|
+
console.warn(`[deepCompare] Set size mismatch`)
|
|
186
|
+
return false
|
|
187
|
+
}
|
|
188
|
+
for (const val of a) {
|
|
189
|
+
let found = false
|
|
190
|
+
for (const bVal of b) {
|
|
191
|
+
if (deepCompare(val, bVal, cache)) {
|
|
192
|
+
found = true
|
|
193
|
+
break
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (!found) {
|
|
197
|
+
console.warn(`[deepCompare] missing Set element`)
|
|
198
|
+
return false
|
|
199
|
+
}
|
|
200
|
+
}
|
|
109
201
|
return true
|
|
110
202
|
}
|
|
111
|
-
|
|
203
|
+
if (a instanceof Map) {
|
|
204
|
+
if (!(b instanceof Map) || a.size !== b.size) {
|
|
205
|
+
console.warn(`[deepCompare] Map size mismatch`)
|
|
206
|
+
return false
|
|
207
|
+
}
|
|
208
|
+
for (const [key, val] of a) {
|
|
209
|
+
if (!b.has(key)) {
|
|
210
|
+
let foundMatch = false
|
|
211
|
+
for (const [bKey, bVal] of b) {
|
|
212
|
+
if (deepCompare(key, bKey, cache) && deepCompare(val, bVal, cache)) {
|
|
213
|
+
foundMatch = true
|
|
214
|
+
break
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (!foundMatch) {
|
|
218
|
+
console.warn(`[deepCompare] missing Map key`)
|
|
219
|
+
return false
|
|
220
|
+
}
|
|
221
|
+
} else {
|
|
222
|
+
if (!deepCompare(val, b.get(key), cache)) {
|
|
223
|
+
console.warn(`[deepCompare] Map value mismatch for key`)
|
|
224
|
+
return false
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return true
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Compare own properties
|
|
232
|
+
const keysA = Object.keys(a)
|
|
233
|
+
const keysB = Object.keys(b)
|
|
234
|
+
if (keysA.length !== keysB.length) {
|
|
235
|
+
console.warn(`[deepCompare] keys length mismatch:`, {
|
|
236
|
+
lenA: keysA.length,
|
|
237
|
+
lenB: keysB.length,
|
|
238
|
+
keysA,
|
|
239
|
+
keysB,
|
|
240
|
+
a,
|
|
241
|
+
b,
|
|
242
|
+
})
|
|
243
|
+
return false
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
for (const key of keysA) {
|
|
247
|
+
if (!Object.hasOwn(b, key)) {
|
|
248
|
+
console.warn(`[deepCompare] missing key ${String(key)} in B`)
|
|
249
|
+
return false
|
|
250
|
+
}
|
|
251
|
+
if (!deepCompare(a[key], b[key], cache)) {
|
|
252
|
+
console.warn(`[deepCompare] value mismatch for key ${String(key)}:`, {
|
|
253
|
+
valA: a[key],
|
|
254
|
+
valB: b[key],
|
|
255
|
+
})
|
|
256
|
+
return false
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return true
|
|
112
261
|
}
|
|
113
262
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
263
|
+
|
|
264
|
+
const contentRefs = new WeakMap<object, any>()
|
|
265
|
+
export function contentRef(container: object) {
|
|
266
|
+
if (!contentRefs.has(container))
|
|
267
|
+
contentRefs.set(
|
|
268
|
+
container,
|
|
269
|
+
Object.seal(
|
|
270
|
+
Object.create(null, {
|
|
271
|
+
contentOf: { value: container, writable: false, configurable: false },
|
|
272
|
+
})
|
|
273
|
+
)
|
|
274
|
+
)
|
|
275
|
+
return contentRefs.get(container)
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export function tag<T extends object>(obj: T, name: string): T {
|
|
279
|
+
Object.defineProperties(obj, {
|
|
280
|
+
[Symbol.toStringTag]: {
|
|
281
|
+
value: name,
|
|
282
|
+
writable: false,
|
|
283
|
+
configurable: false,
|
|
284
|
+
},
|
|
285
|
+
toString: {
|
|
286
|
+
value: () => name,
|
|
287
|
+
writable: false,
|
|
288
|
+
configurable: false,
|
|
289
|
+
},
|
|
290
|
+
})
|
|
291
|
+
return obj
|
|
117
292
|
}
|
|
293
|
+
|
|
294
|
+
export function named<T extends Function>(name: string, fn: T): T {
|
|
295
|
+
Object.defineProperty(fn, 'name', {
|
|
296
|
+
value: fn.name ? `${fn.name}::${name}` : name,
|
|
297
|
+
writable: false,
|
|
298
|
+
configurable: false,
|
|
299
|
+
})
|
|
300
|
+
return fn
|
|
301
|
+
}
|
package/src/zone.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { asyncHooks } from "./async"
|
|
2
|
+
import { named, tag } from "./utils"
|
|
3
|
+
|
|
4
|
+
export abstract class AZone<T> {
|
|
5
|
+
abstract active?: T
|
|
6
|
+
enter(value?: T): unknown {
|
|
7
|
+
const prev = this.active
|
|
8
|
+
this.active = value
|
|
9
|
+
return prev
|
|
10
|
+
}
|
|
11
|
+
leave(entered: unknown): void {
|
|
12
|
+
this.active = entered as T | undefined
|
|
13
|
+
}
|
|
14
|
+
with<R>(value: T, fn: () => R): R {
|
|
15
|
+
const entered = this.enter(value)
|
|
16
|
+
try {
|
|
17
|
+
return fn()
|
|
18
|
+
} finally {
|
|
19
|
+
this.leave(entered)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
root<R>(fn: () => R): R {
|
|
23
|
+
let prev = this.enter()
|
|
24
|
+
try {
|
|
25
|
+
return fn()
|
|
26
|
+
} finally {
|
|
27
|
+
this.leave(prev)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
get zoned(): FunctionWrapper {
|
|
31
|
+
const active = this.active
|
|
32
|
+
return named(`${this}@${active}`, (fn) => this.with(active, fn))
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type FunctionWrapper = <R>(fn?: () => R) => R
|
|
37
|
+
|
|
38
|
+
export class Zone<T> extends AZone<T> {
|
|
39
|
+
active: T | undefined
|
|
40
|
+
}
|
|
41
|
+
type HistoryValue<T> = {present: T | undefined, history: Set<T>}
|
|
42
|
+
export class ZoneHistory<T> extends AZone<HistoryValue<T>> {
|
|
43
|
+
private history = new Set<T>()
|
|
44
|
+
public readonly present: AZone<T>
|
|
45
|
+
public has(value: T): boolean {
|
|
46
|
+
return this.history.has(value)
|
|
47
|
+
}
|
|
48
|
+
public some(predicate: (value: T) => boolean): boolean {
|
|
49
|
+
for(const value of this.history) if(predicate(value)) return true
|
|
50
|
+
return false
|
|
51
|
+
}
|
|
52
|
+
constructor(private controlled: AZone<T> = new Zone<T>()) {
|
|
53
|
+
super()
|
|
54
|
+
const self = this
|
|
55
|
+
this.present = Object.create(controlled,
|
|
56
|
+
Object.getOwnPropertyDescriptors({
|
|
57
|
+
get active() { return controlled.active },
|
|
58
|
+
set active(value: T | undefined) {
|
|
59
|
+
controlled.active = value
|
|
60
|
+
},
|
|
61
|
+
enter(value?: T) {
|
|
62
|
+
if(value && self.history.has(value)) throw new Error('ZoneHistory: re-entering historical zone')
|
|
63
|
+
if(value !== undefined) self.history.add(value)
|
|
64
|
+
return { added: value, entered: controlled.enter(value) }
|
|
65
|
+
},
|
|
66
|
+
leave(entered: { added: T | undefined, entered: unknown }) {
|
|
67
|
+
if(entered.added !== undefined) self.history.delete(entered.added)
|
|
68
|
+
return controlled.leave(entered.entered)
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
get active() {
|
|
74
|
+
return {present: this.controlled.active, history: new Set(this.history)}
|
|
75
|
+
}
|
|
76
|
+
set active(value: HistoryValue<T> | undefined) {
|
|
77
|
+
this.history = this.history && new Set(this.history)
|
|
78
|
+
this.controlled.active = value?.present
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class ZoneAggregator extends AZone<Map<AZone<unknown>, unknown>> {
|
|
83
|
+
#zones = new Set<AZone<unknown>>()
|
|
84
|
+
constructor(...zones: AZone<unknown>[]) {
|
|
85
|
+
super()
|
|
86
|
+
for (const z of zones) this.#zones.add(z)
|
|
87
|
+
}
|
|
88
|
+
get active(): Map<AZone<unknown>, unknown> | undefined {
|
|
89
|
+
const rv = new Map<AZone<unknown>, unknown>()
|
|
90
|
+
for (const z of this.#zones)
|
|
91
|
+
if (z.active !== undefined) rv.set(z, z.active)
|
|
92
|
+
return rv
|
|
93
|
+
}
|
|
94
|
+
set active(value: Map<AZone<unknown>, unknown> | undefined) {
|
|
95
|
+
for (const z of this.#zones) z.active = value?.get(z)
|
|
96
|
+
}
|
|
97
|
+
enter(value?: Map<AZone<unknown>, unknown> | undefined) {
|
|
98
|
+
const entered = new Map<AZone<unknown>, unknown>()
|
|
99
|
+
for (const z of this.#zones) {
|
|
100
|
+
const v = value?.get(z)
|
|
101
|
+
entered.set(z, z.enter(v))
|
|
102
|
+
}
|
|
103
|
+
return entered
|
|
104
|
+
}
|
|
105
|
+
leave(entered: Map<AZone<unknown>, unknown>): void {
|
|
106
|
+
for (const z of this.#zones) z.leave(entered.get(z))
|
|
107
|
+
}
|
|
108
|
+
add(z: AZone<unknown>) {
|
|
109
|
+
this.#zones.add(z)
|
|
110
|
+
}
|
|
111
|
+
delete(z: AZone<unknown>) {
|
|
112
|
+
this.#zones.delete(z)
|
|
113
|
+
}
|
|
114
|
+
clear() {
|
|
115
|
+
this.#zones.clear()
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const asyncZone = tag(new ZoneAggregator(), 'async')
|
|
120
|
+
asyncHooks.addHook(() => {
|
|
121
|
+
const zone = asyncZone.active
|
|
122
|
+
return () => {
|
|
123
|
+
const prev = asyncZone.active
|
|
124
|
+
asyncZone.active = zone
|
|
125
|
+
return () => asyncZone.active = prev
|
|
126
|
+
}
|
|
127
|
+
})
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/******************************************************************************
|
|
4
|
-
Copyright (c) Microsoft Corporation.
|
|
5
|
-
|
|
6
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
-
purpose with or without fee is hereby granted.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
***************************************************************************** */
|
|
17
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
21
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
22
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
23
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
24
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
25
|
-
var _, done = false;
|
|
26
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
27
|
-
var context = {};
|
|
28
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
29
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
30
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
31
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
32
|
-
if (kind === "accessor") {
|
|
33
|
-
if (result === void 0) continue;
|
|
34
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
35
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
36
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
37
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
38
|
-
}
|
|
39
|
-
else if (_ = accept(result)) {
|
|
40
|
-
if (kind === "field") initializers.unshift(_);
|
|
41
|
-
else descriptor[key] = _;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
45
|
-
done = true;
|
|
46
|
-
}
|
|
47
|
-
function __runInitializers(thisArg, initializers, value) {
|
|
48
|
-
var useValue = arguments.length > 2;
|
|
49
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
50
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
51
|
-
}
|
|
52
|
-
return useValue ? value : void 0;
|
|
53
|
-
}
|
|
54
|
-
function __setFunctionName(f, name, prefix) {
|
|
55
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
56
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
57
|
-
}
|
|
58
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
59
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
60
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
61
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
65
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
66
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
67
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
68
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
72
|
-
var e = new Error(message);
|
|
73
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
exports.__classPrivateFieldGet = __classPrivateFieldGet;
|
|
77
|
-
exports.__classPrivateFieldSet = __classPrivateFieldSet;
|
|
78
|
-
exports.__esDecorate = __esDecorate;
|
|
79
|
-
exports.__runInitializers = __runInitializers;
|
|
80
|
-
exports.__setFunctionName = __setFunctionName;
|
|
81
|
-
//# sourceMappingURL=_tslib-BgjropY9.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_tslib-BgjropY9.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/******************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
19
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
20
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
21
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
22
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
23
|
-
var _, done = false;
|
|
24
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
25
|
-
var context = {};
|
|
26
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
27
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
28
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
29
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
30
|
-
if (kind === "accessor") {
|
|
31
|
-
if (result === void 0) continue;
|
|
32
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
33
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
34
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
35
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
36
|
-
}
|
|
37
|
-
else if (_ = accept(result)) {
|
|
38
|
-
if (kind === "field") initializers.unshift(_);
|
|
39
|
-
else descriptor[key] = _;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
43
|
-
done = true;
|
|
44
|
-
}
|
|
45
|
-
function __runInitializers(thisArg, initializers, value) {
|
|
46
|
-
var useValue = arguments.length > 2;
|
|
47
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
48
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
49
|
-
}
|
|
50
|
-
return useValue ? value : void 0;
|
|
51
|
-
}
|
|
52
|
-
function __setFunctionName(f, name, prefix) {
|
|
53
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
54
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
55
|
-
}
|
|
56
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
57
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
58
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
59
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
63
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
64
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
65
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
66
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
70
|
-
var e = new Error(message);
|
|
71
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { __classPrivateFieldGet as _, __setFunctionName as a, __esDecorate as b, __runInitializers as c, __classPrivateFieldSet as d };
|
|
75
|
-
//# sourceMappingURL=_tslib-Mzh1rNsX.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_tslib-Mzh1rNsX.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|