@daffodil/core 0.39.11 → 0.40.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/base64/base64.interface.d.ts +18 -0
- package/base64/browser/browser.service.d.ts +12 -0
- package/base64/public_api.d.ts +3 -0
- package/base64/server/public_api.d.ts +1 -0
- package/base64/server/server.service.d.ts +14 -0
- package/daffodil-core.d.ts +1 -0
- package/errors/error-map.d.ts +3 -2
- package/errors/error.interface.d.ts +10 -0
- package/errors/inheritable-error.d.ts +1 -0
- package/errors/is-error.d.ts +4 -0
- package/errors/public_api.d.ts +1 -0
- package/{esm2015/address/address.js → esm2020/address/address.mjs} +0 -0
- package/esm2020/base64/base64.interface.mjs +14 -0
- package/esm2020/base64/browser/browser.service.mjs +31 -0
- package/esm2020/base64/public_api.mjs +4 -0
- package/esm2020/base64/server/public_api.mjs +2 -0
- package/esm2020/base64/server/server.service.mjs +33 -0
- package/{esm2015/canonically-locateable/canonically-locateable.interface.js → esm2020/canonically-locateable/canonically-locateable.interface.mjs} +0 -0
- package/{esm2015/constructable/constructable.js → esm2020/constructable/constructable.mjs} +0 -0
- package/{esm2015/daffodil-core.js → esm2020/daffodil-core.mjs} +0 -0
- package/{esm2015/errors/error-map.js → esm2020/errors/error-map.mjs} +1 -1
- package/esm2020/errors/error.interface.mjs +2 -0
- package/esm2020/errors/inheritable-error.mjs +26 -0
- package/esm2020/errors/is-error.mjs +6 -0
- package/esm2020/errors/public_api.mjs +3 -0
- package/{esm2015/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.js → esm2020/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.mjs} +0 -0
- package/{esm2015/graphql/apollo/public_api.js → esm2020/graphql/apollo/public_api.mjs} +0 -0
- package/esm2020/graphql/apollo/queued-apollo/queued-apollo.service.mjs +64 -0
- package/{esm2015/graphql/daffodil-core-graphql.js → esm2020/graphql/daffodil-core-graphql.mjs} +0 -0
- package/{esm2015/graphql/fragments/build-fragment-definition.js → esm2020/graphql/fragments/build-fragment-definition.mjs} +0 -0
- package/esm2020/graphql/fragments/build-fragment-name-spread.mjs +18 -0
- package/{esm2015/graphql/fragments/public_api.js → esm2020/graphql/fragments/public_api.mjs} +0 -0
- package/{esm2015/graphql/index.js → esm2020/graphql/index.mjs} +0 -0
- package/{esm2015/graphql/public_api.js → esm2020/graphql/public_api.mjs} +0 -0
- package/{esm2015/identifiable/identifiable.interface.js → esm2020/identifiable/identifiable.interface.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/{esm2015/kindable/kindable.interface.js → esm2020/kindable/kindable.interface.mjs} +0 -0
- package/{esm2015/kindable/public_api.js → esm2020/kindable/public_api.mjs} +0 -0
- package/{esm2015/locateable/locateable.interface.js → esm2020/locateable/locateable.interface.mjs} +0 -0
- package/{esm2015/operators/backoff.pipe.js → esm2020/operators/backoff.pipe.mjs} +0 -0
- package/{esm2015/operators/public_api.js → esm2020/operators/public_api.mjs} +0 -0
- package/{esm2015/orderable/orderable.js → esm2020/orderable/orderable.mjs} +0 -0
- package/esm2020/public_api.mjs +8 -0
- package/{esm2015/routing/daffodil-core-routing.js → esm2020/routing/daffodil-core-routing.mjs} +0 -0
- package/{esm2015/routing/index.js → esm2020/routing/index.mjs} +0 -0
- package/{esm2015/routing/public_api.js → esm2020/routing/public_api.mjs} +0 -0
- package/esm2020/routing/uri/normalizer.service.mjs +38 -0
- package/{esm2015/routing/uri/public_api.js → esm2020/routing/uri/public_api.mjs} +0 -0
- package/esm2020/routing/uri/truncation/file-extension.mjs +10 -0
- package/{esm2015/routing/uri/truncation/leading-path-segments.js → esm2020/routing/uri/truncation/leading-path-segments.mjs} +0 -0
- package/esm2020/routing/uri/truncation/leading-slash.mjs +12 -0
- package/{esm2015/routing/uri/truncation/public_api.js → esm2020/routing/uri/truncation/public_api.mjs} +0 -0
- package/{esm2015/routing/uri/truncation/query-fragment.js → esm2020/routing/uri/truncation/query-fragment.mjs} +0 -0
- package/{esm2015/state/collection/paginable.js → esm2020/state/collection/paginable.mjs} +0 -0
- package/{esm2015/state/collection/public_api.js → esm2020/state/collection/public_api.mjs} +0 -0
- package/{esm2015/state/collection/sortable.js → esm2020/state/collection/sortable.mjs} +0 -0
- package/{esm2015/state/daffodil-core-state.js → esm2020/state/daffodil-core-state.mjs} +0 -0
- package/{esm2015/state/errors/public_api.js → esm2020/state/errors/public_api.mjs} +0 -0
- package/esm2020/state/errors/state-error.interface.mjs +2 -0
- package/esm2020/state/errors/transform-error-to-state-error.mjs +7 -0
- package/{esm2015/state/index.js → esm2020/state/index.mjs} +0 -0
- package/{esm2015/state/operators/public_api.js → esm2020/state/operators/public_api.mjs} +0 -0
- package/esm2020/state/operators/substream.pipe.mjs +42 -0
- package/{esm2015/state/public_api.js → esm2020/state/public_api.mjs} +0 -0
- package/{esm2015/state/reducers/create-meta.js → esm2020/state/reducers/create-meta.mjs} +0 -0
- package/{esm2015/state/reducers/public_api.js → esm2020/state/reducers/public_api.mjs} +0 -0
- package/{esm2015/state/states/loading.js → esm2020/state/states/loading.mjs} +0 -0
- package/{esm2015/state/states/mutable-loading.js → esm2020/state/states/mutable-loading.mjs} +0 -0
- package/{esm2015/state/states/public_api.js → esm2020/state/states/public_api.mjs} +0 -0
- package/{esm2015/state/states/state.enum.js → esm2020/state/states/state.enum.mjs} +0 -0
- package/{esm2015/state/states/stateable.interface.js → esm2020/state/states/stateable.interface.mjs} +0 -0
- package/{esm2015/state/store/facade.js → esm2020/state/store/facade.mjs} +0 -0
- package/{esm2015/storage/error/error.js → esm2020/storage/error/error.mjs} +0 -0
- package/esm2020/storage/error/error.service.mjs +33 -0
- package/{esm2015/storage/error/public_api.js → esm2020/storage/error/public_api.mjs} +0 -0
- package/esm2020/storage/localstorage/localstorage.service.mjs +46 -0
- package/esm2020/storage/noopstorage/noopstorage.service.mjs +24 -0
- package/esm2020/storage/persistence-server-safe.token.mjs +14 -0
- package/{esm2015/storage/persistence.interface.js → esm2020/storage/persistence.interface.mjs} +0 -0
- package/esm2020/storage/public_api.mjs +7 -0
- package/{esm2015/storage/server-error/public_api.js → esm2020/storage/server-error/public_api.mjs} +0 -0
- package/{esm2015/storage/server-error/server-error.js → esm2020/storage/server-error/server-error.mjs} +0 -0
- package/esm2020/storage/server-error/server-error.service.mjs +36 -0
- package/esm2020/testing/address/factories/address.factory.mjs +38 -0
- package/{esm2015/testing/angular/interfaces/in-memory-data-service.interface.js → esm2020/testing/angular/interfaces/in-memory-data-service.interface.mjs} +0 -0
- package/esm2020/testing/angular/mocks/pipes/currency.mjs +19 -0
- package/{esm2015/testing/daffodil-core-testing.js → esm2020/testing/daffodil-core-testing.mjs} +0 -0
- package/{esm2015/testing/factories/factory.interface.js → esm2020/testing/factories/factory.interface.mjs} +0 -0
- package/esm2020/testing/factories/factory.mjs +54 -0
- package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
- package/esm2020/testing/testing.module.mjs +17 -0
- package/{esm2015/types/dict.type.js → esm2020/types/dict.type.mjs} +0 -0
- package/{esm2015/types/id.type.js → esm2020/types/id.type.mjs} +0 -0
- package/{esm2015/types/public_api.js → esm2020/types/public_api.mjs} +0 -0
- package/{esm2015/utils/array-to-dict.js → esm2020/utils/array-to-dict.mjs} +0 -0
- package/{esm2015/utils/long-arithmetic.js → esm2020/utils/long-arithmetic.mjs} +0 -0
- package/{esm2015/utils/public_api.js → esm2020/utils/public_api.mjs} +0 -0
- package/{esm2015/utils/random-slice.js → esm2020/utils/random-slice.mjs} +0 -0
- package/{esm2015/utils/random-subset.js → esm2020/utils/random-subset.mjs} +0 -0
- package/{esm2015/utils/range.js → esm2020/utils/range.mjs} +0 -0
- package/{esm2015/utils/sample.js → esm2020/utils/sample.mjs} +0 -0
- package/{esm2015/utils/shuffle.js → esm2020/utils/shuffle.mjs} +0 -0
- package/{esm2015/utils/unique.js → esm2020/utils/unique.mjs} +0 -0
- package/fesm2015/{daffodil-core-graphql.js → daffodil-core-graphql.mjs} +12 -14
- package/fesm2015/daffodil-core-graphql.mjs.map +1 -0
- package/fesm2015/{daffodil-core-routing.js → daffodil-core-routing.mjs} +13 -13
- package/fesm2015/daffodil-core-routing.mjs.map +1 -0
- package/fesm2015/{daffodil-core-state.js → daffodil-core-state.mjs} +4 -5
- package/fesm2015/daffodil-core-state.mjs.map +1 -0
- package/fesm2015/daffodil-core-testing.mjs +128 -0
- package/fesm2015/daffodil-core-testing.mjs.map +1 -0
- package/fesm2015/daffodil-core.mjs +465 -0
- package/fesm2015/daffodil-core.mjs.map +1 -0
- package/fesm2020/daffodil-core-graphql.mjs +96 -0
- package/fesm2020/daffodil-core-graphql.mjs.map +1 -0
- package/fesm2020/daffodil-core-routing.mjs +84 -0
- package/fesm2020/daffodil-core-routing.mjs.map +1 -0
- package/fesm2020/daffodil-core-state.mjs +74 -0
- package/fesm2020/daffodil-core-state.mjs.map +1 -0
- package/fesm2020/daffodil-core-testing.mjs +131 -0
- package/fesm2020/daffodil-core-testing.mjs.map +1 -0
- package/{fesm2015/daffodil-core.js → fesm2020/daffodil-core.mjs} +124 -32
- package/fesm2020/daffodil-core.mjs.map +1 -0
- package/graphql/apollo/queued-apollo/queued-apollo.service.d.ts +5 -3
- package/graphql/daffodil-core-graphql.d.ts +1 -0
- package/graphql/package.json +5 -6
- package/package.json +58 -14
- package/public_api.d.ts +1 -0
- package/routing/daffodil-core-routing.d.ts +1 -0
- package/routing/package.json +5 -6
- package/routing/uri/normalizer.service.d.ts +3 -0
- package/state/daffodil-core-state.d.ts +1 -0
- package/state/errors/state-error.interface.d.ts +11 -0
- package/state/errors/transform-error-to-state-error.d.ts +1 -1
- package/state/package.json +5 -6
- package/storage/error/error.service.d.ts +3 -0
- package/storage/localstorage/localstorage.service.d.ts +3 -0
- package/storage/noopstorage/noopstorage.service.d.ts +3 -0
- package/storage/persistence-server-safe.token.d.ts +6 -0
- package/storage/public_api.d.ts +1 -0
- package/storage/server-error/server-error.service.d.ts +3 -0
- package/testing/address/factories/address.factory.d.ts +3 -0
- package/testing/angular/mocks/pipes/currency.d.ts +3 -0
- package/testing/daffodil-core-testing.d.ts +1 -0
- package/testing/package.json +5 -6
- package/testing/testing.module.d.ts +5 -0
- package/utils/array-to-dict.d.ts +1 -1
- package/bundles/daffodil-core-graphql.umd.js +0 -445
- package/bundles/daffodil-core-graphql.umd.js.map +0 -1
- package/bundles/daffodil-core-graphql.umd.min.js +0 -16
- package/bundles/daffodil-core-graphql.umd.min.js.map +0 -1
- package/bundles/daffodil-core-routing.umd.js +0 -100
- package/bundles/daffodil-core-routing.umd.js.map +0 -1
- package/bundles/daffodil-core-routing.umd.min.js +0 -2
- package/bundles/daffodil-core-routing.umd.min.js.map +0 -1
- package/bundles/daffodil-core-state.umd.js +0 -405
- package/bundles/daffodil-core-state.umd.js.map +0 -1
- package/bundles/daffodil-core-state.umd.min.js +0 -16
- package/bundles/daffodil-core-state.umd.min.js.map +0 -1
- package/bundles/daffodil-core-testing.umd.js +0 -466
- package/bundles/daffodil-core-testing.umd.js.map +0 -1
- package/bundles/daffodil-core-testing.umd.min.js +0 -16
- package/bundles/daffodil-core-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-core.umd.js +0 -752
- package/bundles/daffodil-core.umd.js.map +0 -1
- package/bundles/daffodil-core.umd.min.js +0 -16
- package/bundles/daffodil-core.umd.min.js.map +0 -1
- package/daffodil-core.metadata.json +0 -1
- package/esm2015/errors/error.interface.js +0 -2
- package/esm2015/errors/inheritable-error.js +0 -25
- package/esm2015/errors/public_api.js +0 -2
- package/esm2015/graphql/apollo/queued-apollo/queued-apollo.service.js +0 -67
- package/esm2015/graphql/fragments/build-fragment-name-spread.js +0 -20
- package/esm2015/public_api.js +0 -7
- package/esm2015/routing/uri/normalizer.service.js +0 -40
- package/esm2015/routing/uri/truncation/file-extension.js +0 -10
- package/esm2015/routing/uri/truncation/leading-slash.js +0 -12
- package/esm2015/state/errors/state-error.interface.js +0 -2
- package/esm2015/state/errors/transform-error-to-state-error.js +0 -7
- package/esm2015/state/operators/substream.pipe.js +0 -44
- package/esm2015/storage/error/error.service.js +0 -31
- package/esm2015/storage/localstorage/localstorage.service.js +0 -45
- package/esm2015/storage/noopstorage/noopstorage.service.js +0 -22
- package/esm2015/storage/public_api.js +0 -6
- package/esm2015/storage/server-error/server-error.service.js +0 -34
- package/esm2015/testing/address/factories/address.factory.js +0 -38
- package/esm2015/testing/angular/mocks/pipes/currency.js +0 -15
- package/esm2015/testing/factories/factory.js +0 -51
- package/esm2015/testing/testing.module.js +0 -12
- package/fesm2015/daffodil-core-graphql.js.map +0 -1
- package/fesm2015/daffodil-core-routing.js.map +0 -1
- package/fesm2015/daffodil-core-state.js.map +0 -1
- package/fesm2015/daffodil-core-testing.js +0 -120
- package/fesm2015/daffodil-core-testing.js.map +0 -1
- package/fesm2015/daffodil-core.js.map +0 -1
- package/graphql/daffodil-core-graphql.metadata.json +0 -1
- package/routing/daffodil-core-routing.metadata.json +0 -1
- package/state/daffodil-core-state.metadata.json +0 -1
- package/testing/daffodil-core-testing.metadata.json +0 -1
|
@@ -1,752 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs'), require('rxjs/operators')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@daffodil/core', ['exports', '@angular/core', '@angular/common', 'rxjs', 'rxjs/operators'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.daffodil = global.daffodil || {}, global.daffodil.core = {}), global.ng.core, global.ng.common, global.rxjs, global.rxjs.operators));
|
|
5
|
-
}(this, (function (exports, i0, common, rxjs, operators) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation.
|
|
9
|
-
|
|
10
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
-
purpose with or without fee is hereby granted.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
var extendStatics = function (d, b) {
|
|
23
|
-
extendStatics = Object.setPrototypeOf ||
|
|
24
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
25
|
-
function (d, b) { for (var p in b)
|
|
26
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
27
|
-
d[p] = b[p]; };
|
|
28
|
-
return extendStatics(d, b);
|
|
29
|
-
};
|
|
30
|
-
function __extends(d, b) {
|
|
31
|
-
if (typeof b !== "function" && b !== null)
|
|
32
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
-
extendStatics(d, b);
|
|
34
|
-
function __() { this.constructor = d; }
|
|
35
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
-
}
|
|
37
|
-
var __assign = function () {
|
|
38
|
-
__assign = Object.assign || function __assign(t) {
|
|
39
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
40
|
-
s = arguments[i];
|
|
41
|
-
for (var p in s)
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
43
|
-
t[p] = s[p];
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
};
|
|
47
|
-
return __assign.apply(this, arguments);
|
|
48
|
-
};
|
|
49
|
-
function __rest(s, e) {
|
|
50
|
-
var t = {};
|
|
51
|
-
for (var p in s)
|
|
52
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
53
|
-
t[p] = s[p];
|
|
54
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
55
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
56
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
57
|
-
t[p[i]] = s[p[i]];
|
|
58
|
-
}
|
|
59
|
-
return t;
|
|
60
|
-
}
|
|
61
|
-
function __decorate(decorators, target, key, desc) {
|
|
62
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
64
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
65
|
-
else
|
|
66
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
67
|
-
if (d = decorators[i])
|
|
68
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
69
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
70
|
-
}
|
|
71
|
-
function __param(paramIndex, decorator) {
|
|
72
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
73
|
-
}
|
|
74
|
-
function __metadata(metadataKey, metadataValue) {
|
|
75
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
76
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
77
|
-
}
|
|
78
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
79
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
80
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
81
|
-
function fulfilled(value) { try {
|
|
82
|
-
step(generator.next(value));
|
|
83
|
-
}
|
|
84
|
-
catch (e) {
|
|
85
|
-
reject(e);
|
|
86
|
-
} }
|
|
87
|
-
function rejected(value) { try {
|
|
88
|
-
step(generator["throw"](value));
|
|
89
|
-
}
|
|
90
|
-
catch (e) {
|
|
91
|
-
reject(e);
|
|
92
|
-
} }
|
|
93
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
94
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function __generator(thisArg, body) {
|
|
98
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
99
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
100
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
101
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
102
|
-
function step(op) {
|
|
103
|
-
if (f)
|
|
104
|
-
throw new TypeError("Generator is already executing.");
|
|
105
|
-
while (_)
|
|
106
|
-
try {
|
|
107
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
108
|
-
return t;
|
|
109
|
-
if (y = 0, t)
|
|
110
|
-
op = [op[0] & 2, t.value];
|
|
111
|
-
switch (op[0]) {
|
|
112
|
-
case 0:
|
|
113
|
-
case 1:
|
|
114
|
-
t = op;
|
|
115
|
-
break;
|
|
116
|
-
case 4:
|
|
117
|
-
_.label++;
|
|
118
|
-
return { value: op[1], done: false };
|
|
119
|
-
case 5:
|
|
120
|
-
_.label++;
|
|
121
|
-
y = op[1];
|
|
122
|
-
op = [0];
|
|
123
|
-
continue;
|
|
124
|
-
case 7:
|
|
125
|
-
op = _.ops.pop();
|
|
126
|
-
_.trys.pop();
|
|
127
|
-
continue;
|
|
128
|
-
default:
|
|
129
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
130
|
-
_ = 0;
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
134
|
-
_.label = op[1];
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
138
|
-
_.label = t[1];
|
|
139
|
-
t = op;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
if (t && _.label < t[2]) {
|
|
143
|
-
_.label = t[2];
|
|
144
|
-
_.ops.push(op);
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
if (t[2])
|
|
148
|
-
_.ops.pop();
|
|
149
|
-
_.trys.pop();
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
op = body.call(thisArg, _);
|
|
153
|
-
}
|
|
154
|
-
catch (e) {
|
|
155
|
-
op = [6, e];
|
|
156
|
-
y = 0;
|
|
157
|
-
}
|
|
158
|
-
finally {
|
|
159
|
-
f = t = 0;
|
|
160
|
-
}
|
|
161
|
-
if (op[0] & 5)
|
|
162
|
-
throw op[1];
|
|
163
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
167
|
-
if (k2 === undefined)
|
|
168
|
-
k2 = k;
|
|
169
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
170
|
-
}) : (function (o, m, k, k2) {
|
|
171
|
-
if (k2 === undefined)
|
|
172
|
-
k2 = k;
|
|
173
|
-
o[k2] = m[k];
|
|
174
|
-
});
|
|
175
|
-
function __exportStar(m, o) {
|
|
176
|
-
for (var p in m)
|
|
177
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
178
|
-
__createBinding(o, m, p);
|
|
179
|
-
}
|
|
180
|
-
function __values(o) {
|
|
181
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
182
|
-
if (m)
|
|
183
|
-
return m.call(o);
|
|
184
|
-
if (o && typeof o.length === "number")
|
|
185
|
-
return {
|
|
186
|
-
next: function () {
|
|
187
|
-
if (o && i >= o.length)
|
|
188
|
-
o = void 0;
|
|
189
|
-
return { value: o && o[i++], done: !o };
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
193
|
-
}
|
|
194
|
-
function __read(o, n) {
|
|
195
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
196
|
-
if (!m)
|
|
197
|
-
return o;
|
|
198
|
-
var i = m.call(o), r, ar = [], e;
|
|
199
|
-
try {
|
|
200
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
201
|
-
ar.push(r.value);
|
|
202
|
-
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
e = { error: error };
|
|
205
|
-
}
|
|
206
|
-
finally {
|
|
207
|
-
try {
|
|
208
|
-
if (r && !r.done && (m = i["return"]))
|
|
209
|
-
m.call(i);
|
|
210
|
-
}
|
|
211
|
-
finally {
|
|
212
|
-
if (e)
|
|
213
|
-
throw e.error;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return ar;
|
|
217
|
-
}
|
|
218
|
-
/** @deprecated */
|
|
219
|
-
function __spread() {
|
|
220
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
221
|
-
ar = ar.concat(__read(arguments[i]));
|
|
222
|
-
return ar;
|
|
223
|
-
}
|
|
224
|
-
/** @deprecated */
|
|
225
|
-
function __spreadArrays() {
|
|
226
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
227
|
-
s += arguments[i].length;
|
|
228
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
229
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
230
|
-
r[k] = a[j];
|
|
231
|
-
return r;
|
|
232
|
-
}
|
|
233
|
-
function __spreadArray(to, from, pack) {
|
|
234
|
-
if (pack || arguments.length === 2)
|
|
235
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
236
|
-
if (ar || !(i in from)) {
|
|
237
|
-
if (!ar)
|
|
238
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
239
|
-
ar[i] = from[i];
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
243
|
-
}
|
|
244
|
-
function __await(v) {
|
|
245
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
246
|
-
}
|
|
247
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
248
|
-
if (!Symbol.asyncIterator)
|
|
249
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
250
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
251
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
252
|
-
function verb(n) { if (g[n])
|
|
253
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
254
|
-
function resume(n, v) { try {
|
|
255
|
-
step(g[n](v));
|
|
256
|
-
}
|
|
257
|
-
catch (e) {
|
|
258
|
-
settle(q[0][3], e);
|
|
259
|
-
} }
|
|
260
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
261
|
-
function fulfill(value) { resume("next", value); }
|
|
262
|
-
function reject(value) { resume("throw", value); }
|
|
263
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
264
|
-
resume(q[0][0], q[0][1]); }
|
|
265
|
-
}
|
|
266
|
-
function __asyncDelegator(o) {
|
|
267
|
-
var i, p;
|
|
268
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
269
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
270
|
-
}
|
|
271
|
-
function __asyncValues(o) {
|
|
272
|
-
if (!Symbol.asyncIterator)
|
|
273
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
274
|
-
var m = o[Symbol.asyncIterator], i;
|
|
275
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
276
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
277
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
278
|
-
}
|
|
279
|
-
function __makeTemplateObject(cooked, raw) {
|
|
280
|
-
if (Object.defineProperty) {
|
|
281
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
cooked.raw = raw;
|
|
285
|
-
}
|
|
286
|
-
return cooked;
|
|
287
|
-
}
|
|
288
|
-
;
|
|
289
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
290
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
291
|
-
}) : function (o, v) {
|
|
292
|
-
o["default"] = v;
|
|
293
|
-
};
|
|
294
|
-
function __importStar(mod) {
|
|
295
|
-
if (mod && mod.__esModule)
|
|
296
|
-
return mod;
|
|
297
|
-
var result = {};
|
|
298
|
-
if (mod != null)
|
|
299
|
-
for (var k in mod)
|
|
300
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
301
|
-
__createBinding(result, mod, k);
|
|
302
|
-
__setModuleDefault(result, mod);
|
|
303
|
-
return result;
|
|
304
|
-
}
|
|
305
|
-
function __importDefault(mod) {
|
|
306
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
307
|
-
}
|
|
308
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
309
|
-
if (kind === "a" && !f)
|
|
310
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
311
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
312
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
313
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
314
|
-
}
|
|
315
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
316
|
-
if (kind === "m")
|
|
317
|
-
throw new TypeError("Private method is not writable");
|
|
318
|
-
if (kind === "a" && !f)
|
|
319
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
320
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
321
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
322
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* A helper function to get the number of decimal significant figures of a number.
|
|
327
|
-
* This function will fail if the given number has more than 16 significant figures or
|
|
328
|
-
* the value of the number is greater than 10^11
|
|
329
|
-
*
|
|
330
|
-
* @param number
|
|
331
|
-
*/
|
|
332
|
-
function daffPrecision(number) {
|
|
333
|
-
var p = 10000;
|
|
334
|
-
if (number === undefined || number === null) {
|
|
335
|
-
return p;
|
|
336
|
-
}
|
|
337
|
-
while (Math.round(number * p) / p !== number) {
|
|
338
|
-
p *= 10;
|
|
339
|
-
}
|
|
340
|
-
return p;
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* A function to add long numbers accurately with conversions and integer math.
|
|
344
|
-
* This function only guarantees correct answers when the numbers given and the result are less than
|
|
345
|
-
* 16 significant figures and less than 10^11
|
|
346
|
-
*
|
|
347
|
-
* @param numbers
|
|
348
|
-
*/
|
|
349
|
-
function daffAdd() {
|
|
350
|
-
var numbers = [];
|
|
351
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
352
|
-
numbers[_i] = arguments[_i];
|
|
353
|
-
}
|
|
354
|
-
if (numbers.length < 2) {
|
|
355
|
-
throw new Error('Provide at least 2 numbers for daffAdd.');
|
|
356
|
-
}
|
|
357
|
-
var precision = Math.max.apply(Math, __spread(numbers.map(daffPrecision)));
|
|
358
|
-
return numbers.reduce(function (acc, number) { return acc + Math.round(number * precision); }, 0) / precision;
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* A function to subtract long numbers accurately with conversions and integer math.
|
|
362
|
-
* This function only guarantees correct answers when the numbers given and the result are each less than
|
|
363
|
-
* 16 significant figures and less than 10^11
|
|
364
|
-
*
|
|
365
|
-
* @param numbers
|
|
366
|
-
*/
|
|
367
|
-
function daffSubtract() {
|
|
368
|
-
var numbers = [];
|
|
369
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
370
|
-
numbers[_i] = arguments[_i];
|
|
371
|
-
}
|
|
372
|
-
if (numbers.length < 2) {
|
|
373
|
-
throw new Error('Provide at least 2 numbers for daffSubtract.');
|
|
374
|
-
}
|
|
375
|
-
var precision = Math.max.apply(Math, __spread(numbers.map(daffPrecision)));
|
|
376
|
-
return numbers.slice(1).reduce(function (acc, number) { return acc - Math.round(number * precision); }, Math.round(numbers[0] * precision)) / precision;
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* A function to multiply long numbers accurately with conversions and integer math.
|
|
380
|
-
* This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures
|
|
381
|
-
* and less than 10^11
|
|
382
|
-
*
|
|
383
|
-
* @param numbers
|
|
384
|
-
*/
|
|
385
|
-
function daffMultiply() {
|
|
386
|
-
var numbers = [];
|
|
387
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
388
|
-
numbers[_i] = arguments[_i];
|
|
389
|
-
}
|
|
390
|
-
if (numbers.length < 2) {
|
|
391
|
-
throw new Error('Provide at least 2 numbers for daffMultiply.');
|
|
392
|
-
}
|
|
393
|
-
var precision = Math.max.apply(Math, __spread(numbers.map(daffPrecision)));
|
|
394
|
-
return numbers.reduce(function (acc, number) { return acc * Math.round(number * precision); }, 1) / Math.pow(precision, numbers.length);
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* A function to divide long numbers accurately with conversions and integer math.
|
|
398
|
-
* This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures
|
|
399
|
-
* and less than 10^11
|
|
400
|
-
*
|
|
401
|
-
* Returns NaN when attempting to use NaN as an input.
|
|
402
|
-
* Returns NaN when attempting to divide by 0 or null.
|
|
403
|
-
*
|
|
404
|
-
* @param numbers
|
|
405
|
-
*/
|
|
406
|
-
function daffDivide() {
|
|
407
|
-
var numbers = [];
|
|
408
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
409
|
-
numbers[_i] = arguments[_i];
|
|
410
|
-
}
|
|
411
|
-
if (numbers.length < 2) {
|
|
412
|
-
throw new Error('Provide at least 2 numbers for daffDivide.');
|
|
413
|
-
}
|
|
414
|
-
// TODO(griest024): use better condition after IE support is dropped
|
|
415
|
-
var illegalOperation = numbers.filter(isNaN).length > 0
|
|
416
|
-
|| numbers.slice(1).filter(function (n) { return n === 0 || n === null; }).length > 0;
|
|
417
|
-
if (illegalOperation) {
|
|
418
|
-
return NaN;
|
|
419
|
-
}
|
|
420
|
-
var precision = Math.max.apply(Math, __spread(numbers.map(daffPrecision)));
|
|
421
|
-
return numbers.slice(1).reduce(function (acc, number) { return acc / Math.round(number * precision); }, Math.round(numbers[0] * precision)) * Math.pow(precision, numbers.length - 2);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Range
|
|
426
|
-
*
|
|
427
|
-
* Range accepts two inputs, a `start` and an `end`
|
|
428
|
-
* and returns an array filled with numbers from
|
|
429
|
-
* `start` to `end`.
|
|
430
|
-
*
|
|
431
|
-
* @param start
|
|
432
|
-
* @param end
|
|
433
|
-
* @returns number
|
|
434
|
-
*/
|
|
435
|
-
var range = function (start, end) { return Array.apply(null, Array(end - start + 1)).map(function (val, index) { return index + start; }); };
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Immutable Fisher-Yates Shuffle
|
|
439
|
-
* https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
|
|
440
|
-
*/
|
|
441
|
-
var shuffle = function (array) {
|
|
442
|
-
var result = [];
|
|
443
|
-
array.forEach(function (el, i) {
|
|
444
|
-
var s = Math.floor(Math.random() * i);
|
|
445
|
-
if (s !== i) {
|
|
446
|
-
result[i] = result[s];
|
|
447
|
-
}
|
|
448
|
-
result[s] = el;
|
|
449
|
-
});
|
|
450
|
-
return result;
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* Returns a random subset of an array in a random order.
|
|
455
|
-
*
|
|
456
|
-
* @param array
|
|
457
|
-
* @param length
|
|
458
|
-
*/
|
|
459
|
-
var randomSubset = function (array, length) {
|
|
460
|
-
if (length > array.length) {
|
|
461
|
-
throw new Error('Requested length is longer than array length.');
|
|
462
|
-
}
|
|
463
|
-
length = length ? length : Math.floor(Math.random() * array.length);
|
|
464
|
-
return shuffle(array).slice(0, length);
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* Returns a random slice of an array.
|
|
469
|
-
* An optional length may be specified.
|
|
470
|
-
*
|
|
471
|
-
* @param array
|
|
472
|
-
*/
|
|
473
|
-
var randomSlice = function (array, length) {
|
|
474
|
-
if (array.length === 0) {
|
|
475
|
-
return [];
|
|
476
|
-
}
|
|
477
|
-
;
|
|
478
|
-
if (length > array.length) {
|
|
479
|
-
throw new Error('Requested length is longer than array length.');
|
|
480
|
-
}
|
|
481
|
-
var arrayLength = length || Math.floor(Math.random() * array.length);
|
|
482
|
-
var start = Math.floor(Math.random() * (array.length - arrayLength + 1));
|
|
483
|
-
var end = start + arrayLength;
|
|
484
|
-
return array.slice(start, end);
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Converts an array into a dictionary.
|
|
489
|
-
* Dictionary values are keyed by the return of the specified getKey, or `'key'` by default.
|
|
490
|
-
*/
|
|
491
|
-
var daffArrayToDict = function (array, getKey) {
|
|
492
|
-
if (getKey === void 0) { getKey = function (val) { return val.key; }; }
|
|
493
|
-
return array.reduce(function (dict, val) {
|
|
494
|
-
dict[getKey(val)] = val;
|
|
495
|
-
return dict;
|
|
496
|
-
}, {});
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Returns a random element of an array.
|
|
501
|
-
*/
|
|
502
|
-
var sample = function (array) { return randomSlice(array, 1)[0]; };
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* Filters an array of elements, removing duplicates.
|
|
506
|
-
* Does not guarantee order of filtered elements.
|
|
507
|
-
*
|
|
508
|
-
* An optional comparator function may be passed for arbitrary comparison behavior.
|
|
509
|
-
* The default is a strict equality comparison: `a === b`.
|
|
510
|
-
*/
|
|
511
|
-
var unique = function (array, comparator) {
|
|
512
|
-
if (comparator === void 0) { comparator = function (a, b) { return a === b; }; }
|
|
513
|
-
return array.filter(function (a, index) { return array.slice(index + 1).filter(function (b) { return comparator(a, b); }).length === 0; });
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* A class which allows you to appropriately check the inheritance of an error.
|
|
518
|
-
*
|
|
519
|
-
* In typescript, when you try to extend an error with a specialized error class,
|
|
520
|
-
* if you try to call something like:
|
|
521
|
-
*
|
|
522
|
-
* ```ts
|
|
523
|
-
* class MyError extends Error {}
|
|
524
|
-
*
|
|
525
|
-
* let myError = new MyError();
|
|
526
|
-
*
|
|
527
|
-
* myError instanceof MyError; // returns false
|
|
528
|
-
* ```
|
|
529
|
-
*
|
|
530
|
-
* You will see unexpected things. This class fixes that issue as described here
|
|
531
|
-
* https://github.com/microsoft/TypeScript/issues/13965
|
|
532
|
-
*/
|
|
533
|
-
var DaffInheritableError = /** @class */ (function (_super) {
|
|
534
|
-
__extends(DaffInheritableError, _super);
|
|
535
|
-
function DaffInheritableError(message) {
|
|
536
|
-
var _newTarget = this.constructor;
|
|
537
|
-
var _this = this;
|
|
538
|
-
var trueProto = _newTarget.prototype;
|
|
539
|
-
_this = _super.call(this, message) || this;
|
|
540
|
-
Object.setPrototypeOf(_this, trueProto);
|
|
541
|
-
return _this;
|
|
542
|
-
}
|
|
543
|
-
return DaffInheritableError;
|
|
544
|
-
}(Error));
|
|
545
|
-
|
|
546
|
-
var DaffStorageServiceError = /** @class */ (function (_super) {
|
|
547
|
-
__extends(DaffStorageServiceError, _super);
|
|
548
|
-
function DaffStorageServiceError(message) {
|
|
549
|
-
var _this = _super.call(this, message) || this;
|
|
550
|
-
_this.message = message;
|
|
551
|
-
_this.code = 'DAFF_STORAGE_FAILURE';
|
|
552
|
-
return _this;
|
|
553
|
-
}
|
|
554
|
-
return DaffStorageServiceError;
|
|
555
|
-
}(DaffInheritableError));
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* @inheritdoc
|
|
559
|
-
*/
|
|
560
|
-
var DaffErrorStorageService = /** @class */ (function () {
|
|
561
|
-
function DaffErrorStorageService() {
|
|
562
|
-
}
|
|
563
|
-
DaffErrorStorageService.prototype.setItem = function (key, value) {
|
|
564
|
-
this.throwError();
|
|
565
|
-
};
|
|
566
|
-
DaffErrorStorageService.prototype.getItem = function (key) {
|
|
567
|
-
this.throwError();
|
|
568
|
-
};
|
|
569
|
-
DaffErrorStorageService.prototype.removeItem = function (key) {
|
|
570
|
-
this.throwError();
|
|
571
|
-
};
|
|
572
|
-
DaffErrorStorageService.prototype.clear = function () {
|
|
573
|
-
this.throwError();
|
|
574
|
-
};
|
|
575
|
-
DaffErrorStorageService.prototype.throwError = function () {
|
|
576
|
-
throw new DaffStorageServiceError(DaffErrorStorageService.ERROR_MESSAGE);
|
|
577
|
-
};
|
|
578
|
-
return DaffErrorStorageService;
|
|
579
|
-
}());
|
|
580
|
-
DaffErrorStorageService.ERROR_MESSAGE = 'The DaffErrorStorageService always throws an error.';
|
|
581
|
-
/** @nocollapse */ DaffErrorStorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffErrorStorageService_Factory() { return new DaffErrorStorageService(); }, token: DaffErrorStorageService, providedIn: "root" });
|
|
582
|
-
DaffErrorStorageService.decorators = [
|
|
583
|
-
{ type: i0.Injectable, args: [{
|
|
584
|
-
providedIn: 'root',
|
|
585
|
-
},] }
|
|
586
|
-
];
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* An error thrown when there is an attempt to access storage on the server and none is available.
|
|
590
|
-
*/
|
|
591
|
-
var DaffServerSideStorageError = /** @class */ (function (_super) {
|
|
592
|
-
__extends(DaffServerSideStorageError, _super);
|
|
593
|
-
function DaffServerSideStorageError(message) {
|
|
594
|
-
var _this = _super.call(this, message) || this;
|
|
595
|
-
_this.message = message;
|
|
596
|
-
_this.code = 'DAFF_SERVER_STORAGE_FAILURE';
|
|
597
|
-
return _this;
|
|
598
|
-
}
|
|
599
|
-
return DaffServerSideStorageError;
|
|
600
|
-
}(DaffStorageServiceError));
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* A storage service meant to be loaded into SSR contexts.
|
|
604
|
-
* It will always throw the {@link DaffServerSideStorageError}.
|
|
605
|
-
*
|
|
606
|
-
* @inheritdoc
|
|
607
|
-
*/
|
|
608
|
-
var DaffServerErrorStorageService = /** @class */ (function () {
|
|
609
|
-
function DaffServerErrorStorageService() {
|
|
610
|
-
}
|
|
611
|
-
DaffServerErrorStorageService.prototype.setItem = function (key, value) {
|
|
612
|
-
this.throwError();
|
|
613
|
-
};
|
|
614
|
-
DaffServerErrorStorageService.prototype.getItem = function (key) {
|
|
615
|
-
this.throwError();
|
|
616
|
-
};
|
|
617
|
-
DaffServerErrorStorageService.prototype.removeItem = function (key) {
|
|
618
|
-
this.throwError();
|
|
619
|
-
};
|
|
620
|
-
DaffServerErrorStorageService.prototype.clear = function () {
|
|
621
|
-
this.throwError();
|
|
622
|
-
};
|
|
623
|
-
DaffServerErrorStorageService.prototype.throwError = function () {
|
|
624
|
-
throw new DaffServerSideStorageError(DaffServerErrorStorageService.ERROR_MESSAGE);
|
|
625
|
-
};
|
|
626
|
-
return DaffServerErrorStorageService;
|
|
627
|
-
}());
|
|
628
|
-
DaffServerErrorStorageService.ERROR_MESSAGE = 'The DaffServerErrorStorageService always throws an error.';
|
|
629
|
-
/** @nocollapse */ DaffServerErrorStorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffServerErrorStorageService_Factory() { return new DaffServerErrorStorageService(); }, token: DaffServerErrorStorageService, providedIn: "root" });
|
|
630
|
-
DaffServerErrorStorageService.decorators = [
|
|
631
|
-
{ type: i0.Injectable, args: [{
|
|
632
|
-
providedIn: 'root',
|
|
633
|
-
},] }
|
|
634
|
-
];
|
|
635
|
-
|
|
636
|
-
/**
|
|
637
|
-
* @inheritdoc
|
|
638
|
-
*/
|
|
639
|
-
var DaffLocalStorageService = /** @class */ (function () {
|
|
640
|
-
function DaffLocalStorageService(platformId) {
|
|
641
|
-
if (!common.isPlatformBrowser(platformId)) {
|
|
642
|
-
throw new Error('The DaffLocalStorageService can only be instantiated in the browser.');
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* Persist the given item into local storage.
|
|
647
|
-
*/
|
|
648
|
-
DaffLocalStorageService.prototype.setItem = function (key, value) {
|
|
649
|
-
localStorage.setItem(key, value);
|
|
650
|
-
};
|
|
651
|
-
/**
|
|
652
|
-
* Retrieve the given item from localstorage.
|
|
653
|
-
*/
|
|
654
|
-
DaffLocalStorageService.prototype.getItem = function (key) {
|
|
655
|
-
return localStorage.getItem(key);
|
|
656
|
-
};
|
|
657
|
-
/**
|
|
658
|
-
* Remove a given item from localstorage
|
|
659
|
-
*/
|
|
660
|
-
DaffLocalStorageService.prototype.removeItem = function (key) {
|
|
661
|
-
localStorage.removeItem(key);
|
|
662
|
-
};
|
|
663
|
-
DaffLocalStorageService.prototype.clear = function () {
|
|
664
|
-
localStorage.clear();
|
|
665
|
-
};
|
|
666
|
-
return DaffLocalStorageService;
|
|
667
|
-
}());
|
|
668
|
-
/** @nocollapse */ DaffLocalStorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffLocalStorageService_Factory() { return new DaffLocalStorageService(i0.ɵɵinject(i0.PLATFORM_ID)); }, token: DaffLocalStorageService, providedIn: "root" });
|
|
669
|
-
DaffLocalStorageService.decorators = [
|
|
670
|
-
{ type: i0.Injectable, args: [{
|
|
671
|
-
providedIn: 'root',
|
|
672
|
-
},] }
|
|
673
|
-
];
|
|
674
|
-
/** @nocollapse */
|
|
675
|
-
DaffLocalStorageService.ctorParameters = function () { return [
|
|
676
|
-
{ type: String, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
|
|
677
|
-
]; };
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* @inheritdoc
|
|
681
|
-
*/
|
|
682
|
-
var DaffNoopStorageService = /** @class */ (function () {
|
|
683
|
-
function DaffNoopStorageService() {
|
|
684
|
-
}
|
|
685
|
-
DaffNoopStorageService.prototype.setItem = function (key, value) { };
|
|
686
|
-
;
|
|
687
|
-
DaffNoopStorageService.prototype.getItem = function (key) { };
|
|
688
|
-
;
|
|
689
|
-
DaffNoopStorageService.prototype.clear = function () { };
|
|
690
|
-
;
|
|
691
|
-
DaffNoopStorageService.prototype.removeItem = function (key) { };
|
|
692
|
-
;
|
|
693
|
-
return DaffNoopStorageService;
|
|
694
|
-
}());
|
|
695
|
-
/** @nocollapse */ DaffNoopStorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DaffNoopStorageService_Factory() { return new DaffNoopStorageService(); }, token: DaffNoopStorageService, providedIn: "root" });
|
|
696
|
-
DaffNoopStorageService.decorators = [
|
|
697
|
-
{ type: i0.Injectable, args: [{
|
|
698
|
-
providedIn: 'root',
|
|
699
|
-
},] }
|
|
700
|
-
];
|
|
701
|
-
|
|
702
|
-
var DaffPersistenceServiceToken = new i0.InjectionToken('DaffPersistenceService', {
|
|
703
|
-
providedIn: 'root',
|
|
704
|
-
factory: function () { return common.isPlatformBrowser(i0.inject(i0.PLATFORM_ID))
|
|
705
|
-
? new DaffLocalStorageService(i0.inject(i0.PLATFORM_ID))
|
|
706
|
-
: new DaffServerErrorStorageService(); },
|
|
707
|
-
});
|
|
708
|
-
|
|
709
|
-
/**
|
|
710
|
-
* Retries failed Observables
|
|
711
|
-
*
|
|
712
|
-
* @param maxTries The maximum number of tries the observable will be tried
|
|
713
|
-
* @param ms The initial amount of time
|
|
714
|
-
*/
|
|
715
|
-
function backoff(maxTries, ms) {
|
|
716
|
-
return rxjs.pipe(operators.retryWhen(function (attempt) { return attempt.pipe(operators.mergeMap(function (shadowedAttempt, i) {
|
|
717
|
-
if (i >= maxTries) {
|
|
718
|
-
return rxjs.throwError(shadowedAttempt);
|
|
719
|
-
}
|
|
720
|
-
return rxjs.timer(ms * Math.pow(2, i));
|
|
721
|
-
})); }));
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
/**
|
|
725
|
-
* Generated bundle index. Do not edit.
|
|
726
|
-
*/
|
|
727
|
-
|
|
728
|
-
exports.DaffErrorStorageService = DaffErrorStorageService;
|
|
729
|
-
exports.DaffInheritableError = DaffInheritableError;
|
|
730
|
-
exports.DaffLocalStorageService = DaffLocalStorageService;
|
|
731
|
-
exports.DaffNoopStorageService = DaffNoopStorageService;
|
|
732
|
-
exports.DaffPersistenceServiceToken = DaffPersistenceServiceToken;
|
|
733
|
-
exports.DaffServerErrorStorageService = DaffServerErrorStorageService;
|
|
734
|
-
exports.DaffServerSideStorageError = DaffServerSideStorageError;
|
|
735
|
-
exports.DaffStorageServiceError = DaffStorageServiceError;
|
|
736
|
-
exports.backoff = backoff;
|
|
737
|
-
exports.daffAdd = daffAdd;
|
|
738
|
-
exports.daffArrayToDict = daffArrayToDict;
|
|
739
|
-
exports.daffDivide = daffDivide;
|
|
740
|
-
exports.daffMultiply = daffMultiply;
|
|
741
|
-
exports.daffSubtract = daffSubtract;
|
|
742
|
-
exports.randomSlice = randomSlice;
|
|
743
|
-
exports.randomSubset = randomSubset;
|
|
744
|
-
exports.range = range;
|
|
745
|
-
exports.sample = sample;
|
|
746
|
-
exports.shuffle = shuffle;
|
|
747
|
-
exports.unique = unique;
|
|
748
|
-
|
|
749
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
750
|
-
|
|
751
|
-
})));
|
|
752
|
-
//# sourceMappingURL=daffodil-core.umd.js.map
|