@schukai/monster 1.31.0 → 2.0.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/CHANGELOG +11 -0
- package/README.md +55 -58
- package/example/constraints/andoperator.mjs +17 -0
- package/example/constraints/invalid.mjs +6 -0
- package/example/constraints/isarray.mjs +11 -0
- package/example/constraints/isobject.mjs +12 -0
- package/example/constraints/oroperator.mjs +15 -0
- package/example/constraints/valid.mjs +6 -0
- package/example/data/buildmap.mjs +67 -0
- package/example/data/datasource.mjs +7 -0
- package/example/data/diff.mjs +39 -0
- package/example/data/pathfinder-1.mjs +23 -0
- package/example/data/pathfinder-2.mjs +19 -0
- package/example/data/pipe.mjs +14 -0
- package/example/data/storage/restapi.mjs +11 -0
- package/example/data/transformer.mjs +9 -0
- package/example/dom/customelement.mjs +13 -0
- package/example/dom/theme.mjs +5 -0
- package/example/dom/updater.mjs +23 -0
- package/example/i18n/formatter.mjs +10 -0
- package/example/i18n/providers/fetch.mjs +5 -0
- package/example/i18n/translations.mjs +20 -0
- package/example/types/basewithoptions.mjs +10 -0
- package/example/types/is-1.mjs +5 -0
- package/example/types/is-10.mjs +6 -0
- package/example/types/is-2.mjs +4 -0
- package/example/types/is-3.mjs +4 -0
- package/example/types/is-4.mjs +5 -0
- package/example/types/is-5.mjs +4 -0
- package/example/types/is-6.mjs +4 -0
- package/example/types/is-7.mjs +4 -0
- package/example/types/is-8.mjs +4 -0
- package/example/types/is-9.mjs +6 -0
- package/example/types/noderecursiveiterator.mjs +32 -0
- package/example/types/observer.mjs +9 -0
- package/example/types/proxyobserver.mjs +25 -0
- package/example/types/queue.mjs +20 -0
- package/example/types/tokenlist-1.mjs +4 -0
- package/example/types/tokenlist-2.mjs +7 -0
- package/example/types/tokenlist-3.mjs +5 -0
- package/example/types/tokenlist-4.mjs +5 -0
- package/example/types/tokenlist-5.mjs +5 -0
- package/example/types/typeof.mjs +9 -0
- package/example/types/version-1.mjs +6 -0
- package/example/types/version-2.mjs +3 -0
- package/example/util/comparator.mjs +10 -0
- package/example/util/deadmansswitch.mjs +9 -0
- package/example/util/processing.mjs +17 -0
- package/package.json +5 -59
- package/source/{constants.js → constants.mjs} +7 -10
- package/source/constraints/{abstract.js → abstract.mjs} +8 -9
- package/source/constraints/{abstractoperator.js → abstractoperator.mjs} +11 -8
- package/source/constraints/andoperator.mjs +38 -0
- package/source/constraints/invalid.mjs +38 -0
- package/source/constraints/isarray.mjs +41 -0
- package/source/constraints/isobject.mjs +41 -0
- package/source/constraints/{namespace.js → namespace.mjs} +3 -8
- package/source/constraints/{oroperator.js → oroperator.mjs} +10 -42
- package/source/constraints/valid.mjs +38 -0
- package/source/data/{buildmap.js → buildmap.mjs} +18 -104
- package/source/data/{buildtree.js → buildtree.mjs} +11 -31
- package/source/data/datasource/{namespace.js → namespace.mjs} +1 -9
- package/source/data/datasource/restapi/namespace.mjs +8 -0
- package/source/data/datasource/restapi/{writeerror.js → writeerror.mjs} +8 -9
- package/source/data/datasource/{restapi.js → restapi.mjs} +15 -45
- package/source/data/datasource/storage/localstorage.mjs +45 -0
- package/source/data/datasource/storage/{namespace.js → namespace.mjs} +1 -9
- package/source/data/datasource/storage/sessionstorage.mjs +45 -0
- package/source/data/datasource/{storage.js → storage.mjs} +12 -35
- package/source/data/{datasource.js → datasource.mjs} +17 -45
- package/source/data/{diff.js → diff.mjs} +10 -69
- package/source/data/{extend.js → extend.mjs} +10 -28
- package/source/data/{namespace.js → namespace.mjs} +2 -8
- package/source/data/{pathfinder.js → pathfinder.mjs} +18 -77
- package/source/data/{pipe.js → pipe.mjs} +14 -46
- package/source/data/{transformer.js → transformer.mjs} +18 -43
- package/source/dom/{assembler.js → assembler.mjs} +12 -28
- package/source/dom/{attributes.js → attributes.mjs} +42 -253
- package/source/dom/{constants.js → constants.mjs} +110 -61
- package/source/dom/{customcontrol.js → customcontrol.mjs} +10 -17
- package/source/dom/{customelement.js → customelement.mjs} +28 -52
- package/source/dom/{events.js → events.mjs} +15 -64
- package/source/dom/{focusmanager.js → focusmanager.mjs} +13 -34
- package/source/dom/{locale.js → locale.mjs} +11 -26
- package/source/dom/{namespace.js → namespace.mjs} +1 -8
- package/source/dom/{ready.js → ready.mjs} +12 -30
- package/source/dom/resource/{data.js → data.mjs} +11 -31
- package/source/dom/resource/link/namespace.mjs +10 -0
- package/source/dom/resource/link/stylesheet.mjs +35 -0
- package/source/dom/resource/{link.js → link.mjs} +9 -29
- package/source/dom/resource/namespace.mjs +8 -0
- package/source/dom/resource/{script.js → script.mjs} +9 -29
- package/source/dom/{resource.js → resource.mjs} +19 -39
- package/source/dom/{resourcemanager.js → resourcemanager.mjs} +17 -35
- package/source/dom/{template.js → template.mjs} +18 -43
- package/source/dom/{theme.js → theme.mjs} +14 -36
- package/source/dom/{updater.js → updater.mjs} +34 -68
- package/source/dom/{util.js → util.mjs} +17 -66
- package/source/dom/worker/{factory.js → factory.mjs} +13 -34
- package/source/dom/worker/namespace.mjs +8 -0
- package/source/i18n/{formatter.js → formatter.mjs} +14 -45
- package/source/i18n/{locale.js → locale.mjs} +15 -30
- package/source/i18n/{namespace.js → namespace.mjs} +1 -9
- package/source/i18n/provider.mjs +40 -0
- package/source/i18n/providers/{fetch.js → fetch.mjs} +18 -43
- package/source/i18n/providers/namespace.mjs +8 -0
- package/source/i18n/{translations.js → translations.mjs} +12 -52
- package/source/logging/handler/console.mjs +50 -0
- package/source/logging/handler/namespace.mjs +6 -0
- package/source/logging/{handler.js → handler.mjs} +13 -30
- package/source/logging/logentry.mjs +51 -0
- package/source/logging/{logger.js → logger.mjs} +12 -28
- package/source/logging/{namespace.js → namespace.mjs} +1 -9
- package/source/math/{namespace.js → namespace.mjs} +1 -9
- package/source/math/{random.js → random.mjs} +8 -34
- package/source/monster.mjs +114 -0
- package/source/text/{formatter.js → formatter.mjs} +17 -33
- package/source/text/{namespace.js → namespace.mjs} +1 -9
- package/source/types/base.mjs +31 -0
- package/source/types/{basewithoptions.js → basewithoptions.mjs} +17 -46
- package/source/types/{binary.js → binary.mjs} +10 -42
- package/source/types/{dataurl.js → dataurl.mjs} +12 -46
- package/source/types/{global.js → global.mjs} +20 -12
- package/source/types/{id.js → id.mjs} +10 -27
- package/source/types/is.mjs +225 -0
- package/source/types/{mediatype.js → mediatype.mjs} +13 -29
- package/source/types/{namespace.js → namespace.mjs} +1 -8
- package/source/types/{node.js → node.mjs} +11 -28
- package/source/types/{nodelist.js → nodelist.mjs} +17 -32
- package/source/types/{noderecursiveiterator.js → noderecursiveiterator.mjs} +14 -65
- package/source/types/{observer.js → observer.mjs} +15 -42
- package/source/types/{observerlist.js → observerlist.mjs} +12 -29
- package/source/types/{proxyobserver.js → proxyobserver.mjs} +19 -62
- package/source/types/{queue.js → queue.mjs} +10 -47
- package/source/types/randomid.mjs +45 -0
- package/source/types/regex.mjs +27 -0
- package/source/types/{stack.js → stack.mjs} +8 -24
- package/source/types/{tokenlist.js → tokenlist.mjs} +20 -64
- package/source/types/typeof.mjs +37 -0
- package/source/types/{uniquequeue.js → uniquequeue.mjs} +11 -27
- package/source/types/{uuid.js → uuid.mjs} +15 -33
- package/source/types/{validate.js → validate.mjs} +38 -155
- package/source/types/{version.js → version.mjs} +19 -62
- package/source/util/{clone.js → clone.mjs} +10 -28
- package/source/util/{comparator.js → comparator.mjs} +13 -43
- package/source/util/{deadmansswitch.js → deadmansswitch.mjs} +15 -40
- package/source/util/freeze.mjs +39 -0
- package/source/util/{namespace.js → namespace.mjs} +1 -9
- package/source/util/{processing.js → processing.mjs} +13 -51
- package/source/util/{trimspaces.js → trimspaces.mjs} +14 -21
- package/test/cases/constraint/{andoperator.js → andoperator.mjs} +3 -3
- package/test/cases/constraint/{invalid.js → invalid.mjs} +1 -1
- package/test/cases/constraint/{isarray.js → isarray.mjs} +1 -1
- package/test/cases/constraint/{isobject.js → isobject.mjs} +1 -1
- package/test/cases/constraint/{oroperator.js → oroperator.mjs} +3 -3
- package/test/cases/constraint/{valid.js → valid.mjs} +1 -1
- package/test/cases/data/{buildmap.js → buildmap.mjs} +1 -1
- package/test/cases/data/{buildtree.js → buildtree.mjs} +2 -2
- package/test/cases/data/datasource/{restapi.js → restapi.mjs} +5 -5
- package/test/cases/data/datasource/storage/{localstorage.js → localstorage.mjs} +5 -5
- package/test/cases/data/datasource/storage/{sessionstorage.js → sessionstorage.mjs} +5 -5
- package/test/cases/data/{datasource.js → datasource.mjs} +1 -1
- package/test/cases/data/{diff.js → diff.mjs} +2 -2
- package/test/cases/data/{extend.js → extend.mjs} +1 -1
- package/test/cases/data/{pathfinder.js → pathfinder.mjs} +1 -1
- package/test/cases/data/{pipe.js → pipe.mjs} +19 -5
- package/test/cases/data/{transformer.js → transformer.mjs} +14 -10
- package/test/cases/dom/{assembler.js → assembler.mjs} +2 -2
- package/test/cases/dom/{attributes.js → attributes.mjs} +2 -2
- package/test/cases/dom/{customcontrol.js → customcontrol.mjs} +6 -6
- package/test/cases/dom/{customelement.js → customelement.mjs} +6 -6
- package/test/cases/dom/{events.js → events.mjs} +2 -2
- package/test/cases/dom/{focusmanager.js → focusmanager.mjs} +3 -3
- package/test/cases/dom/{locale.js → locale.mjs} +2 -2
- package/test/cases/dom/{ready.js → ready.mjs} +2 -2
- package/test/cases/dom/resource/{data.js → data.mjs} +9 -9
- package/test/cases/dom/resource/link/{stylesheet.js → stylesheet.mjs} +6 -6
- package/test/cases/dom/resource/{link.js → link.mjs} +6 -6
- package/test/cases/dom/resource/{script.js → script.mjs} +6 -6
- package/test/cases/dom/{resourcemanager.js → resourcemanager.mjs} +6 -6
- package/test/cases/dom/{template.js → template.mjs} +3 -3
- package/test/cases/dom/{theme.js → theme.mjs} +3 -3
- package/test/cases/dom/{updater.js → updater.mjs} +6 -6
- package/test/cases/dom/{util.js → util.mjs} +2 -2
- package/test/cases/dom/worker/{factory.js → factory.mjs} +4 -4
- package/test/cases/i18n/{formatter.js → formatter.mjs} +2 -2
- package/test/cases/i18n/{locale.js → locale.mjs} +1 -1
- package/test/cases/i18n/{provider.js → provider.mjs} +1 -1
- package/test/cases/i18n/providers/{fetch.js → fetch.mjs} +3 -3
- package/test/cases/i18n/{translations.js → translations.mjs} +2 -2
- package/test/cases/logging/handler/{console.js → console.mjs} +3 -3
- package/test/cases/logging/{handler.js → handler.mjs} +3 -3
- package/test/cases/logging/{logentry.js → logentry.mjs} +1 -1
- package/test/cases/logging/{logger.js → logger.mjs} +1 -1
- package/test/cases/math/random.mjs +101 -0
- package/test/cases/monster.mjs +20 -0
- package/test/cases/text/{formatter.js → formatter.mjs} +1 -1
- package/test/cases/types/{base.js → base.mjs} +1 -1
- package/test/cases/types/{basewithoptions.js → basewithoptions.mjs} +1 -1
- package/test/cases/types/{binary.js → binary.mjs} +1 -1
- package/test/cases/types/{dataurl.js → dataurl.mjs} +1 -1
- package/test/cases/types/{global.js → global.mjs} +1 -1
- package/test/cases/types/{id.js → id.mjs} +17 -6
- package/test/cases/types/{is.js → is.mjs} +20 -8
- package/test/cases/types/{mediatype.js → mediatype.mjs} +1 -1
- package/test/cases/types/{node.js → node.mjs} +3 -3
- package/test/cases/types/{nodelist.js → nodelist.mjs} +2 -2
- package/test/cases/types/{noderecursiveiterator.js → noderecursiveiterator.mjs} +3 -3
- package/test/cases/types/{observer.js → observer.mjs} +1 -1
- package/test/cases/types/{observerlist.js → observerlist.mjs} +2 -2
- package/test/cases/types/{proxyobserver.js → proxyobserver.mjs} +4 -4
- package/test/cases/types/{queue.js → queue.mjs} +1 -1
- package/test/cases/types/randomid.mjs +39 -0
- package/test/cases/types/regex.mjs +46 -0
- package/test/cases/types/{stack.js → stack.mjs} +1 -1
- package/test/cases/types/{tokenlist.js → tokenlist.mjs} +1 -1
- package/test/cases/types/{typeof.js → typeof.mjs} +3 -4
- package/test/cases/types/{uniquequeue.js → uniquequeue.mjs} +1 -1
- package/test/cases/types/{uuid.js → uuid.mjs} +30 -10
- package/test/cases/types/{validate.js → validate.mjs} +3 -4
- package/test/cases/types/{version.js → version.mjs} +1 -2
- package/test/cases/util/{clone.js → clone.mjs} +1 -1
- package/test/cases/util/{comparator.js → comparator.mjs} +1 -1
- package/test/cases/util/{deadmansswitch.js → deadmansswitch.mjs} +1 -1
- package/test/cases/util/{freeze.js → freeze.mjs} +1 -1
- package/test/cases/util/{processing.js → processing.mjs} +1 -1
- package/test/cases/util/{trimspaces.js → trimspaces.mjs} +1 -1
- package/test/util/{chai-dom.js → chai-dom.mjs} +0 -0
- package/test/util/{cleanupdom.js → cleanupdom.mjs} +0 -0
- package/test/util/{jsdom.js → jsdom.mjs} +2 -2
- package/test/util/{localstorage.js → localstorage.mjs} +0 -0
- package/test/web/import.js +77 -78
- package/test/web/prepare.js +0 -8
- package/test/web/test.html +5 -4
- package/test/web/tests.js +25731 -587
- package/dist/modules/constants.js +0 -2
- package/dist/modules/constraints/abstract.js +0 -2
- package/dist/modules/constraints/abstractoperator.js +0 -2
- package/dist/modules/constraints/andoperator.js +0 -2
- package/dist/modules/constraints/invalid.js +0 -2
- package/dist/modules/constraints/isarray.js +0 -2
- package/dist/modules/constraints/isobject.js +0 -2
- package/dist/modules/constraints/namespace.js +0 -2
- package/dist/modules/constraints/oroperator.js +0 -2
- package/dist/modules/constraints/valid.js +0 -2
- package/dist/modules/data/buildmap.js +0 -2
- package/dist/modules/data/buildtree.js +0 -2
- package/dist/modules/data/datasource/namespace.js +0 -2
- package/dist/modules/data/datasource/restapi/writeerror.js +0 -2
- package/dist/modules/data/datasource/restapi.js +0 -2
- package/dist/modules/data/datasource/storage/localstorage.js +0 -2
- package/dist/modules/data/datasource/storage/namespace.js +0 -2
- package/dist/modules/data/datasource/storage/sessionstorage.js +0 -2
- package/dist/modules/data/datasource/storage.js +0 -2
- package/dist/modules/data/datasource.js +0 -2
- package/dist/modules/data/diff.js +0 -2
- package/dist/modules/data/extend.js +0 -2
- package/dist/modules/data/namespace.js +0 -2
- package/dist/modules/data/pathfinder.js +0 -2
- package/dist/modules/data/pipe.js +0 -2
- package/dist/modules/data/transformer.js +0 -2
- package/dist/modules/dom/assembler.js +0 -2
- package/dist/modules/dom/attributes.js +0 -2
- package/dist/modules/dom/constants.js +0 -2
- package/dist/modules/dom/customcontrol.js +0 -2
- package/dist/modules/dom/customelement.js +0 -2
- package/dist/modules/dom/events.js +0 -2
- package/dist/modules/dom/focusmanager.js +0 -2
- package/dist/modules/dom/locale.js +0 -2
- package/dist/modules/dom/namespace.js +0 -2
- package/dist/modules/dom/ready.js +0 -2
- package/dist/modules/dom/resource/data.js +0 -2
- package/dist/modules/dom/resource/link/stylesheet.js +0 -2
- package/dist/modules/dom/resource/link.js +0 -2
- package/dist/modules/dom/resource/script.js +0 -2
- package/dist/modules/dom/resource.js +0 -2
- package/dist/modules/dom/resourcemanager.js +0 -2
- package/dist/modules/dom/template.js +0 -2
- package/dist/modules/dom/theme.js +0 -2
- package/dist/modules/dom/updater.js +0 -2
- package/dist/modules/dom/util.js +0 -2
- package/dist/modules/dom/worker/factory.js +0 -2
- package/dist/modules/i18n/formatter.js +0 -2
- package/dist/modules/i18n/locale.js +0 -2
- package/dist/modules/i18n/namespace.js +0 -2
- package/dist/modules/i18n/provider.js +0 -2
- package/dist/modules/i18n/providers/fetch.js +0 -2
- package/dist/modules/i18n/providers/namespace.js +0 -2
- package/dist/modules/i18n/translations.js +0 -2
- package/dist/modules/logging/handler/console.js +0 -2
- package/dist/modules/logging/handler/namespace.js +0 -2
- package/dist/modules/logging/handler.js +0 -2
- package/dist/modules/logging/logentry.js +0 -2
- package/dist/modules/logging/logger.js +0 -2
- package/dist/modules/logging/namespace.js +0 -2
- package/dist/modules/math/namespace.js +0 -2
- package/dist/modules/math/random.js +0 -2
- package/dist/modules/monster.js +0 -2
- package/dist/modules/namespace.js +0 -2
- package/dist/modules/text/formatter.js +0 -2
- package/dist/modules/text/namespace.js +0 -2
- package/dist/modules/types/base.js +0 -2
- package/dist/modules/types/basewithoptions.js +0 -2
- package/dist/modules/types/binary.js +0 -2
- package/dist/modules/types/dataurl.js +0 -2
- package/dist/modules/types/global.js +0 -2
- package/dist/modules/types/id.js +0 -2
- package/dist/modules/types/is.js +0 -2
- package/dist/modules/types/mediatype.js +0 -2
- package/dist/modules/types/namespace.js +0 -2
- package/dist/modules/types/node.js +0 -2
- package/dist/modules/types/nodelist.js +0 -2
- package/dist/modules/types/noderecursiveiterator.js +0 -2
- package/dist/modules/types/observer.js +0 -2
- package/dist/modules/types/observerlist.js +0 -2
- package/dist/modules/types/proxyobserver.js +0 -2
- package/dist/modules/types/queue.js +0 -2
- package/dist/modules/types/randomid.js +0 -2
- package/dist/modules/types/regex.js +0 -2
- package/dist/modules/types/stack.js +0 -2
- package/dist/modules/types/tokenlist.js +0 -2
- package/dist/modules/types/typeof.js +0 -2
- package/dist/modules/types/uniquequeue.js +0 -2
- package/dist/modules/types/uuid.js +0 -2
- package/dist/modules/types/validate.js +0 -2
- package/dist/modules/types/version.js +0 -2
- package/dist/modules/util/clone.js +0 -2
- package/dist/modules/util/comparator.js +0 -2
- package/dist/modules/util/deadmansswitch.js +0 -2
- package/dist/modules/util/freeze.js +0 -2
- package/dist/modules/util/namespace.js +0 -2
- package/dist/modules/util/processing.js +0 -2
- package/dist/modules/util/trimspaces.js +0 -2
- package/dist/monster.dev.js +0 -15490
- package/dist/monster.dev.js.map +0 -1
- package/dist/monster.js +0 -2
- package/source/constraints/andoperator.js +0 -71
- package/source/constraints/invalid.js +0 -63
- package/source/constraints/isarray.js +0 -71
- package/source/constraints/isobject.js +0 -72
- package/source/constraints/valid.js +0 -63
- package/source/data/datasource/storage/localstorage.js +0 -64
- package/source/data/datasource/storage/sessionstorage.js +0 -61
- package/source/dom/resource/link/stylesheet.js +0 -54
- package/source/i18n/provider.js +0 -58
- package/source/i18n/providers/namespace.js +0 -16
- package/source/logging/handler/console.js +0 -66
- package/source/logging/handler/namespace.js +0 -14
- package/source/logging/logentry.js +0 -68
- package/source/monster.js +0 -80
- package/source/namespace.js +0 -171
- package/source/types/base.js +0 -50
- package/source/types/is.js +0 -429
- package/source/types/package.d.ts +0 -1
- package/source/types/randomid.js +0 -60
- package/source/types/regex.js +0 -49
- package/source/types/typeof.js +0 -63
- package/source/util/freeze.js +0 -57
- package/test/cases/math/random.js +0 -82
- package/test/cases/monster.js +0 -23
- package/test/cases/namespace.js +0 -93
- package/test/cases/types/randomid.js +0 -24
- package/test/cases/types/regex.js +0 -32
- package/test/web/monster-dev.html +0 -22
- package/test/web/monster.html +0 -21
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {DELIMITER, Pathfinder, WILDCARD} from "./pathfinder.js";
|
|
8
|
+
import {isFunction, isObject, isString} from "../types/is.mjs";
|
|
9
|
+
import {validateString} from "../types/validate.mjs";
|
|
10
|
+
import {clone} from "../util/clone.mjs";
|
|
11
|
+
import {DELIMITER, Pathfinder, WILDCARD} from "./pathfinder.mjs";
|
|
12
12
|
|
|
13
|
+
export {buildMap, PARENT, assembleParts}
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
|
-
* @type {string}
|
|
16
|
+
* @type {string}
|
|
17
|
+
* @memberOf Monster.Data
|
|
16
18
|
*/
|
|
17
|
-
|
|
19
|
+
const PARENT = '^';
|
|
18
20
|
|
|
19
21
|
|
|
20
22
|
/**
|
|
@@ -23,98 +25,12 @@ export const PARENT = '^';
|
|
|
23
25
|
* Either a simple definition `a.b.c` or a template `${a.b.c}` can be specified as the path.
|
|
24
26
|
* Key and value can be either a definition or a template. The key does not have to be defined.
|
|
25
27
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* ```
|
|
29
|
-
* <script type="module">
|
|
30
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
31
|
-
* console.log(Monster.Data.buildMap())
|
|
32
|
-
* </script>
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* Alternatively, you can also integrate this function individually.
|
|
36
|
-
*
|
|
37
|
-
* ```
|
|
38
|
-
* <script type="module">
|
|
39
|
-
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/data/buildmap.js';
|
|
40
|
-
* console.log(buildMap())
|
|
41
|
-
* </script>
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* The templates determine the appearance of the keys and the value of the map. Either a single value `id` can be taken or a composite key `${id} ${name}` can be used.
|
|
28
|
+
* The templates determine the appearance of the keys and the value of the map. Either a single value
|
|
29
|
+
* `id` can be taken or a composite key `${id} ${name}` can be used.
|
|
45
30
|
*
|
|
46
31
|
* If you want to access values of the parent data set, you have to use the `^` character `${id} ${^.name}`.
|
|
47
32
|
*
|
|
48
|
-
* @example
|
|
49
|
-
*
|
|
50
|
-
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/data/buildmap.js';
|
|
51
|
-
* // a typical data structure as reported by an api
|
|
52
|
-
*
|
|
53
|
-
* let map;
|
|
54
|
-
* let obj = {
|
|
55
|
-
* "data": [
|
|
56
|
-
* {
|
|
57
|
-
* "id": 10,
|
|
58
|
-
* "name": "Cassandra",
|
|
59
|
-
* "address": {
|
|
60
|
-
* "street": "493-4105 Vulputate Street",
|
|
61
|
-
* "city": "Saumur",
|
|
62
|
-
* "zip": "52628"
|
|
63
|
-
* }
|
|
64
|
-
* },
|
|
65
|
-
* {
|
|
66
|
-
* "id": 20,
|
|
67
|
-
* "name": "Holly",
|
|
68
|
-
* "address": {
|
|
69
|
-
* "street": "1762 Eget Rd.",
|
|
70
|
-
* "city": "Schwalbach",
|
|
71
|
-
* "zip": "952340"
|
|
72
|
-
* }
|
|
73
|
-
* },
|
|
74
|
-
* {
|
|
75
|
-
* "id": 30,
|
|
76
|
-
* "name": "Guy",
|
|
77
|
-
* "address": {
|
|
78
|
-
* "street": "957-388 Sollicitudin Avenue",
|
|
79
|
-
* "city": "Panchià",
|
|
80
|
-
* "zip": "420729"
|
|
81
|
-
* }
|
|
82
|
-
* }
|
|
83
|
-
* ]
|
|
84
|
-
* };
|
|
85
|
-
*
|
|
86
|
-
* // The function is passed this data structure and with the help of the selector `'data.*'` the data to be considered are selected.
|
|
87
|
-
* // The key is given by a simple definition `'id'` and the value is given by a template `'${name} (${address.zip} ${address.city})'`.
|
|
88
|
-
* map = buildMap(obj, 'data.*', '${name} (${address.zip} ${address.city})', 'id');
|
|
89
|
-
* console.log(map);
|
|
90
|
-
*
|
|
91
|
-
* // ↦ Map(3) {
|
|
92
|
-
* // '10' => 'Cassandra (52628 Saumur)',
|
|
93
|
-
* // '20' => 'Holly (952340 Schwalbach)',
|
|
94
|
-
* // '30' => 'Guy (420729 Panchià)'
|
|
95
|
-
* // }
|
|
96
|
-
*
|
|
97
|
-
* // If no key is specified, the key from the selection, here the array index, is taken.
|
|
98
|
-
* map = buildMap(obj, 'data.*', '${name} (${address.zip} ${address.city})');
|
|
99
|
-
* console.log(map);
|
|
100
|
-
*
|
|
101
|
-
* // ↦ Map(3) {
|
|
102
|
-
* // '0' => 'Cassandra (52628 Saumur)',
|
|
103
|
-
* // '1' => 'Holly (952340 Schwalbach)',
|
|
104
|
-
* // '2' => 'Guy (420729 Panchià)'
|
|
105
|
-
* // }
|
|
106
|
-
*
|
|
107
|
-
* // a filter (function(value, key) {}) can be specified to accept only defined entries.
|
|
108
|
-
* map = buildMap(obj, 'data.*', '${name} (${address.zip} ${address.city})', 'id', function (value, key) {
|
|
109
|
-
* return (value['id'] >= 20) ? true : false
|
|
110
|
-
* });
|
|
111
|
-
* console.log(map);
|
|
112
|
-
*
|
|
113
|
-
* // ↦ Map(2) {
|
|
114
|
-
* // 20 => 'Holly (952340 Schwalbach)',
|
|
115
|
-
* // 30 => 'Guy (420729 Panchià)'
|
|
116
|
-
* // }
|
|
117
|
-
*
|
|
33
|
+
* @externalExample ../../example/data/buildmap.mjs
|
|
118
34
|
* @param {*} subject
|
|
119
35
|
* @param {string|Monster.Data~exampleSelectorCallback} selector
|
|
120
36
|
* @param {string} [valueTemplate]
|
|
@@ -134,6 +50,7 @@ function buildMap(subject, selector, valueTemplate, keyTemplate, filter) {
|
|
|
134
50
|
|
|
135
51
|
}
|
|
136
52
|
|
|
53
|
+
|
|
137
54
|
/**
|
|
138
55
|
* @private
|
|
139
56
|
* @param {*} subject
|
|
@@ -261,7 +178,7 @@ function buildFlatMap(subject, selector, key, parentMap) {
|
|
|
261
178
|
* Alternatively to a string selector a callback can be specified. this must return a map.
|
|
262
179
|
*
|
|
263
180
|
* @example
|
|
264
|
-
* import {buildMap} from '
|
|
181
|
+
* import {buildMap} from '@schukai/monster/source/data/buildmap.mjs';
|
|
265
182
|
*
|
|
266
183
|
* let obj = {
|
|
267
184
|
* "data": [
|
|
@@ -384,6 +301,7 @@ function buildFlatMap(subject, selector, key, parentMap) {
|
|
|
384
301
|
* @callback Monster.Data~exampleSelectorCallback
|
|
385
302
|
* @param {*} subject subject
|
|
386
303
|
* @return Map
|
|
304
|
+
* @license AGPLv3
|
|
387
305
|
* @since 1.17.0
|
|
388
306
|
* @memberOf Monster.Data
|
|
389
307
|
* @see {@link Monster.Data.buildMap}
|
|
@@ -427,7 +345,3 @@ function build(subject, definition, defaultValue) {
|
|
|
427
345
|
return definition;
|
|
428
346
|
|
|
429
347
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
assignToNamespace('Monster.Data', buildMap);
|
|
433
|
-
export {Monster, buildMap, assembleParts}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {extend} from "./extend.js";
|
|
8
|
+
import {isArray, isObject} from "../types/is.mjs";
|
|
9
|
+
import {Node} from "../types/node.mjs";
|
|
10
|
+
import {NodeList} from "../types/nodelist.mjs";
|
|
11
|
+
import {assembleParts} from "./buildmap.mjs";
|
|
12
|
+
import {extend} from "./extend.mjs";
|
|
13
13
|
|
|
14
|
+
export {buildTree}
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* @private
|
|
@@ -34,24 +35,6 @@ const rootSymbol = Symbol('root');
|
|
|
34
35
|
/**
|
|
35
36
|
* With the help of the function `buildTree()`, nodes can be easily created from data objects.
|
|
36
37
|
*
|
|
37
|
-
* You can call the method via the monster namespace `Monster.Data.buildTree()`.
|
|
38
|
-
*
|
|
39
|
-
* ```
|
|
40
|
-
* <script type="module">
|
|
41
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/buildtree.js';
|
|
42
|
-
* Monster.Data.buildTree()
|
|
43
|
-
* </script>
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* Alternatively, you can also integrate this function individually.
|
|
47
|
-
*
|
|
48
|
-
* ```
|
|
49
|
-
* <script type="module">
|
|
50
|
-
* import {buildTree} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/data/buildtree.js';
|
|
51
|
-
* buildTree()
|
|
52
|
-
* </script>
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
38
|
* @param {*} subject
|
|
56
39
|
* @param {string|Monster.Data~exampleSelectorCallback} selector
|
|
57
40
|
* @param {string} idKey
|
|
@@ -62,6 +45,7 @@ const rootSymbol = Symbol('root');
|
|
|
62
45
|
* @throws {TypeError} value is neither a string nor a function
|
|
63
46
|
* @throws {TypeError} the selector callback must return a map
|
|
64
47
|
* @throws {Error} the object has no value for the specified id
|
|
48
|
+
* @license AGPLv3
|
|
65
49
|
* @since 1.26.0
|
|
66
50
|
*/
|
|
67
51
|
function buildTree(subject, selector, idKey, parentIDKey, options) {
|
|
@@ -123,7 +107,3 @@ function buildTree(subject, selector, idKey, parentIDKey, options) {
|
|
|
123
107
|
|
|
124
108
|
return list;
|
|
125
109
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
assignToNamespace('Monster.Data', buildTree);
|
|
129
|
-
export {Monster, buildTree}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Namespace for datasources
|
|
5
3
|
*
|
|
@@ -7,10 +5,4 @@
|
|
|
7
5
|
* @memberOf Monster.Data
|
|
8
6
|
* @author schukai GmbH
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @private
|
|
14
|
-
* @type {string}
|
|
15
|
-
*/
|
|
16
|
-
export const namespace = "Monster.Data.Datasource";
|
|
8
|
+
const ns = {};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import {internalSymbol} from "../../../constants.
|
|
8
|
-
|
|
8
|
+
import {internalSymbol} from "../../../constants.mjs";
|
|
9
|
+
|
|
10
|
+
export {WriteError}
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Error message for API requests with extension of request and validation.
|
|
12
14
|
*
|
|
15
|
+
* @license AGPLv3
|
|
13
16
|
* @since 1.24.0
|
|
14
17
|
* @copyright schukai GmbH
|
|
15
18
|
* @memberOf Monster.Data.Datasource.RestAPI
|
|
@@ -43,7 +46,3 @@ class WriteError extends Error {
|
|
|
43
46
|
return this[internalSymbol]['validation']
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
assignToNamespace('Monster.Data.Datasource.RestAPI', WriteError);
|
|
49
|
-
export {Monster, WriteError}
|
|
@@ -1,50 +1,24 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import {internalSymbol} from "../../constants.
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
8
|
+
import {internalSymbol} from "../../constants.mjs";
|
|
9
|
+
import {isObject} from "../../types/is.mjs";
|
|
10
|
+
import {Datasource} from "../datasource.mjs";
|
|
11
|
+
import {Pathfinder} from "../pathfinder.mjs";
|
|
12
|
+
import {Pipe} from "../pipe.mjs";
|
|
13
|
+
import {WriteError} from "./restapi/writeerror.mjs";
|
|
14
|
+
|
|
15
|
+
export {RestAPI}
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* ```
|
|
19
|
-
* <script type="module">
|
|
20
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
21
|
-
* Monster.Data.Datasource.RestAPI()
|
|
22
|
-
* </script>
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* Alternatively you can import the class directly
|
|
26
|
-
*
|
|
27
|
-
* ```
|
|
28
|
-
* <script type="module">
|
|
29
|
-
* import {RestAPI} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/data/datasource/restapi.js';
|
|
30
|
-
* new RestAPI()
|
|
31
|
-
* </script>
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
*
|
|
36
|
-
* import {RestAPI} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/data/datasource/restapi.js';
|
|
37
|
-
*
|
|
38
|
-
* const ds = new RestAPI({
|
|
39
|
-
* url: 'https://httpbin.org/get'
|
|
40
|
-
* },{
|
|
41
|
-
* url: 'https://httpbin.org/post'
|
|
42
|
-
* });
|
|
43
|
-
*
|
|
44
|
-
* ds.set({flag:true})
|
|
45
|
-
* ds.write().then(()=>console.log('done'));
|
|
46
|
-
* ds.read().then(()=>console.log('done'));
|
|
18
|
+
* The RestAPI is a class that enables a REST API server.
|
|
47
19
|
*
|
|
20
|
+
* @externalExample ../../../example/data/storage/restapi.mjs
|
|
21
|
+
* @license AGPLv3
|
|
48
22
|
* @since 1.22.0
|
|
49
23
|
* @copyright schukai GmbH
|
|
50
24
|
* @memberOf Monster.Data.Datasource
|
|
@@ -260,7 +234,3 @@ class RestAPI extends Datasource {
|
|
|
260
234
|
* @memberOf Monster.Data
|
|
261
235
|
* @see Monster.Data.Datasource
|
|
262
236
|
*/
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
assignToNamespace('Monster.Data.Datasource', RestAPI);
|
|
266
|
-
export {Monster, RestAPI}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {internalSymbol} from "../../../constants.mjs";
|
|
9
|
+
import {getGlobalObject} from "../../../types/global.mjs";
|
|
10
|
+
import {Datasource} from "../../datasource.mjs";
|
|
11
|
+
import {Storage, storageObjectSymbol} from "../storage.mjs";
|
|
12
|
+
|
|
13
|
+
export {LocalStorage}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The LocalStorage Datasource provides a data store in the browser localStorage.
|
|
17
|
+
*
|
|
18
|
+
* @license AGPLv3
|
|
19
|
+
* @since 1.22.0
|
|
20
|
+
* @copyright schukai GmbH
|
|
21
|
+
* @memberOf Monster.Data.Datasource.Storage
|
|
22
|
+
* @summary The LocalStorage class encapsulates the access to data objects.
|
|
23
|
+
*/
|
|
24
|
+
class LocalStorage extends Storage {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @throws {Error} this method must be implemented by derived classes.
|
|
28
|
+
* @return {external:localStorage}
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
[storageObjectSymbol]() {
|
|
32
|
+
return getGlobalObject('localStorage');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create clone
|
|
37
|
+
* @return {LocalStorage}
|
|
38
|
+
*/
|
|
39
|
+
getClone() {
|
|
40
|
+
const self = this;
|
|
41
|
+
return new LocalStorage(self[internalSymbol].getRealSubject()['options'].key);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Namespace for storages
|
|
5
3
|
*
|
|
@@ -7,10 +5,4 @@
|
|
|
7
5
|
* @memberOf Monster.Data.Datasource
|
|
8
6
|
* @author schukai GmbH
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @private
|
|
14
|
-
* @type {string}
|
|
15
|
-
*/
|
|
16
|
-
export const namespace = "Monster.Data.Datasource.Storage";
|
|
8
|
+
const ns = {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {internalSymbol} from "../../../constants.mjs";
|
|
9
|
+
import {getGlobalObject} from "../../../types/global.mjs";
|
|
10
|
+
import {Datasource} from "../../datasource.mjs";
|
|
11
|
+
import {Storage, storageObjectSymbol} from "../storage.mjs";
|
|
12
|
+
|
|
13
|
+
export {SessionStorage}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The SessionStorage class provides a data source that uses the SessionStorage API on the client.
|
|
17
|
+
*
|
|
18
|
+
* @license AGPLv3
|
|
19
|
+
* @since 1.22.0
|
|
20
|
+
* @copyright schukai GmbH
|
|
21
|
+
* @memberOf Monster.Data.Datasource.Storage
|
|
22
|
+
* @summary The LocalStorage class encapsulates the access to data objects.
|
|
23
|
+
*/
|
|
24
|
+
class SessionStorage extends Storage {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @throws {Error} this method must be implemented by derived classes.
|
|
28
|
+
* @return {external:sessionStorage}
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
[storageObjectSymbol]() {
|
|
32
|
+
return getGlobalObject('sessionStorage');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create Clone
|
|
37
|
+
*
|
|
38
|
+
* @return {SessionStorage}
|
|
39
|
+
*/
|
|
40
|
+
getClone() {
|
|
41
|
+
const self = this;
|
|
42
|
+
return new SessionStorage(self[internalSymbol].getRealSubject()['options'].key);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import {internalSymbol} from "../../constants.
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
8
|
+
import {internalSymbol} from "../../constants.mjs";
|
|
9
|
+
import {validateString} from "../../types/validate.mjs";
|
|
10
|
+
import {Datasource} from "../datasource.mjs";
|
|
11
|
+
|
|
12
|
+
export {Storage, storageObjectSymbol}
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* @private
|
|
@@ -16,30 +18,9 @@ import {Datasource} from "../datasource.js";
|
|
|
16
18
|
const storageObjectSymbol = Symbol('storageObject');
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* <script type="module">
|
|
23
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
24
|
-
* Monster.Data.Datasource.Storage()
|
|
25
|
-
* </script>
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* Alternatively you can import the class directly
|
|
29
|
-
*
|
|
30
|
-
* ```
|
|
31
|
-
* <script type="module">
|
|
32
|
-
* import {Storage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/data/datasource/storage.js';
|
|
33
|
-
* new Storage()
|
|
34
|
-
* </script>
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
*
|
|
39
|
-
* import {Storage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/data/datasource/storage.js';
|
|
40
|
-
*
|
|
41
|
-
* new Datasource();
|
|
42
|
-
*
|
|
21
|
+
* The class represents a record.
|
|
22
|
+
*
|
|
23
|
+
* @license AGPLv3
|
|
43
24
|
* @since 1.22.0
|
|
44
25
|
* @copyright schukai GmbH
|
|
45
26
|
* @memberOf Monster.Data.Datasource
|
|
@@ -125,7 +106,3 @@ class Storage extends Datasource {
|
|
|
125
106
|
}
|
|
126
107
|
|
|
127
108
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
assignToNamespace('Monster.Data.Datasource', Storage);
|
|
131
|
-
export {Monster, Storage, storageObjectSymbol}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
|
3
|
+
* Node module: @schukai/monster
|
|
4
|
+
* This file is licensed under the AGPLv3 License.
|
|
5
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import {internalSymbol} from "../constants.
|
|
8
|
-
|
|
9
|
-
import {Base} from "../types/base.
|
|
10
|
-
import {parseDataURL} from "../types/dataurl.
|
|
11
|
-
import {isString} from "../types/is.
|
|
12
|
-
import {ProxyObserver} from "../types/proxyobserver.
|
|
13
|
-
import {validateObject} from "../types/validate.
|
|
14
|
-
import {extend} from "./extend.
|
|
15
|
-
import {Pathfinder} from "./pathfinder.
|
|
8
|
+
import {internalSymbol} from "../constants.mjs";
|
|
9
|
+
|
|
10
|
+
import {Base} from "../types/base.mjs";
|
|
11
|
+
import {parseDataURL} from "../types/dataurl.mjs";
|
|
12
|
+
import {isString} from "../types/is.mjs";
|
|
13
|
+
import {ProxyObserver} from "../types/proxyobserver.mjs";
|
|
14
|
+
import {validateObject} from "../types/validate.mjs";
|
|
15
|
+
import {extend} from "./extend.mjs";
|
|
16
|
+
import {Pathfinder} from "./pathfinder.mjs";
|
|
16
17
|
|
|
18
|
+
export {Datasource}
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* @private
|
|
20
22
|
* @type {symbol}
|
|
21
23
|
* @memberOf Monster.Data
|
|
24
|
+
* @license AGPLv3
|
|
22
25
|
* @since 1.24.0
|
|
23
26
|
*/
|
|
24
27
|
const internalDataSymbol = Symbol('internalData');
|
|
@@ -26,35 +29,8 @@ const internalDataSymbol = Symbol('internalData');
|
|
|
26
29
|
/**
|
|
27
30
|
* The datasource class is the basis for dealing with different data sources.
|
|
28
31
|
* It provides a unified interface for accessing data
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* ```
|
|
33
|
-
* <script type="module">
|
|
34
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
|
35
|
-
* Monster.Data.Datasource()
|
|
36
|
-
* </script>
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* Alternatively you can import the class directly
|
|
40
|
-
*
|
|
41
|
-
* ```
|
|
42
|
-
* <script type="module">
|
|
43
|
-
* import {Datasource} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/data/datasource.js';
|
|
44
|
-
* new Datasource()
|
|
45
|
-
* </script>
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
*
|
|
50
|
-
* import {Datasource} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/data/datasource.js'
|
|
51
|
-
*
|
|
52
|
-
* class MyDatasource extends Datasource {
|
|
53
|
-
*
|
|
54
|
-
* }
|
|
55
|
-
*
|
|
56
|
-
* const ds = new MyDatasource();
|
|
57
|
-
*
|
|
32
|
+
* @externalExample ../../example/data/datasource.mjs
|
|
33
|
+
* @license AGPLv3
|
|
58
34
|
* @since 1.22.0
|
|
59
35
|
* @copyright schukai GmbH
|
|
60
36
|
* @memberOf Monster.Data
|
|
@@ -240,7 +216,3 @@ function parseOptionsJSON(data) {
|
|
|
240
216
|
|
|
241
217
|
return {};
|
|
242
218
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
assignToNamespace('Monster.Data', Datasource);
|
|
246
|
-
export {Monster, Datasource}
|