@spscommerce/utils 3.12.4 → 3.16.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/lib/array/index.d.ts +3 -3
- package/lib/classes/index.d.ts +1 -1
- package/lib/data/index.d.ts +1 -1
- package/lib/decorators/debounced.d.ts +8 -1
- package/lib/decorators/index.d.ts +5 -5
- package/lib/decorators/locked-to-animation-frames.d.ts +8 -1
- package/lib/decorators/tick-delay.d.ts +5 -1
- package/lib/function/debounce.d.ts +2 -2
- package/lib/function/debounced-function.interface.d.ts +1 -1
- package/lib/function/index.d.ts +6 -6
- package/lib/function/lock-to-animation-frames.d.ts +1 -1
- package/lib/function/on-next-tick.d.ts +1 -1
- package/lib/index.cjs.js +448 -422
- package/lib/index.d.ts +9 -9
- package/lib/index.esm.js +448 -422
- package/lib/number/index.d.ts +3 -3
- package/lib/object/get-path.d.ts +2 -2
- package/lib/object/index.d.ts +13 -13
- package/lib/object/traverse-path.d.ts +1 -1
- package/lib/string/index.d.ts +3 -3
- package/package.json +2 -2
- package/rollup.config.js +24 -0
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
1
|
+
export * from './array/index';
|
|
2
|
+
export * from './classes/index';
|
|
3
|
+
export * from './data/index';
|
|
4
|
+
export * from './decorators/index';
|
|
5
|
+
export * from './function/index';
|
|
6
|
+
export * from './number/index';
|
|
7
|
+
export * from './object/index';
|
|
8
|
+
export * from './string/index';
|
|
9
|
+
export * from './typings';
|
package/lib/index.esm.js
CHANGED
|
@@ -24,6 +24,17 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
24
24
|
PERFORMANCE OF THIS SOFTWARE.
|
|
25
25
|
***************************************************************************** */
|
|
26
26
|
|
|
27
|
+
var __assign = function() {
|
|
28
|
+
__assign = Object.assign || function __assign(t) {
|
|
29
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
30
|
+
s = arguments[i];
|
|
31
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
};
|
|
35
|
+
return __assign.apply(this, arguments);
|
|
36
|
+
};
|
|
37
|
+
|
|
27
38
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
28
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -91,10 +102,14 @@ function __read(o, n) {
|
|
|
91
102
|
return ar;
|
|
92
103
|
}
|
|
93
104
|
|
|
94
|
-
function
|
|
95
|
-
for (var
|
|
96
|
-
ar
|
|
97
|
-
|
|
105
|
+
function __spreadArray(to, from, pack) {
|
|
106
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
107
|
+
if (ar || !(i in from)) {
|
|
108
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
109
|
+
ar[i] = from[i];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
98
113
|
}
|
|
99
114
|
|
|
100
115
|
/**
|
|
@@ -133,7 +148,7 @@ function isSubset(candidate, array) {
|
|
|
133
148
|
*/
|
|
134
149
|
function resetDebouncedFn() {
|
|
135
150
|
this.pending = false;
|
|
136
|
-
if (typeof this.id ===
|
|
151
|
+
if (typeof this.id === 'number') {
|
|
137
152
|
clearTimeout(this.id);
|
|
138
153
|
delete this.id;
|
|
139
154
|
return true;
|
|
@@ -147,16 +162,16 @@ function resetDebouncedFn() {
|
|
|
147
162
|
* finally gets called and returns a value.
|
|
148
163
|
*/
|
|
149
164
|
function debounce(functionToDebounce, milliseconds, thisArg) {
|
|
150
|
-
var
|
|
165
|
+
var debFn = function debouncedFn() {
|
|
151
166
|
var _this = this;
|
|
152
167
|
var args = [];
|
|
153
168
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
154
169
|
args[_i] = arguments[_i];
|
|
155
170
|
}
|
|
156
171
|
return new Promise(function (resolve, reject) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
172
|
+
debFn.reset();
|
|
173
|
+
debFn.pending = true;
|
|
174
|
+
debFn.id = window.setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
160
175
|
var output, err_1;
|
|
161
176
|
return __generator(this, function (_a) {
|
|
162
177
|
switch (_a.label) {
|
|
@@ -176,7 +191,7 @@ function debounce(functionToDebounce, milliseconds, thisArg) {
|
|
|
176
191
|
reject(err_1);
|
|
177
192
|
return [3 /*break*/, 5];
|
|
178
193
|
case 4:
|
|
179
|
-
|
|
194
|
+
debFn.reset();
|
|
180
195
|
return [7 /*endfinally*/];
|
|
181
196
|
case 5: return [2 /*return*/];
|
|
182
197
|
}
|
|
@@ -184,8 +199,8 @@ function debounce(functionToDebounce, milliseconds, thisArg) {
|
|
|
184
199
|
}); }, milliseconds);
|
|
185
200
|
});
|
|
186
201
|
};
|
|
187
|
-
|
|
188
|
-
return
|
|
202
|
+
debFn.reset = resetDebouncedFn.bind(debFn);
|
|
203
|
+
return debFn;
|
|
189
204
|
}
|
|
190
205
|
|
|
191
206
|
/**
|
|
@@ -196,7 +211,7 @@ function debounce(functionToDebounce, milliseconds, thisArg) {
|
|
|
196
211
|
*/
|
|
197
212
|
function resetLockedFn() {
|
|
198
213
|
this.pending = false;
|
|
199
|
-
if (typeof this.id ===
|
|
214
|
+
if (typeof this.id === 'number') {
|
|
200
215
|
window.cancelAnimationFrame(this.id);
|
|
201
216
|
delete this.id;
|
|
202
217
|
return true;
|
|
@@ -209,7 +224,7 @@ function resetLockedFn() {
|
|
|
209
224
|
* most once per frame.
|
|
210
225
|
*/
|
|
211
226
|
function lockToAnimationFrames(functionToLock, thisArg) {
|
|
212
|
-
var lockFn = function () {
|
|
227
|
+
var lockFn = function lockedFn() {
|
|
213
228
|
var _this = this;
|
|
214
229
|
var args = [];
|
|
215
230
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -219,7 +234,9 @@ function lockToAnimationFrames(functionToLock, thisArg) {
|
|
|
219
234
|
lockFn.reset();
|
|
220
235
|
}
|
|
221
236
|
lockFn.id = window.requestAnimationFrame(function () {
|
|
222
|
-
functionToLock
|
|
237
|
+
if (functionToLock) {
|
|
238
|
+
functionToLock.apply(thisArg || _this, args);
|
|
239
|
+
}
|
|
223
240
|
lockFn.reset();
|
|
224
241
|
});
|
|
225
242
|
lockFn.pending = true;
|
|
@@ -237,11 +254,11 @@ function lockToAnimationFrames(functionToLock, thisArg) {
|
|
|
237
254
|
* all of Angular's current cycle is finished, will resolve that error.
|
|
238
255
|
*/
|
|
239
256
|
function onNextTick(fn, thisArg) {
|
|
240
|
-
|
|
241
|
-
setTimeout(
|
|
257
|
+
var boundFn = thisArg ? fn.bind(thisArg) : fn;
|
|
258
|
+
setTimeout(boundFn, 0);
|
|
242
259
|
}
|
|
243
260
|
|
|
244
|
-
/*
|
|
261
|
+
/* eslint-disable */
|
|
245
262
|
// @dynamic
|
|
246
263
|
/** Functions for various operators, most useful in combination
|
|
247
264
|
* with functional programming tools like map, filter, and reduce.
|
|
@@ -284,10 +301,10 @@ var Op = /** @class */ (function () {
|
|
|
284
301
|
*/
|
|
285
302
|
function range(start, end) {
|
|
286
303
|
if (!Number.isInteger(start)) {
|
|
287
|
-
throw new Error(
|
|
304
|
+
throw new Error('start must be an integer');
|
|
288
305
|
}
|
|
289
306
|
if (!Number.isInteger(end)) {
|
|
290
|
-
throw new Error(
|
|
307
|
+
throw new Error('end must be an integer');
|
|
291
308
|
}
|
|
292
309
|
return new Array(Math.abs(end - start) + 1).fill(start).map(start > end ? Op.SUB : Op.ADD);
|
|
293
310
|
}
|
|
@@ -300,17 +317,17 @@ var CustomEvent = /** @class */ (function () {
|
|
|
300
317
|
var e_1, _a, e_2, _b, e_3, _c;
|
|
301
318
|
if (initDict === void 0) { initDict = {}; }
|
|
302
319
|
var event;
|
|
303
|
-
if (typeof Event ===
|
|
320
|
+
if (typeof Event === 'function') {
|
|
304
321
|
event = new Event(eventName, initDict);
|
|
305
322
|
}
|
|
306
323
|
else {
|
|
307
324
|
// IE11
|
|
308
|
-
event = document.createEvent(
|
|
325
|
+
event = document.createEvent('Event');
|
|
309
326
|
event.initEvent(eventName, initDict.bubbles, initDict.cancelable);
|
|
310
327
|
try {
|
|
311
328
|
for (var _d = __values(Object.keys(initDict)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
312
329
|
var key = _e.value;
|
|
313
|
-
if (key !==
|
|
330
|
+
if (key !== 'bubbles' && key !== 'cancelable') {
|
|
314
331
|
event[key] = initDict[key];
|
|
315
332
|
}
|
|
316
333
|
}
|
|
@@ -335,7 +352,7 @@ var CustomEvent = /** @class */ (function () {
|
|
|
335
352
|
try {
|
|
336
353
|
for (var _h = (e_3 = void 0, __values(Object.keys(descriptor))), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
337
354
|
var key = _j.value;
|
|
338
|
-
if (typeof descriptor[key] ===
|
|
355
|
+
if (typeof descriptor[key] === 'function') {
|
|
339
356
|
descriptor[key] = descriptor[key].bind(event);
|
|
340
357
|
}
|
|
341
358
|
}
|
|
@@ -362,305 +379,305 @@ var CustomEvent = /** @class */ (function () {
|
|
|
362
379
|
}());
|
|
363
380
|
|
|
364
381
|
var EDI_DOCUMENT_TYPE = Object.freeze({
|
|
365
|
-
100: { name:
|
|
366
|
-
101: { name:
|
|
367
|
-
104: { name:
|
|
368
|
-
106: { name:
|
|
369
|
-
107: { name:
|
|
370
|
-
108: { name:
|
|
371
|
-
109: { name:
|
|
372
|
-
110: { name:
|
|
373
|
-
112: { name:
|
|
374
|
-
120: { name:
|
|
375
|
-
121: { name:
|
|
376
|
-
124: { name:
|
|
377
|
-
125: { name:
|
|
378
|
-
126: { name:
|
|
379
|
-
127: { name:
|
|
380
|
-
128: { name:
|
|
381
|
-
129: { name:
|
|
382
|
-
130: { name:
|
|
383
|
-
131: { name:
|
|
384
|
-
135: { name:
|
|
385
|
-
138: { name:
|
|
386
|
-
139: { name:
|
|
387
|
-
140: { name:
|
|
388
|
-
141: { name:
|
|
389
|
-
142: { name:
|
|
390
|
-
143: { name:
|
|
391
|
-
144: { name:
|
|
392
|
-
146: { name:
|
|
393
|
-
147: { name:
|
|
394
|
-
148: { name:
|
|
395
|
-
149: { name:
|
|
396
|
-
150: { name:
|
|
397
|
-
151: { name:
|
|
398
|
-
152: { name:
|
|
399
|
-
153: { name:
|
|
400
|
-
154: { name:
|
|
401
|
-
155: { name:
|
|
402
|
-
157: { name:
|
|
403
|
-
159: { name:
|
|
404
|
-
160: { name:
|
|
405
|
-
161: { name:
|
|
406
|
-
169: { name:
|
|
407
|
-
170: { name:
|
|
408
|
-
175: { name:
|
|
409
|
-
176: { name:
|
|
410
|
-
180: { name:
|
|
411
|
-
185: { name:
|
|
412
|
-
186: { name:
|
|
413
|
-
188: { name:
|
|
414
|
-
189: { name:
|
|
415
|
-
190: { name:
|
|
416
|
-
191: { name:
|
|
417
|
-
194: { name:
|
|
418
|
-
195: { name:
|
|
419
|
-
196: { name:
|
|
420
|
-
197: { name:
|
|
421
|
-
198: { name:
|
|
422
|
-
199: { name:
|
|
423
|
-
200: { name:
|
|
424
|
-
201: { name:
|
|
425
|
-
202: { name:
|
|
426
|
-
203: { name:
|
|
427
|
-
204: { name:
|
|
428
|
-
205: { name:
|
|
429
|
-
206: { name:
|
|
430
|
-
210: { name:
|
|
431
|
-
211: { name:
|
|
432
|
-
212: { name:
|
|
433
|
-
213: { name:
|
|
434
|
-
214: { name:
|
|
435
|
-
215: { name:
|
|
436
|
-
216: { name:
|
|
437
|
-
217: { name:
|
|
438
|
-
218: { name:
|
|
439
|
-
219: { name:
|
|
440
|
-
220: { name:
|
|
441
|
-
222: { name:
|
|
442
|
-
223: { name:
|
|
443
|
-
224: { name:
|
|
444
|
-
225: { name:
|
|
445
|
-
240: { name:
|
|
446
|
-
242: { name:
|
|
447
|
-
244: { name:
|
|
448
|
-
248: { name:
|
|
449
|
-
249: { name:
|
|
450
|
-
250: { name:
|
|
451
|
-
251: { name:
|
|
452
|
-
252: { name:
|
|
453
|
-
255: { name:
|
|
454
|
-
256: { name:
|
|
455
|
-
260: { name:
|
|
456
|
-
261: { name:
|
|
457
|
-
262: { name:
|
|
458
|
-
263: { name:
|
|
459
|
-
264: { name:
|
|
460
|
-
265: { name:
|
|
461
|
-
266: { name:
|
|
462
|
-
267: { name:
|
|
463
|
-
268: { name:
|
|
464
|
-
270: { name:
|
|
465
|
-
271: { name:
|
|
466
|
-
272: { name:
|
|
467
|
-
273: { name:
|
|
468
|
-
274: { name:
|
|
469
|
-
275: { name:
|
|
470
|
-
276: { name:
|
|
471
|
-
277: { name:
|
|
472
|
-
278: { name:
|
|
473
|
-
280: { name:
|
|
474
|
-
285: { name:
|
|
475
|
-
286: { name:
|
|
476
|
-
288: { name:
|
|
477
|
-
290: { name:
|
|
478
|
-
300: { name:
|
|
479
|
-
301: { name:
|
|
480
|
-
303: { name:
|
|
481
|
-
304: { name:
|
|
482
|
-
309: { name:
|
|
483
|
-
310: { name:
|
|
484
|
-
311: { name:
|
|
485
|
-
312: { name:
|
|
486
|
-
313: { name:
|
|
487
|
-
315: { name:
|
|
488
|
-
317: { name:
|
|
489
|
-
319: { name:
|
|
490
|
-
322: { name:
|
|
491
|
-
323: { name:
|
|
492
|
-
324: { name:
|
|
493
|
-
325: { name:
|
|
494
|
-
326: { name:
|
|
495
|
-
350: { name:
|
|
496
|
-
352: { name:
|
|
497
|
-
353: { name:
|
|
498
|
-
354: { name:
|
|
499
|
-
355: { name:
|
|
500
|
-
356: { name:
|
|
501
|
-
357: { name:
|
|
502
|
-
358: { name:
|
|
503
|
-
361: { name:
|
|
504
|
-
362: { name:
|
|
505
|
-
404: { name:
|
|
506
|
-
410: { name:
|
|
507
|
-
411: { name:
|
|
508
|
-
412: { name:
|
|
509
|
-
414: { name:
|
|
510
|
-
417: { name:
|
|
511
|
-
418: { name:
|
|
512
|
-
419: { name:
|
|
513
|
-
420: { name:
|
|
514
|
-
421: { name:
|
|
382
|
+
100: { name: 'Insurance Plan Description' },
|
|
383
|
+
101: { name: 'Name and Address Lists' },
|
|
384
|
+
104: { name: 'Air Shipment Information' },
|
|
385
|
+
106: { name: 'Motor Carrier Rate Proposal' },
|
|
386
|
+
107: { name: 'Request for Motor Carrier Rate Proposal' },
|
|
387
|
+
108: { name: 'Response to a Motor Carrier Rate Proposal' },
|
|
388
|
+
109: { name: 'Vessel Content Details' },
|
|
389
|
+
110: { name: 'Air Freight Details and Invoice' },
|
|
390
|
+
112: { name: 'Property Damage Report' },
|
|
391
|
+
120: { name: 'Vehicle Shipping Order' },
|
|
392
|
+
121: { name: 'Vehicle Service' },
|
|
393
|
+
124: { name: 'Vehicle Damage' },
|
|
394
|
+
125: { name: 'Multilevel Railcar Load Details' },
|
|
395
|
+
126: { name: 'Vehicle Application Advice' },
|
|
396
|
+
127: { name: 'Vehicle Baying Order' },
|
|
397
|
+
128: { name: 'Dealer Information' },
|
|
398
|
+
129: { name: 'Vehicle Carrier Rate Update' },
|
|
399
|
+
130: { name: 'Student Educational Record (Transcript)' },
|
|
400
|
+
131: { name: 'Student Educational Record (Transcript) Acknowledgment' },
|
|
401
|
+
135: { name: 'Student Loan Application' },
|
|
402
|
+
138: { name: 'Testing Results Request and Report' },
|
|
403
|
+
139: { name: 'Student Loan Guarantee Result' },
|
|
404
|
+
140: { name: 'Product Registration' },
|
|
405
|
+
141: { name: 'Product Service Claim Response' },
|
|
406
|
+
142: { name: 'Product Service Claim' },
|
|
407
|
+
143: { name: 'Product Service Notification' },
|
|
408
|
+
144: { name: 'Student Loan Transfer and Status Verification' },
|
|
409
|
+
146: { name: 'Request for Student Educational Record (Transcript)' },
|
|
410
|
+
147: { name: 'Response to Request for Student Educational Record (Transcript)' },
|
|
411
|
+
148: { name: 'Report of Injury, Illness or Incident' },
|
|
412
|
+
149: { name: 'Notice of Tax Adjustment or Assessment' },
|
|
413
|
+
150: { name: 'Tax Rate Notification' },
|
|
414
|
+
151: { name: 'Electronic Filing of Tax Return Data Acknowledgment' },
|
|
415
|
+
152: { name: 'Statistical Government Information' },
|
|
416
|
+
153: { name: 'Unemployment Insurance Tax Claim or Charge Information' },
|
|
417
|
+
154: { name: 'Uniform Commercial Code Filing' },
|
|
418
|
+
155: { name: 'Business Credit Report' },
|
|
419
|
+
157: { name: 'Notice of Power of Attorney' },
|
|
420
|
+
159: { name: 'Motion Picture Booking Confirmation' },
|
|
421
|
+
160: { name: 'Transportation Automatic Equipment Identification' },
|
|
422
|
+
161: { name: 'Train Sheet' },
|
|
423
|
+
169: { name: 'Transportation Appointment Schedule Information' },
|
|
424
|
+
170: { name: 'Revenue Receipts Statement' },
|
|
425
|
+
175: { name: 'Court and Law Enforcement Notice' },
|
|
426
|
+
176: { name: 'Court Submission TYPE' },
|
|
427
|
+
180: { name: 'Return Merchandise Authorization and Notification' },
|
|
428
|
+
185: { name: 'Royalty Regulatory Report' },
|
|
429
|
+
186: { name: 'Insurance Underwriting Requirements Reporting' },
|
|
430
|
+
188: { name: 'Educational Course Inventory' },
|
|
431
|
+
189: { name: 'Application for Admission to Educational Institutions' },
|
|
432
|
+
190: { name: 'Student Enrollment Verification' },
|
|
433
|
+
191: { name: 'Student Loan Pre-Claims and Claims' },
|
|
434
|
+
194: { name: 'Grant or Assistance Application' },
|
|
435
|
+
195: { name: 'Federal Communications Commission (FCC) License Application' },
|
|
436
|
+
196: { name: 'Contractor Cost Data Reporting' },
|
|
437
|
+
197: { name: 'Real Estate Title Evidence' },
|
|
438
|
+
198: { name: 'Loan Verification Information' },
|
|
439
|
+
199: { name: 'Real Estate Settlement Information' },
|
|
440
|
+
200: { name: 'Mortgage Credit Report' },
|
|
441
|
+
201: { name: 'Residential Loan Application' },
|
|
442
|
+
202: { name: 'Secondary Mortgage Market Loan Delivery' },
|
|
443
|
+
203: { name: 'Secondary Mortgage Market Investor Report' },
|
|
444
|
+
204: { name: 'Motor Carrier Load Tender' },
|
|
445
|
+
205: { name: 'Mortgage Note' },
|
|
446
|
+
206: { name: 'Real Estate Inspection' },
|
|
447
|
+
210: { name: 'Motor Carrier Freight Details and Invoice' },
|
|
448
|
+
211: { name: 'Motor Carrier Bill of Lading', edifactId: 'IFTMCE' },
|
|
449
|
+
212: { name: 'Motor Carrier Delivery Trailer Manifest' },
|
|
450
|
+
213: { name: 'Motor Carrier Shipment Status Inquiry' },
|
|
451
|
+
214: { name: 'Transportation Carrier Shipment Status Message' },
|
|
452
|
+
215: { name: 'Motor Carrier Pick-up Manifest' },
|
|
453
|
+
216: { name: 'Motor Carrier Shipment Pick-up Notification' },
|
|
454
|
+
217: { name: 'Motor Carrier Loading and Route Guide' },
|
|
455
|
+
218: { name: 'Motor Carrier Tariff Information' },
|
|
456
|
+
219: { name: 'Logistics Service Request' },
|
|
457
|
+
220: { name: 'Logistics Service Response' },
|
|
458
|
+
222: { name: 'Cartage Work Assignment' },
|
|
459
|
+
223: { name: 'Consolidators Freight Bill and Invoice' },
|
|
460
|
+
224: { name: 'Motor Carrier Summary Freight Bill Manifest' },
|
|
461
|
+
225: { name: 'Response to a Cartage Work Assignment' },
|
|
462
|
+
240: { name: 'Motor Carrier Package Status' },
|
|
463
|
+
242: { name: 'Data Status Tracking' },
|
|
464
|
+
244: { name: 'Product Source Information' },
|
|
465
|
+
248: { name: 'Account Assignment/Inquiry and Service/Status' },
|
|
466
|
+
249: { name: 'Animal Toxicological Data' },
|
|
467
|
+
250: { name: 'Purchase Order Shipment Management Document' },
|
|
468
|
+
251: { name: 'Pricing Support' },
|
|
469
|
+
252: { name: 'Insurance Producer Administration' },
|
|
470
|
+
255: { name: 'Underwriting Information Services' },
|
|
471
|
+
256: { name: 'Periodic Compensation' },
|
|
472
|
+
260: { name: 'Application for Mortgage Insurance Benefits' },
|
|
473
|
+
261: { name: 'Real Estate Information Request' },
|
|
474
|
+
262: { name: 'Real Estate Information Report' },
|
|
475
|
+
263: { name: 'Residential Mortgage Insurance Application Response' },
|
|
476
|
+
264: { name: 'Mortgage Loan Default Status' },
|
|
477
|
+
265: { name: 'Real Estate Title Insurance Services Order' },
|
|
478
|
+
266: { name: 'Mortgage or Property Record Change Notification' },
|
|
479
|
+
267: { name: 'Individual Life, Annuity and Disability Application' },
|
|
480
|
+
268: { name: 'Annuity Activity' },
|
|
481
|
+
270: { name: 'Eligibility, Coverage or Benefit Inquiry' },
|
|
482
|
+
271: { name: 'Eligibility, Coverage or Benefit Information' },
|
|
483
|
+
272: { name: 'Property and Casualty Loss Notification' },
|
|
484
|
+
273: { name: 'Insurance/Annuity Application Status' },
|
|
485
|
+
274: { name: 'Health Care Provider Information' },
|
|
486
|
+
275: { name: 'Patient Information' },
|
|
487
|
+
276: { name: 'Health Care Claim Status Request' },
|
|
488
|
+
277: { name: 'Health Care Claim Status Notification' },
|
|
489
|
+
278: { name: 'Health Care Services Insurance/Benefit Review Information' },
|
|
490
|
+
280: { name: 'Voter Registration Information' },
|
|
491
|
+
285: { name: 'Commercial Vehicle Safety and Credentials Information Exchange' },
|
|
492
|
+
286: { name: 'Commercial Vehicle Credentials' },
|
|
493
|
+
288: { name: 'Wage Determination' },
|
|
494
|
+
290: { name: 'Cooperative Advertising Agreements' },
|
|
495
|
+
300: { name: 'Reservation (Booking Request) (Ocean)' },
|
|
496
|
+
301: { name: 'Confirmation (Ocean)', edifactId: 'IFTMBC' },
|
|
497
|
+
303: { name: 'Booking Cancellation (Ocean)' },
|
|
498
|
+
304: { name: 'Shipping Instructions' },
|
|
499
|
+
309: { name: 'U.S. Customs Manifest' },
|
|
500
|
+
310: { name: 'Freight Receipt and Invoice (Ocean)' },
|
|
501
|
+
311: { name: 'Canadian Customs Information' },
|
|
502
|
+
312: { name: 'Arrival Notice (Ocean)' },
|
|
503
|
+
313: { name: 'Shipment Status Inquiry (Ocean)' },
|
|
504
|
+
315: { name: 'Status Details (Ocean)' },
|
|
505
|
+
317: { name: 'Delivery/Pickup Order' },
|
|
506
|
+
319: { name: 'Terminal Information' },
|
|
507
|
+
322: { name: 'Terminal Operations and Intermodal Ramp Activity' },
|
|
508
|
+
323: { name: 'Vessel Schedule and Itinerary (Ocean)' },
|
|
509
|
+
324: { name: 'Vessel Stow Plan (Ocean)' },
|
|
510
|
+
325: { name: 'Consolidation of Goods In Container' },
|
|
511
|
+
326: { name: 'Consignment Summary List' },
|
|
512
|
+
350: { name: 'U.S. Customs Status Information' },
|
|
513
|
+
352: { name: 'U.S. Customs Carrier General Order Status' },
|
|
514
|
+
353: { name: 'U.S. Customs Events Advisory Details' },
|
|
515
|
+
354: { name: 'U.S. Customs Automated Manifest Archive Status' },
|
|
516
|
+
355: { name: 'U.S. Customs Acceptance/Rejection' },
|
|
517
|
+
356: { name: 'U.S. Customs Permit to Transfer Request' },
|
|
518
|
+
357: { name: 'U.S. Customs In-Bond Information' },
|
|
519
|
+
358: { name: 'U.S. Customs Consist Information' },
|
|
520
|
+
361: { name: 'Carrier Interchange Agreement (Ocean)' },
|
|
521
|
+
362: { name: 'Cargo Insurance Advice of Shipment' },
|
|
522
|
+
404: { name: 'Rail Carrier Shipment Information' },
|
|
523
|
+
410: { name: 'Rail Carrier Freight Details and Invoice' },
|
|
524
|
+
411: { name: 'Rail Carrier Freight Details and Invoice Summary' },
|
|
525
|
+
412: { name: 'Trailer or Container Repair Billing' },
|
|
526
|
+
414: { name: 'Rail Carhire Settlements' },
|
|
527
|
+
417: { name: 'Rail Carrier Waybill Interchange' },
|
|
528
|
+
418: { name: 'Rail Advance Interchange Consist' },
|
|
529
|
+
419: { name: 'Advance Car Disposition' },
|
|
530
|
+
420: { name: 'Car Handling Information' },
|
|
531
|
+
421: { name: 'Estimated Time of Arrival and Car Scheduling' },
|
|
515
532
|
422: { name: "Shipper's Car Order" },
|
|
516
|
-
423: { name:
|
|
517
|
-
424: { name:
|
|
518
|
-
425: { name:
|
|
519
|
-
426: { name:
|
|
520
|
-
427: { name:
|
|
521
|
-
429: { name:
|
|
522
|
-
431: { name:
|
|
523
|
-
432: { name:
|
|
524
|
-
433: { name:
|
|
525
|
-
434: { name:
|
|
526
|
-
435: { name:
|
|
527
|
-
436: { name:
|
|
528
|
-
437: { name:
|
|
529
|
-
440: { name:
|
|
530
|
-
451: { name:
|
|
531
|
-
452: { name:
|
|
532
|
-
453: { name:
|
|
533
|
-
455: { name:
|
|
534
|
-
456: { name:
|
|
535
|
-
460: { name:
|
|
536
|
-
463: { name:
|
|
537
|
-
466: { name:
|
|
538
|
-
468: { name:
|
|
539
|
-
470: { name:
|
|
540
|
-
475: { name:
|
|
541
|
-
485: { name:
|
|
542
|
-
486: { name:
|
|
543
|
-
490: { name:
|
|
544
|
-
492: { name:
|
|
545
|
-
494: { name:
|
|
546
|
-
500: { name:
|
|
547
|
-
501: { name:
|
|
548
|
-
503: { name:
|
|
549
|
-
504: { name:
|
|
550
|
-
511: { name:
|
|
551
|
-
517: { name:
|
|
552
|
-
521: { name:
|
|
553
|
-
527: { name:
|
|
554
|
-
536: { name:
|
|
555
|
-
540: { name:
|
|
556
|
-
561: { name:
|
|
557
|
-
567: { name:
|
|
558
|
-
568: { name:
|
|
559
|
-
601: { name:
|
|
560
|
-
602: { name:
|
|
561
|
-
620: { name:
|
|
562
|
-
625: { name:
|
|
563
|
-
650: { name:
|
|
564
|
-
715: { name:
|
|
565
|
-
805: { name:
|
|
566
|
-
806: { name:
|
|
567
|
-
810: { name:
|
|
568
|
-
811: { name:
|
|
569
|
-
812: { name:
|
|
570
|
-
813: { name:
|
|
571
|
-
814: { name:
|
|
572
|
-
815: { name:
|
|
573
|
-
816: { name:
|
|
574
|
-
818: { name:
|
|
575
|
-
819: { name:
|
|
576
|
-
820: { name:
|
|
577
|
-
821: { name:
|
|
578
|
-
822: { name:
|
|
579
|
-
823: { name:
|
|
580
|
-
824: { name:
|
|
581
|
-
826: { name:
|
|
582
|
-
827: { name:
|
|
583
|
-
828: { name:
|
|
584
|
-
829: { name:
|
|
585
|
-
830: { name:
|
|
586
|
-
831: { name:
|
|
587
|
-
832: { name:
|
|
588
|
-
833: { name:
|
|
589
|
-
834: { name:
|
|
590
|
-
835: { name:
|
|
591
|
-
836: { name:
|
|
592
|
-
837: { name:
|
|
593
|
-
838: { name:
|
|
594
|
-
839: { name:
|
|
595
|
-
840: { name:
|
|
596
|
-
841: { name:
|
|
597
|
-
842: { name:
|
|
598
|
-
843: { name:
|
|
599
|
-
844: { name:
|
|
600
|
-
845: { name:
|
|
601
|
-
846: { name:
|
|
602
|
-
847: { name:
|
|
603
|
-
848: { name:
|
|
604
|
-
849: { name:
|
|
605
|
-
850: { name:
|
|
606
|
-
851: { name:
|
|
607
|
-
852: { name:
|
|
608
|
-
853: { name:
|
|
609
|
-
854: { name:
|
|
610
|
-
855: { name:
|
|
611
|
-
856: { name:
|
|
612
|
-
857: { name:
|
|
613
|
-
858: { name:
|
|
614
|
-
859: { name:
|
|
615
|
-
860: { name:
|
|
616
|
-
861: { name:
|
|
617
|
-
862: { name:
|
|
618
|
-
863: { name:
|
|
619
|
-
864: { name:
|
|
620
|
-
865: { name:
|
|
621
|
-
866: { name:
|
|
622
|
-
867: { name:
|
|
623
|
-
868: { name:
|
|
624
|
-
869: { name:
|
|
625
|
-
870: { name:
|
|
626
|
-
871: { name:
|
|
627
|
-
872: { name:
|
|
628
|
-
875: { name:
|
|
629
|
-
876: { name:
|
|
630
|
-
877: { name:
|
|
631
|
-
878: { name:
|
|
632
|
-
879: { name:
|
|
633
|
-
880: { name:
|
|
634
|
-
881: { name:
|
|
635
|
-
882: { name:
|
|
636
|
-
883: { name:
|
|
637
|
-
884: { name:
|
|
638
|
-
885: { name:
|
|
639
|
-
886: { name:
|
|
640
|
-
887: { name:
|
|
641
|
-
888: { name:
|
|
642
|
-
889: { name:
|
|
643
|
-
891: { name:
|
|
644
|
-
893: { name:
|
|
645
|
-
894: { name:
|
|
646
|
-
895: { name:
|
|
647
|
-
896: { name:
|
|
648
|
-
920: { name:
|
|
649
|
-
924: { name:
|
|
650
|
-
925: { name:
|
|
651
|
-
926: { name:
|
|
652
|
-
928: { name:
|
|
653
|
-
940: { name:
|
|
654
|
-
943: { name:
|
|
655
|
-
944: { name:
|
|
656
|
-
945: { name:
|
|
657
|
-
947: { name:
|
|
658
|
-
980: { name:
|
|
659
|
-
990: { name:
|
|
660
|
-
996: { name:
|
|
661
|
-
997: { name:
|
|
662
|
-
998: { name:
|
|
663
|
-
999: { name:
|
|
533
|
+
423: { name: 'Rail Industrial Switch List' },
|
|
534
|
+
424: { name: 'Rail Carrier Services Settlement' },
|
|
535
|
+
425: { name: 'Rail Waybill Request' },
|
|
536
|
+
426: { name: 'Rail Revenue Waybill' },
|
|
537
|
+
427: { name: 'Rail Waybill Response' },
|
|
538
|
+
429: { name: 'Railroad Retirement Activity' },
|
|
539
|
+
431: { name: 'Railroad Station Master File' },
|
|
540
|
+
432: { name: 'Rail Deprescription' },
|
|
541
|
+
433: { name: 'Railroad Reciprocal Switch File' },
|
|
542
|
+
434: { name: 'Railroad Mark Register Update Activity' },
|
|
543
|
+
435: { name: 'Standard Transportation Commodity Code (STCC) Master' },
|
|
544
|
+
436: { name: 'Locomotive Information' },
|
|
545
|
+
437: { name: 'Railroad Junctions and Interchanges Activity' },
|
|
546
|
+
440: { name: 'Shipment Weights' },
|
|
547
|
+
451: { name: 'Railroad Event Report' },
|
|
548
|
+
452: { name: 'Railroad Problem Log Inquiry or Advice' },
|
|
549
|
+
453: { name: 'Railroad Service Commitment Advice' },
|
|
550
|
+
455: { name: 'Railroad Parameter Trace Registration' },
|
|
551
|
+
456: { name: 'Railroad Equipment Inquiry or Advice' },
|
|
552
|
+
460: { name: 'Railroad Price Distribution Request or Response' },
|
|
553
|
+
463: { name: 'Rail Rate Reply' },
|
|
554
|
+
466: { name: 'Rate Request' },
|
|
555
|
+
468: { name: 'Rate Docket Journal Log' },
|
|
556
|
+
470: { name: 'Railroad Clearance' },
|
|
557
|
+
475: { name: 'Rail Route File Maintenance' },
|
|
558
|
+
485: { name: 'Ratemaking Action' },
|
|
559
|
+
486: { name: 'Rate Docket Expiration' },
|
|
560
|
+
490: { name: 'Rate Group Definition' },
|
|
561
|
+
492: { name: 'Miscellaneous Rates' },
|
|
562
|
+
494: { name: 'Rail Scale Rates' },
|
|
563
|
+
500: { name: 'Medical Event Reporting' },
|
|
564
|
+
501: { name: 'Vendor Performance Review' },
|
|
565
|
+
503: { name: 'Pricing History' },
|
|
566
|
+
504: { name: 'Clauses and Provisions' },
|
|
567
|
+
511: { name: 'Requisition' },
|
|
568
|
+
517: { name: 'Material Obligation Validation' },
|
|
569
|
+
521: { name: 'Income or Asset Offset' },
|
|
570
|
+
527: { name: 'Material Due-In and Receipt' },
|
|
571
|
+
536: { name: 'Logistics Reassignment' },
|
|
572
|
+
540: { name: 'Notice of Employment Status' },
|
|
573
|
+
561: { name: 'Contract Abstract' },
|
|
574
|
+
567: { name: 'Contract Completion Status' },
|
|
575
|
+
568: { name: 'Contract Payment Management Report' },
|
|
576
|
+
601: { name: 'U.S. Customs Export Shipment Information' },
|
|
577
|
+
602: { name: 'Transportation Services Tender' },
|
|
578
|
+
620: { name: 'Excavation Communication' },
|
|
579
|
+
625: { name: 'Well Information' },
|
|
580
|
+
650: { name: 'Maintenance Service Order' },
|
|
581
|
+
715: { name: 'Intermodal Group Loading Plan' },
|
|
582
|
+
805: { name: 'Contract Pricing Proposal' },
|
|
583
|
+
806: { name: 'Project Schedule Reporting' },
|
|
584
|
+
810: { name: 'Invoice', edifactId: 'INVOIC' },
|
|
585
|
+
811: { name: 'Consolidated Service Invoice/Statement' },
|
|
586
|
+
812: { name: 'Credit/Debit Adjustment' },
|
|
587
|
+
813: { name: 'Electronic Filing of Tax Return Data' },
|
|
588
|
+
814: { name: 'General Request, Response or Confirmation' },
|
|
589
|
+
815: { name: 'Cryptographic Service Message' },
|
|
590
|
+
816: { name: 'Organizational Relationships' },
|
|
591
|
+
818: { name: 'Commission Sales Report' },
|
|
592
|
+
819: { name: 'Operating Expense Statement' },
|
|
593
|
+
820: { name: 'Payment Order/Remittance Advice', edifactId: 'REMADV' },
|
|
594
|
+
821: { name: 'Financial Information Reporting' },
|
|
595
|
+
822: { name: 'Account Analysis' },
|
|
596
|
+
823: { name: 'Lockbox' },
|
|
597
|
+
824: { name: 'Application Advice', edifactId: 'APERAK' },
|
|
598
|
+
826: { name: 'Tax Information Exchange' },
|
|
599
|
+
827: { name: 'Financial Return Notice' },
|
|
600
|
+
828: { name: 'Debit Authorization' },
|
|
601
|
+
829: { name: 'Payment Cancellation Request' },
|
|
602
|
+
830: { name: 'Planning Schedule with Release Capability', edifactId: 'DELFOR' },
|
|
603
|
+
831: { name: 'Application Control Totals' },
|
|
604
|
+
832: { name: 'Price/Sales Catalog', edifactId: 'PRICAT' },
|
|
605
|
+
833: { name: 'Mortgage Credit Report Order' },
|
|
606
|
+
834: { name: 'Benefit Enrollment and Maintenance' },
|
|
607
|
+
835: { name: 'Health Care Claim Payment/Advice' },
|
|
608
|
+
836: { name: 'Procurement Notices' },
|
|
609
|
+
837: { name: 'Health Care Claim' },
|
|
610
|
+
838: { name: 'Trading Partner Profile' },
|
|
611
|
+
839: { name: 'Project Cost Reporting' },
|
|
612
|
+
840: { name: 'Request for Quotation', edifactId: 'REQUOTE' },
|
|
613
|
+
841: { name: 'Specifications/Technical Information' },
|
|
614
|
+
842: { name: 'Nonconformance Report' },
|
|
615
|
+
843: { name: 'Response to Request for Quotation', edifactId: 'QUOTES' },
|
|
616
|
+
844: { name: 'Product Transfer Account Adjustment', edifactId: 'SSDCLM' },
|
|
617
|
+
845: { name: 'Price Authorization Acknowledgment/Status', edifactId: 'ATHSTS' },
|
|
618
|
+
846: { name: 'Inventory Inquiry/Advice', edifactId: 'INVRPT' },
|
|
619
|
+
847: { name: 'Material Claim' },
|
|
620
|
+
848: { name: 'Material Safety Data Sheet' },
|
|
621
|
+
849: { name: 'Response to Product Transfer Account Adjustment' },
|
|
622
|
+
850: { name: 'Purchase Order', edifactId: 'ORDERS' },
|
|
623
|
+
851: { name: 'Asset Schedule' },
|
|
624
|
+
852: { name: 'Product Activity Data', edifactId: 'SLSRPT' },
|
|
625
|
+
853: { name: 'Routing and Carrier Instruction' },
|
|
626
|
+
854: { name: 'Shipment Delivery Discrepancy Information' },
|
|
627
|
+
855: { name: 'Purchase Order Acknowledgment', edifactId: 'ORDRSP' },
|
|
628
|
+
856: { name: 'Advance Ship Notice/Manifest', edifactId: 'DESADV' },
|
|
629
|
+
857: { name: 'Shipment and Billing Notice' },
|
|
630
|
+
858: { name: 'Shipment Information' },
|
|
631
|
+
859: { name: 'Freight Invoice' },
|
|
632
|
+
860: { name: 'Purchase Order Change', edifactId: 'ORDCHG' },
|
|
633
|
+
861: { name: 'Receiving Advice/Acceptance Certificate', edifactId: 'RECADV' },
|
|
634
|
+
862: { name: 'Shipping Schedule', edifactId: 'DELJIT' },
|
|
635
|
+
863: { name: 'Report of Test Results' },
|
|
636
|
+
864: { name: 'Text Message' },
|
|
637
|
+
865: { name: 'Purchase Order Change', edifactId: 'ORDRSP' },
|
|
638
|
+
866: { name: 'Production Sequence' },
|
|
639
|
+
867: { name: 'Product Transfer and Resale Report', edifactId: 'SLSRPT' },
|
|
640
|
+
868: { name: 'Electronic Form Structure' },
|
|
641
|
+
869: { name: 'Order Status Inquiry', edifactId: 'ORSSTA' },
|
|
642
|
+
870: { name: 'Order Status Report', edifactId: 'ORDREP' },
|
|
643
|
+
871: { name: 'Component Parts Content' },
|
|
644
|
+
872: { name: 'Residential Mortgage Insurance Application' },
|
|
645
|
+
875: { name: 'Grocery Products Purchase Order' },
|
|
646
|
+
876: { name: 'Grocery Products Purchase Order Change' },
|
|
647
|
+
877: { name: 'Manufacturer Coupon Family Code Structure' },
|
|
648
|
+
878: { name: 'Product Authorization/De-authorization' },
|
|
649
|
+
879: { name: 'Price Information' },
|
|
650
|
+
880: { name: 'Grocery Products Invoice' },
|
|
651
|
+
881: { name: 'Manufacturer Coupon Redemption Detail' },
|
|
652
|
+
882: { name: 'Direct Store Delivery Summary Information' },
|
|
653
|
+
883: { name: 'Market Development Fund Allocation' },
|
|
654
|
+
884: { name: 'Market Development Fund Settlement' },
|
|
655
|
+
885: { name: 'Retail Account Characteristics' },
|
|
656
|
+
886: { name: 'Customer Call Reporting' },
|
|
657
|
+
887: { name: 'Coupon Notification' },
|
|
658
|
+
888: { name: 'Item Maintenance' },
|
|
659
|
+
889: { name: 'Promotion Announcement' },
|
|
660
|
+
891: { name: 'Deduction Research Report' },
|
|
661
|
+
893: { name: 'Item Information Request' },
|
|
662
|
+
894: { name: 'Delivery/Return Base Record' },
|
|
663
|
+
895: { name: 'Delivery/Return Acknowledgment or Adjustment' },
|
|
664
|
+
896: { name: 'Product Dimension Maintenance' },
|
|
665
|
+
920: { name: 'Loss or Damage Claim - General Commodities' },
|
|
666
|
+
924: { name: 'Loss or Damage Claim - Motor Vehicle' },
|
|
667
|
+
925: { name: 'Claim Tracer' },
|
|
668
|
+
926: { name: 'Claim Status Report and Tracer Reply' },
|
|
669
|
+
928: { name: 'Automotive Inspection Detail' },
|
|
670
|
+
940: { name: 'Warehouse Shipping Order' },
|
|
671
|
+
943: { name: 'Warehouse Stock Transfer Shipment Advice' },
|
|
672
|
+
944: { name: 'Warehouse Stock Transfer Receipt Advice' },
|
|
673
|
+
945: { name: 'Warehouse Shipping Advice' },
|
|
674
|
+
947: { name: 'Warehouse Inventory Adjustment Advice' },
|
|
675
|
+
980: { name: 'Functional Group Totals' },
|
|
676
|
+
990: { name: 'Response to a Load Tender' },
|
|
677
|
+
996: { name: 'File Transfer' },
|
|
678
|
+
997: { name: 'Functional Acknowledgment', edifactId: 'CONTROL' },
|
|
679
|
+
998: { name: 'Set Cancellation' },
|
|
680
|
+
999: { name: 'Implementation Acknowledgment' },
|
|
664
681
|
});
|
|
665
682
|
|
|
666
683
|
/** A property decorated with this will have any value assigned
|
|
@@ -675,7 +692,7 @@ function castToNumber() {
|
|
|
675
692
|
enumerable: false,
|
|
676
693
|
configurable: true,
|
|
677
694
|
writable: true,
|
|
678
|
-
value: undefined
|
|
695
|
+
value: undefined,
|
|
679
696
|
},
|
|
680
697
|
_a[key] = {
|
|
681
698
|
enumerable: true,
|
|
@@ -685,7 +702,7 @@ function castToNumber() {
|
|
|
685
702
|
},
|
|
686
703
|
set: function (newValue) {
|
|
687
704
|
this[internalKey] = +newValue;
|
|
688
|
-
}
|
|
705
|
+
},
|
|
689
706
|
},
|
|
690
707
|
_a));
|
|
691
708
|
};
|
|
@@ -696,19 +713,19 @@ function castToNumber() {
|
|
|
696
713
|
*/
|
|
697
714
|
function debounced(ms) {
|
|
698
715
|
return function (target, propertyKey, descriptor) {
|
|
699
|
-
var originalDescriptorCopy =
|
|
700
|
-
|
|
716
|
+
var originalDescriptorCopy = __assign({}, descriptor);
|
|
717
|
+
originalDescriptorCopy.get = function get() {
|
|
701
718
|
/* Make a new copy each time; if you don't then every instance after the first
|
|
702
719
|
* one of the class containing the decorated method will break. */
|
|
703
|
-
var newDescriptorWithDebounced =
|
|
720
|
+
var newDescriptorWithDebounced = __assign({}, originalDescriptorCopy);
|
|
704
721
|
newDescriptorWithDebounced.value = debounce(originalDescriptorCopy.value, ms, this);
|
|
705
722
|
Object.defineProperty(this, propertyKey, newDescriptorWithDebounced);
|
|
706
723
|
return newDescriptorWithDebounced.value;
|
|
707
724
|
};
|
|
708
|
-
|
|
709
|
-
delete
|
|
710
|
-
delete
|
|
711
|
-
return
|
|
725
|
+
originalDescriptorCopy.configurable = true;
|
|
726
|
+
delete originalDescriptorCopy.writable;
|
|
727
|
+
delete originalDescriptorCopy.value;
|
|
728
|
+
return originalDescriptorCopy;
|
|
712
729
|
};
|
|
713
730
|
}
|
|
714
731
|
|
|
@@ -716,19 +733,19 @@ function debounced(ms) {
|
|
|
716
733
|
* Decorator that applies `lockToAnimationFrames`
|
|
717
734
|
*/
|
|
718
735
|
function lockedToAnimationFrames(target, propertyKey, descriptor) {
|
|
719
|
-
var originalDescriptorCopy =
|
|
720
|
-
|
|
736
|
+
var originalDescriptorCopy = __assign({}, descriptor);
|
|
737
|
+
originalDescriptorCopy.get = function get() {
|
|
721
738
|
/* Make a new copy each time; if you don't then every instance after the first
|
|
722
|
-
|
|
723
|
-
var newDescriptor =
|
|
739
|
+
* one of the class containing the decorated method will break. */
|
|
740
|
+
var newDescriptor = __assign({}, originalDescriptorCopy);
|
|
724
741
|
newDescriptor.value = lockToAnimationFrames(originalDescriptorCopy.value, this);
|
|
725
742
|
Object.defineProperty(this, propertyKey, newDescriptor);
|
|
726
743
|
return newDescriptor.value;
|
|
727
744
|
};
|
|
728
|
-
|
|
729
|
-
delete
|
|
730
|
-
delete
|
|
731
|
-
return
|
|
745
|
+
originalDescriptorCopy.configurable = true;
|
|
746
|
+
delete originalDescriptorCopy.writable;
|
|
747
|
+
delete originalDescriptorCopy.value;
|
|
748
|
+
return originalDescriptorCopy;
|
|
732
749
|
}
|
|
733
750
|
|
|
734
751
|
/** This would be simpler to understand as a factory that returns a decorator function,
|
|
@@ -739,25 +756,25 @@ function lockedToAnimationFrames(target, propertyKey, descriptor) {
|
|
|
739
756
|
* needs to do.
|
|
740
757
|
*/
|
|
741
758
|
function simpleMetadataDecoratorApplicator(metadata, defaults, target, key, descriptor) {
|
|
742
|
-
|
|
743
|
-
var getter =
|
|
744
|
-
var value =
|
|
745
|
-
|
|
759
|
+
var updatedDescriptor = descriptor || Object.getOwnPropertyDescriptor(target, key);
|
|
760
|
+
var getter = updatedDescriptor.get;
|
|
761
|
+
var value = updatedDescriptor.value;
|
|
762
|
+
updatedDescriptor.get = function get() {
|
|
746
763
|
var e_1, _a;
|
|
747
764
|
var self = this;
|
|
748
765
|
var fn = value || getter.call(this);
|
|
749
766
|
var boundFn = fn.bind(this);
|
|
750
|
-
|
|
767
|
+
var updatedMetadata = __assign(__assign({}, defaults), metadata);
|
|
751
768
|
var _loop_1 = function (prop) {
|
|
752
|
-
if (typeof metadata[prop] ===
|
|
769
|
+
if (typeof metadata[prop] === 'function') {
|
|
753
770
|
Object.defineProperty(boundFn, prop, {
|
|
754
771
|
get: function () {
|
|
755
|
-
return
|
|
756
|
-
}
|
|
772
|
+
return updatedMetadata[prop](self);
|
|
773
|
+
},
|
|
757
774
|
});
|
|
758
775
|
}
|
|
759
776
|
else {
|
|
760
|
-
boundFn[prop] =
|
|
777
|
+
boundFn[prop] = updatedMetadata[prop];
|
|
761
778
|
}
|
|
762
779
|
};
|
|
763
780
|
try {
|
|
@@ -776,32 +793,32 @@ function simpleMetadataDecoratorApplicator(metadata, defaults, target, key, desc
|
|
|
776
793
|
Object.defineProperty(this, key, {
|
|
777
794
|
writable: true,
|
|
778
795
|
configurable: true,
|
|
779
|
-
enumerable:
|
|
780
|
-
value: boundFn
|
|
796
|
+
enumerable: updatedDescriptor.enumerable,
|
|
797
|
+
value: boundFn,
|
|
781
798
|
});
|
|
782
799
|
return boundFn;
|
|
783
800
|
};
|
|
784
|
-
delete
|
|
785
|
-
delete
|
|
786
|
-
return
|
|
801
|
+
delete updatedDescriptor.value;
|
|
802
|
+
delete updatedDescriptor.writable;
|
|
803
|
+
return updatedDescriptor;
|
|
787
804
|
}
|
|
788
805
|
|
|
789
806
|
/** Method decorator that configures the method to always run the tick after it's invoked */
|
|
790
807
|
function tickDelay(target, propertyKey, descriptor) {
|
|
791
|
-
var originalDescriptorCopy =
|
|
792
|
-
|
|
793
|
-
var _this = this;
|
|
808
|
+
var originalDescriptorCopy = __assign({}, descriptor);
|
|
809
|
+
originalDescriptorCopy.get = function get() {
|
|
794
810
|
/* Make a new copy each time; if you don't then every instance after the first
|
|
795
|
-
|
|
796
|
-
var newDescriptor =
|
|
797
|
-
|
|
811
|
+
* one of the class containing the decorated method will break. */
|
|
812
|
+
var newDescriptor = __assign({}, originalDescriptorCopy);
|
|
813
|
+
var boundFn = originalDescriptorCopy.value.bind(this);
|
|
814
|
+
newDescriptor.value = function () { return setTimeout(boundFn, 0); };
|
|
798
815
|
Object.defineProperty(this, propertyKey, newDescriptor);
|
|
799
816
|
return newDescriptor.value;
|
|
800
817
|
};
|
|
801
|
-
|
|
802
|
-
delete
|
|
803
|
-
delete
|
|
804
|
-
return
|
|
818
|
+
originalDescriptorCopy.configurable = true;
|
|
819
|
+
delete originalDescriptorCopy.writable;
|
|
820
|
+
delete originalDescriptorCopy.value;
|
|
821
|
+
return originalDescriptorCopy;
|
|
805
822
|
}
|
|
806
823
|
|
|
807
824
|
/** Constrains a number to the given range. If the number is below the
|
|
@@ -827,11 +844,15 @@ function constrain(n, range) {
|
|
|
827
844
|
*/
|
|
828
845
|
function decimalRound(num, decimalPlaces) {
|
|
829
846
|
if (decimalPlaces === void 0) { decimalPlaces = 0; }
|
|
830
|
-
var integralAndFractionalSplit = String(num).split(
|
|
831
|
-
|
|
832
|
-
|
|
847
|
+
var integralAndFractionalSplit = String(num).split('.');
|
|
848
|
+
var allDecimalPlaces = integralAndFractionalSplit.length > 1
|
|
849
|
+
? integralAndFractionalSplit[1].length
|
|
850
|
+
: 0;
|
|
851
|
+
var roundedNum = num;
|
|
852
|
+
for (var i = allDecimalPlaces - 1; i >= decimalPlaces; i -= 1) {
|
|
853
|
+
roundedNum = Number(Math.round(Number(roundedNum + "e" + i)) + "e-" + i);
|
|
833
854
|
}
|
|
834
|
-
return
|
|
855
|
+
return roundedNum;
|
|
835
856
|
}
|
|
836
857
|
|
|
837
858
|
/** Converts a file size in bytes to a human-friendly string. For example,
|
|
@@ -840,15 +861,15 @@ function decimalRound(num, decimalPlaces) {
|
|
|
840
861
|
function toFileSizeString(n, precision) {
|
|
841
862
|
if (precision === void 0) { precision = 2; }
|
|
842
863
|
if (n > Number.MAX_SAFE_INTEGER) {
|
|
843
|
-
throw new Error(
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
864
|
+
throw new Error('Number is greater than MAX_SAFE_INTEGER; '
|
|
865
|
+
+ 'toFileSizeString does not support orders of magnitude '
|
|
866
|
+
+ 'higher than petabytes for this reason until BigInt '
|
|
867
|
+
+ 'achieves broad browser support.');
|
|
847
868
|
}
|
|
848
869
|
var magnitude = Math.min(Math.floor(Math.log(n) / Math.log(1024)), 5);
|
|
849
|
-
var unit = [
|
|
870
|
+
var unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'][magnitude];
|
|
850
871
|
var decimalPlaces = magnitude ? precision : 0;
|
|
851
|
-
return decimalRound(n / Math.pow(1024, magnitude), decimalPlaces).toFixed(decimalPlaces) + unit;
|
|
872
|
+
return decimalRound(n / (Math.pow(1024, magnitude)), decimalPlaces).toFixed(decimalPlaces) + unit;
|
|
852
873
|
}
|
|
853
874
|
|
|
854
875
|
/** Converts a path to crumbs.
|
|
@@ -856,7 +877,7 @@ function toFileSizeString(n, precision) {
|
|
|
856
877
|
* "a.b[0].c" -> ["a", "b", "0", "c"]
|
|
857
878
|
*/
|
|
858
879
|
function crumblePath(path) {
|
|
859
|
-
return typeof path ===
|
|
880
|
+
return typeof path === 'string' ? path.match(/[^.[\]]+/g) || [] : [].concat(path);
|
|
860
881
|
}
|
|
861
882
|
|
|
862
883
|
/**
|
|
@@ -903,24 +924,34 @@ function diff(o1, o2, parentPath) {
|
|
|
903
924
|
if (parentPath === void 0) { parentPath = []; }
|
|
904
925
|
var d = [];
|
|
905
926
|
try {
|
|
906
|
-
for (var _b = __values(new Set(
|
|
927
|
+
for (var _b = __values(new Set(__spreadArray(__spreadArray([], __read(Object.keys(o1))), __read(Object.keys(o2))))), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
907
928
|
var key = _c.value;
|
|
908
|
-
var o1HasKey =
|
|
909
|
-
var o2HasKey =
|
|
929
|
+
var o1HasKey = Object.prototype.hasOwnProperty.call(o1, key);
|
|
930
|
+
var o2HasKey = Object.prototype.hasOwnProperty.call(o2, key);
|
|
910
931
|
if (o1HasKey && !o2HasKey) {
|
|
911
|
-
d.push({
|
|
932
|
+
d.push({
|
|
933
|
+
type: DiffChange.DELETION,
|
|
934
|
+
key: key, parentPath: parentPath,
|
|
935
|
+
objects: [o1, o2],
|
|
936
|
+
});
|
|
912
937
|
}
|
|
913
938
|
else if (!o1HasKey && o2HasKey) {
|
|
914
|
-
d.push({
|
|
939
|
+
d.push({
|
|
940
|
+
type: DiffChange.ADDITION,
|
|
941
|
+
key: key, parentPath: parentPath,
|
|
942
|
+
objects: [o1, o2],
|
|
943
|
+
});
|
|
915
944
|
}
|
|
916
|
-
else
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
945
|
+
else if ((isPlainObject(o1[key]) && isPlainObject(o2[key]))
|
|
946
|
+
|| (Array.isArray(o1[key]) && Array.isArray(o2[key]))) {
|
|
947
|
+
d = d.concat(diff(o1[key], o2[key], __spreadArray(__spreadArray([], __read(parentPath)), [key])));
|
|
948
|
+
}
|
|
949
|
+
else if (o1[key] !== o2[key]) {
|
|
950
|
+
d.push({
|
|
951
|
+
type: DiffChange.ALTERATION,
|
|
952
|
+
key: key, parentPath: parentPath,
|
|
953
|
+
objects: [o1, o2],
|
|
954
|
+
});
|
|
924
955
|
}
|
|
925
956
|
}
|
|
926
957
|
}
|
|
@@ -988,8 +1019,8 @@ function forEachNestedObject(object, fn, path) {
|
|
|
988
1019
|
|
|
989
1020
|
var isNil = isNilImport.default || isNilImport;
|
|
990
1021
|
var isEmpty$1 = isEmptyImport.default || isEmptyImport;
|
|
991
|
-
/**
|
|
992
|
-
*
|
|
1022
|
+
/** Get the value at `path` starting from `object`.
|
|
1023
|
+
* Allows optional chaining, e.g. `get(obj, 'a.b?.c')`
|
|
993
1024
|
*/
|
|
994
1025
|
function getPath(object, path, defaultValue, allOptional) {
|
|
995
1026
|
var e_1, _a, _b;
|
|
@@ -1003,7 +1034,7 @@ function getPath(object, path, defaultValue, allOptional) {
|
|
|
1003
1034
|
var crumb = _d.value;
|
|
1004
1035
|
var key = crumb;
|
|
1005
1036
|
var optional = void 0;
|
|
1006
|
-
if (typeof crumb ===
|
|
1037
|
+
if (typeof crumb === 'string') {
|
|
1007
1038
|
_b = __read(crumb.match(/^([^?]+)(\?)?$/), 3), key = _b[1], optional = _b[2];
|
|
1008
1039
|
}
|
|
1009
1040
|
value = value[key];
|
|
@@ -1055,11 +1086,11 @@ var isEmpty = isEmptyImport.default || isEmptyImport;
|
|
|
1055
1086
|
/** Set the value at `path` on `object`. */
|
|
1056
1087
|
function setPath(object, path, newValue) {
|
|
1057
1088
|
var e_1, _a;
|
|
1058
|
-
if (typeof object !==
|
|
1059
|
-
throw new Error(
|
|
1089
|
+
if (typeof object !== 'object') {
|
|
1090
|
+
throw new Error('object is required');
|
|
1060
1091
|
}
|
|
1061
1092
|
if (isEmpty(path)) {
|
|
1062
|
-
throw new Error(
|
|
1093
|
+
throw new Error('path is required');
|
|
1063
1094
|
}
|
|
1064
1095
|
var crumbs = crumblePath(path);
|
|
1065
1096
|
var finalCrumb = crumbs.splice(crumbs.length - 1, 1)[0];
|
|
@@ -1068,7 +1099,7 @@ function setPath(object, path, newValue) {
|
|
|
1068
1099
|
for (var crumbs_1 = __values(crumbs), crumbs_1_1 = crumbs_1.next(); !crumbs_1_1.done; crumbs_1_1 = crumbs_1.next()) {
|
|
1069
1100
|
var crumb = crumbs_1_1.value;
|
|
1070
1101
|
current = current[crumb];
|
|
1071
|
-
if (typeof current !==
|
|
1102
|
+
if (typeof current !== 'object') {
|
|
1072
1103
|
throw new Error("Cannot set value at given path: Path deadends at " + String(crumb));
|
|
1073
1104
|
}
|
|
1074
1105
|
}
|
|
@@ -1085,13 +1116,14 @@ function setPath(object, path, newValue) {
|
|
|
1085
1116
|
|
|
1086
1117
|
/** Generator for iterating down a path on an object. */
|
|
1087
1118
|
function traversePath(object, path) {
|
|
1088
|
-
var _a, _b, crumb, e_1_1;
|
|
1119
|
+
var obj, _a, _b, crumb, e_1_1;
|
|
1089
1120
|
var e_1, _c;
|
|
1090
1121
|
return __generator(this, function (_d) {
|
|
1091
1122
|
switch (_d.label) {
|
|
1092
1123
|
case 0: return [4 /*yield*/, object];
|
|
1093
1124
|
case 1:
|
|
1094
1125
|
_d.sent();
|
|
1126
|
+
obj = object;
|
|
1095
1127
|
_d.label = 2;
|
|
1096
1128
|
case 2:
|
|
1097
1129
|
_d.trys.push([2, 7, 8, 9]);
|
|
@@ -1100,8 +1132,8 @@ function traversePath(object, path) {
|
|
|
1100
1132
|
case 3:
|
|
1101
1133
|
if (!!_b.done) return [3 /*break*/, 6];
|
|
1102
1134
|
crumb = _b.value;
|
|
1103
|
-
|
|
1104
|
-
return [4 /*yield*/,
|
|
1135
|
+
obj = obj[crumb];
|
|
1136
|
+
return [4 /*yield*/, obj];
|
|
1105
1137
|
case 4:
|
|
1106
1138
|
_d.sent();
|
|
1107
1139
|
_d.label = 5;
|
|
@@ -1140,7 +1172,7 @@ function mergeDeep() {
|
|
|
1140
1172
|
try {
|
|
1141
1173
|
for (var _c = (e_2 = void 0, __values(Object.keys(mergee))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1142
1174
|
var key = _d.value;
|
|
1143
|
-
if (
|
|
1175
|
+
if (Object.prototype.hasOwnProperty.call(result, key)
|
|
1144
1176
|
&& Object.getOwnPropertyDescriptor(result, key).writable
|
|
1145
1177
|
&& isPlainObject(result[key])) {
|
|
1146
1178
|
result[key] = mergeDeep(result[key], mergee[key]);
|
|
@@ -1188,7 +1220,7 @@ function mergePropertiesDeep() {
|
|
|
1188
1220
|
try {
|
|
1189
1221
|
for (var _c = (e_2 = void 0, __values(Object.keys(mergee))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1190
1222
|
var key = _d.value;
|
|
1191
|
-
if (
|
|
1223
|
+
if (Object.prototype.hasOwnProperty.call(result, key)
|
|
1192
1224
|
&& Object.getOwnPropertyDescriptor(result, key).writable
|
|
1193
1225
|
&& isPlainObject(result[key])) {
|
|
1194
1226
|
result[key] = mergePropertiesDeep(result[key], mergee[key]);
|
|
@@ -1246,11 +1278,11 @@ function code(strings) {
|
|
|
1246
1278
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1247
1279
|
interpolations[_i - 1] = arguments[_i];
|
|
1248
1280
|
}
|
|
1249
|
-
var s = strings.reduce(function (a, b, i) { return a + (i <= interpolations.length ? interpolations[i - 1] :
|
|
1250
|
-
var leadingWhitespace = Math.min.apply(Math,
|
|
1281
|
+
var s = strings.reduce(function (a, b, i) { return a + (i <= interpolations.length ? interpolations[i - 1] : '') + b; });
|
|
1282
|
+
var leadingWhitespace = Math.min.apply(Math, __spreadArray([], __read(s.split(/[\r\n]/)
|
|
1251
1283
|
.filter(function (l) { return l.trim(); })
|
|
1252
|
-
.map(function (l) { return l.match(/^ */)[0].length; })));
|
|
1253
|
-
return s.replace(new RegExp("^ {" + leadingWhitespace + "}",
|
|
1284
|
+
.map(function (l) { return l.match(/^ */)[0].length; }))));
|
|
1285
|
+
return s.replace(new RegExp("^ {" + leadingWhitespace + "}", 'gm'), '').trim();
|
|
1254
1286
|
}
|
|
1255
1287
|
|
|
1256
1288
|
/** Parses a string as a file size and returns the size in bytes. For example,
|
|
@@ -1259,24 +1291,24 @@ function code(strings) {
|
|
|
1259
1291
|
function parseFileSize(fileSize) {
|
|
1260
1292
|
var unitMatch = fileSize.match(/[A-Z]?B$/);
|
|
1261
1293
|
if (!unitMatch) {
|
|
1262
|
-
throw new Error("Input to parseFileSize (\"" + fileSize + "\") doesn't seem like a file size; "
|
|
1263
|
-
|
|
1294
|
+
throw new Error("Input to parseFileSize (\"" + fileSize + "\") doesn't seem like a file size; "
|
|
1295
|
+
+ 'cannot identify a unit (e.g. KB, GB)');
|
|
1264
1296
|
}
|
|
1265
1297
|
var _a = __read(unitMatch, 1), unit = _a[0];
|
|
1266
|
-
var num = +fileSize.replace(unit,
|
|
1298
|
+
var num = +fileSize.replace(unit, '');
|
|
1267
1299
|
if (Number.isNaN(num)) {
|
|
1268
1300
|
throw new Error("Could not parse a number out of input to parseFileSize (\"" + fileSize + "\")");
|
|
1269
1301
|
}
|
|
1270
|
-
var magnitude = [
|
|
1302
|
+
var magnitude = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'].indexOf(unit);
|
|
1271
1303
|
if (magnitude === -1) {
|
|
1272
|
-
throw new Error(
|
|
1304
|
+
throw new Error('parseFileSize does not support units above PB');
|
|
1273
1305
|
}
|
|
1274
|
-
return Math.ceil(num * Math.pow(1024, magnitude));
|
|
1306
|
+
return Math.ceil(num * (Math.pow(1024, magnitude)));
|
|
1275
1307
|
}
|
|
1276
1308
|
|
|
1277
1309
|
var REGEX_REPLACEMENT = /(<%=|{{)(.+?)(%>|}})/g;
|
|
1278
1310
|
var REGEX_IF = /<%\?(.+?)%>(.+?)<\/%>/g;
|
|
1279
|
-
var
|
|
1311
|
+
var SYMBOL_TEMPLATE_SOURCE = Symbol('sps.utils.templateSrc');
|
|
1280
1312
|
/**
|
|
1281
1313
|
* Every string templating thing out there whether lodash, doT, handlebars, etc
|
|
1282
1314
|
* is extremely complicated to cover a variety of use cases. This just has two
|
|
@@ -1288,23 +1320,17 @@ var Symbol_templateSrc = Symbol("sps.utils.templateSrc");
|
|
|
1288
1320
|
* You can put interpolations inside a conditional, as you'd expect. That's it.
|
|
1289
1321
|
*/
|
|
1290
1322
|
function template(string) {
|
|
1291
|
-
var fn = function (data) {
|
|
1292
|
-
return
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
})
|
|
1296
|
-
.replace(REGEX_REPLACEMENT, function (match, _, pathToInterpolate) {
|
|
1297
|
-
return getPath(data, pathToInterpolate.trim(), "");
|
|
1298
|
-
});
|
|
1299
|
-
};
|
|
1300
|
-
fn[Symbol_templateSrc] = string;
|
|
1323
|
+
var fn = function (data) { return string
|
|
1324
|
+
.replace(REGEX_IF, function (match, pathToCheck, content) { return (getPath(data, pathToCheck.trim()) ? content : ''); })
|
|
1325
|
+
.replace(REGEX_REPLACEMENT, function (match, _, pathToInterpolate) { return getPath(data, pathToInterpolate.trim(), ''); }); };
|
|
1326
|
+
fn[SYMBOL_TEMPLATE_SOURCE] = string;
|
|
1301
1327
|
return fn;
|
|
1302
1328
|
}
|
|
1303
1329
|
function isTemplate(x) {
|
|
1304
|
-
return typeof x ===
|
|
1330
|
+
return typeof x === 'string' && (REGEX_REPLACEMENT.test(x) || REGEX_IF.test(x));
|
|
1305
1331
|
}
|
|
1306
1332
|
function isTemplateFn(x) {
|
|
1307
|
-
return typeof x ===
|
|
1333
|
+
return typeof x === 'function' && Object.prototype.hasOwnProperty.call(x, SYMBOL_TEMPLATE_SOURCE);
|
|
1308
1334
|
}
|
|
1309
1335
|
|
|
1310
1336
|
export { CustomEvent, DiffChange, EDI_DOCUMENT_TYPE, Op, castToNumber, code, constrain, copyProperty, crumblePath, debounce, debounced, decimalRound, deepFreeze, diff, flatten, forEachEntryDeep, forEachNestedObject, getPath, isSubset, isTemplate, isTemplateFn, lockToAnimationFrames, lockedToAnimationFrames, mergeDeep, mergePropertiesDeep, omit, onNextTick, parseFileSize, range, setPath, simpleMetadataDecoratorApplicator, template, tickDelay, toFileSizeString, traversePath, values };
|