@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,36 +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 {getGlobal} from '../types/global.js';
|
8
|
+
import {getGlobal} from '../types/global.mjs';
|
9
9
|
|
10
|
+
export {random}
|
10
11
|
|
11
12
|
/**
|
12
13
|
* this function uses crypt and returns a random number.
|
13
14
|
*
|
14
|
-
* you can call the method via the monster namespace `Monster.Math.random()`.
|
15
|
-
*
|
16
|
-
* ```
|
17
|
-
* <script type="module">
|
18
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
19
|
-
* Monster.Math.random(1,10)
|
20
|
-
* // ↦ 5
|
21
|
-
* </script>
|
22
|
-
* ```
|
23
|
-
*
|
24
|
-
* Alternatively, you can also integrate this function individually.
|
25
|
-
*
|
26
|
-
* ```
|
27
|
-
* <script type="module">
|
28
|
-
* import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/math/random.js';
|
29
|
-
* random(1,10)
|
30
|
-
* // ↦ 5
|
31
|
-
* </script>
|
32
|
-
* ```
|
33
|
-
*
|
34
15
|
* @param {number} min starting value of the definition set (default is 0)
|
35
16
|
* @param {number} max end value of the definition set (default is 1000000000)
|
36
17
|
* @returns {number}
|
@@ -39,10 +20,11 @@ import {getGlobal} from '../types/global.js';
|
|
39
20
|
* @throws {Error} we cannot generate numbers larger than 53 bits.
|
40
21
|
* @throws {Error} the distance is too small to create a random number.
|
41
22
|
|
23
|
+
* @license AGPLv3
|
42
24
|
* @since 1.0.0
|
43
25
|
* @copyright schukai GmbH
|
44
26
|
*/
|
45
|
-
function random(min, max) {
|
27
|
+
function random(min, max) {
|
46
28
|
|
47
29
|
if (min === undefined) {
|
48
30
|
min = 0;
|
@@ -65,7 +47,6 @@ function random(min, max) {
|
|
65
47
|
*/
|
66
48
|
var MAX = 1000000000;
|
67
49
|
|
68
|
-
|
69
50
|
Math.log2 = Math.log2 || function (n) {
|
70
51
|
return Math.log(n) / Math.log(2);
|
71
52
|
};
|
@@ -125,10 +106,3 @@ function create(min, max) {
|
|
125
106
|
return rval;
|
126
107
|
|
127
108
|
}
|
128
|
-
|
129
|
-
assignToNamespace('Monster.Math', random);
|
130
|
-
export {Monster, random}
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
@@ -0,0 +1,114 @@
|
|
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
|
+
* SPDX-License-Identifier: AGPL-3.0-only or COMMERCIAL
|
7
|
+
*/
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Main namespace for Monster.
|
11
|
+
*
|
12
|
+
* @namespace Monster
|
13
|
+
* @author schukai GmbH
|
14
|
+
*/
|
15
|
+
|
16
|
+
|
17
|
+
import './constants.mjs';
|
18
|
+
// find packages/monster/source/ -type f -name "*.mjs" -not -name "*namespace*" -not -iname "monster.mjs"
|
19
|
+
import './constraints/isobject.mjs';
|
20
|
+
import './constraints/valid.mjs';
|
21
|
+
import './constraints/invalid.mjs';
|
22
|
+
import './constraints/abstractoperator.mjs';
|
23
|
+
import './constraints/oroperator.mjs';
|
24
|
+
import './constraints/andoperator.mjs';
|
25
|
+
import './constraints/abstract.mjs';
|
26
|
+
import './constraints/isarray.mjs';
|
27
|
+
import './logging/logger.mjs';
|
28
|
+
import './logging/handler.mjs';
|
29
|
+
import './logging/logentry.mjs';
|
30
|
+
import './logging/handler/console.mjs';
|
31
|
+
import './text/formatter.mjs';
|
32
|
+
import './dom/resource/script.mjs';
|
33
|
+
import './dom/resource/data.mjs';
|
34
|
+
import './dom/resource/link/stylesheet.mjs';
|
35
|
+
import './dom/resource/link.mjs';
|
36
|
+
import './dom/resource.mjs';
|
37
|
+
import './dom/updater.mjs';
|
38
|
+
import './dom/attributes.mjs';
|
39
|
+
import './dom/template.mjs';
|
40
|
+
import './dom/util.mjs';
|
41
|
+
import './dom/ready.mjs';
|
42
|
+
import './dom/resourcemanager.mjs';
|
43
|
+
import './dom/locale.mjs';
|
44
|
+
import './dom/customcontrol.mjs';
|
45
|
+
import './dom/constants.mjs';
|
46
|
+
import './dom/assembler.mjs';
|
47
|
+
import './dom/theme.mjs';
|
48
|
+
import './dom/worker/factory.mjs';
|
49
|
+
import './dom/focusmanager.mjs';
|
50
|
+
import './dom/events.mjs';
|
51
|
+
import './dom/customelement.mjs';
|
52
|
+
import './i18n/formatter.mjs';
|
53
|
+
import './i18n/providers/fetch.mjs';
|
54
|
+
import './i18n/translations.mjs';
|
55
|
+
import './i18n/locale.mjs';
|
56
|
+
import './i18n/provider.mjs';
|
57
|
+
import './types/queue.mjs';
|
58
|
+
import './types/binary.mjs';
|
59
|
+
import './types/regex.mjs';
|
60
|
+
import './types/observer.mjs';
|
61
|
+
import './types/observerlist.mjs';
|
62
|
+
import './types/basewithoptions.mjs';
|
63
|
+
import './types/is.mjs';
|
64
|
+
import './types/proxyobserver.mjs';
|
65
|
+
import './types/uniquequeue.mjs';
|
66
|
+
import './types/node.mjs';
|
67
|
+
import './types/tokenlist.mjs';
|
68
|
+
import './types/typeof.mjs';
|
69
|
+
import './types/uuid.mjs';
|
70
|
+
import './types/mediatype.mjs';
|
71
|
+
import './types/dataurl.mjs';
|
72
|
+
import './types/base.mjs';
|
73
|
+
import './types/version.mjs';
|
74
|
+
import './types/nodelist.mjs';
|
75
|
+
import './types/id.mjs';
|
76
|
+
import './types/randomid.mjs';
|
77
|
+
import './types/noderecursiveiterator.mjs';
|
78
|
+
import './types/validate.mjs';
|
79
|
+
import './types/stack.mjs';
|
80
|
+
import './util/deadmansswitch.mjs';
|
81
|
+
import './util/comparator.mjs';
|
82
|
+
import './util/trimspaces.mjs';
|
83
|
+
import './util/clone.mjs';
|
84
|
+
import './util/freeze.mjs';
|
85
|
+
import './util/processing.mjs';
|
86
|
+
import './constants.mjs';
|
87
|
+
import './data/pathfinder.mjs';
|
88
|
+
import './data/pipe.mjs';
|
89
|
+
import './data/extend.mjs';
|
90
|
+
import './data/diff.mjs';
|
91
|
+
import './data/buildmap.mjs';
|
92
|
+
import './data/datasource.mjs';
|
93
|
+
import './data/buildtree.mjs';
|
94
|
+
import './data/transformer.mjs';
|
95
|
+
import './data/datasource/storage.mjs';
|
96
|
+
import './data/datasource/restapi.mjs';
|
97
|
+
import './data/datasource/storage/sessionstorage.mjs';
|
98
|
+
import './data/datasource/storage/localstorage.mjs';
|
99
|
+
import './data/datasource/restapi/writeerror.mjs';
|
100
|
+
import './math/random.mjs';
|
101
|
+
|
102
|
+
export {Monster}
|
103
|
+
|
104
|
+
/**
|
105
|
+
* This class has no other purpose than to exist.
|
106
|
+
*
|
107
|
+
* @license AGPLv3
|
108
|
+
* @since 2.0.0
|
109
|
+
* @copyright schukai GmbH
|
110
|
+
* @memberOf Monster
|
111
|
+
*/
|
112
|
+
class Monster {
|
113
|
+
|
114
|
+
}
|
@@ -1,17 +1,20 @@
|
|
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 {extend} from "../data/extend.
|
9
|
-
import {Pipe} from "../data/pipe.
|
10
|
-
|
11
|
-
import {BaseWithOptions} from "../types/basewithoptions.
|
12
|
-
import {isObject, isString} from "../types/is.
|
13
|
-
import {validateArray, validateString} from "../types/validate.
|
8
|
+
import {internalSymbol} from "../constants.mjs";
|
9
|
+
import {extend} from "../data/extend.mjs";
|
10
|
+
import {Pipe} from "../data/pipe.mjs";
|
11
|
+
|
12
|
+
import {BaseWithOptions} from "../types/basewithoptions.mjs";
|
13
|
+
import {isObject, isString} from "../types/is.mjs";
|
14
|
+
import {validateArray, validateString} from "../types/validate.mjs";
|
15
|
+
import {getMonsterVersion} from "../types/version.mjs";
|
14
16
|
|
17
|
+
export {Formatter}
|
15
18
|
|
16
19
|
/**
|
17
20
|
* @private
|
@@ -49,24 +52,6 @@ const workingDataSymbol = Symbol('workingData');
|
|
49
52
|
*
|
50
53
|
* Look at the example below. The placeholders use the logic of Pipe.
|
51
54
|
*
|
52
|
-
* You can create an instance via the monster namespace `new Monster.Text.Formatter()`.
|
53
|
-
*
|
54
|
-
* ```
|
55
|
-
* <script type="module">
|
56
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
57
|
-
* new Monster.Text.Formatter()
|
58
|
-
* </script>
|
59
|
-
* ```
|
60
|
-
*
|
61
|
-
* Alternatively, you can also integrate this function individually.
|
62
|
-
*
|
63
|
-
* ```
|
64
|
-
* <script type="module">
|
65
|
-
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/text/formatter.js';
|
66
|
-
* new Formatter()
|
67
|
-
* </script>
|
68
|
-
* ```
|
69
|
-
*
|
70
55
|
* ## Marker in marker
|
71
56
|
*
|
72
57
|
* Markers can be nested. Here, the inner marker is resolved first `${subkey} ↦ 1 = ${mykey2}` and then the outer marker `${mykey2}`.
|
@@ -107,7 +92,7 @@ const workingDataSymbol = Symbol('workingData');
|
|
107
92
|
*
|
108
93
|
* @example
|
109
94
|
*
|
110
|
-
* import {Formatter} from '
|
95
|
+
* import {Formatter} from '@schukai/monster/source/text/formatter.mjs';
|
111
96
|
*
|
112
97
|
* new Formatter({
|
113
98
|
* a: {
|
@@ -120,11 +105,12 @@ const workingDataSymbol = Symbol('workingData');
|
|
120
105
|
*
|
121
106
|
* // ↦ Hello World!
|
122
107
|
*
|
108
|
+
* @license AGPLv3
|
123
109
|
* @since 1.12.0
|
124
110
|
* @copyright schukai GmbH
|
125
111
|
* @memberOf Monster.Text
|
126
112
|
*/
|
127
|
-
class Formatter extends BaseWithOptions {
|
113
|
+
class Formatter extends BaseWithOptions {
|
128
114
|
|
129
115
|
/**
|
130
116
|
* Default values for the markers are `${` and `}`
|
@@ -278,6 +264,7 @@ function format(text) {
|
|
278
264
|
|
279
265
|
/**
|
280
266
|
* @private
|
267
|
+
* @license AGPLv3
|
281
268
|
* @since 1.12.0
|
282
269
|
* @param text
|
283
270
|
* @return {string}
|
@@ -362,6 +349,3 @@ function tokenize(text, openMarker, closeMarker) {
|
|
362
349
|
|
363
350
|
return formatted.join('');
|
364
351
|
}
|
365
|
-
|
366
|
-
assignToNamespace('Monster.Text', Formatter);
|
367
|
-
export {Monster, Formatter}
|
@@ -0,0 +1,31 @@
|
|
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
|
+
export {Base}
|
9
|
+
|
10
|
+
/**
|
11
|
+
* This is the base class from which all monster classes are derived.
|
12
|
+
*
|
13
|
+
* The class was formerly called Object.
|
14
|
+
*
|
15
|
+
* @license AGPLv3
|
16
|
+
* @since 1.5.0
|
17
|
+
* @copyright schukai GmbH
|
18
|
+
* @memberOf Monster.Types
|
19
|
+
*/
|
20
|
+
class Base extends Object {
|
21
|
+
|
22
|
+
/**
|
23
|
+
*
|
24
|
+
* @returns {string}
|
25
|
+
*/
|
26
|
+
toString() {
|
27
|
+
return JSON.stringify(this);
|
28
|
+
};
|
29
|
+
|
30
|
+
|
31
|
+
}
|
@@ -1,54 +1,28 @@
|
|
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 {extend} from "../data/extend.
|
9
|
-
import {Pathfinder} from "../data/pathfinder.
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
|
8
|
+
import {internalSymbol} from "../constants.mjs";
|
9
|
+
import {extend} from "../data/extend.mjs";
|
10
|
+
import {Pathfinder} from "../data/pathfinder.mjs";
|
11
|
+
import {Base} from "./base.mjs";
|
12
|
+
import {validateObject} from "./validate.mjs";
|
13
|
+
|
14
|
+
export {BaseWithOptions}
|
13
15
|
|
14
16
|
/**
|
15
17
|
* This is the base class with options from which some monster classes are derived.
|
16
18
|
*
|
17
19
|
* This class is actually only used as a base class.
|
18
|
-
*
|
19
|
-
* However, you can also create an instance directly via the monster namespace `new Monster.Types.BaseWithOptions()`.
|
20
|
-
*
|
21
|
-
* ```html
|
22
|
-
* <script type="module">
|
23
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
24
|
-
* new Monster.Types.BaseWithOptions()
|
25
|
-
* </script>
|
26
|
-
* ```
|
27
|
-
*
|
28
|
-
* Alternatively, you can also integrate this function individually.
|
29
20
|
*
|
30
|
-
* ```html
|
31
|
-
* <script type="module">
|
32
|
-
* import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/types/basewithoptions.js';
|
33
|
-
* new BaseWithOptions()
|
34
|
-
* </script>
|
35
|
-
* ```
|
36
|
-
*
|
37
21
|
* Classes that require the possibility of options can be derived directly from this class.
|
38
22
|
* Derived classes almost always override the `defaul` getter with their own values.
|
39
23
|
*
|
40
|
-
*
|
41
|
-
*
|
42
|
-
* get defaults() {
|
43
|
-
* return Object.assign({}, super.defaults, {
|
44
|
-
* mykey: true
|
45
|
-
* });
|
46
|
-
* }
|
47
|
-
* }
|
48
|
-
* ```
|
49
|
-
*
|
50
|
-
* The class was formerly called Object.
|
51
|
-
*
|
24
|
+
* @externalExample ../../example/types/basewithoptions.mjs
|
25
|
+
* @license AGPLv3
|
52
26
|
* @since 1.13.0
|
53
27
|
* @copyright schukai GmbH
|
54
28
|
* @memberOf Monster.Types
|
@@ -71,17 +45,17 @@ class BaseWithOptions extends Base {
|
|
71
45
|
}
|
72
46
|
|
73
47
|
/**
|
74
|
-
* This getter provides the options. Derived classes overwrite
|
75
|
-
* this getter with their own values. It is good karma to always include
|
48
|
+
* This getter provides the options. Derived classes overwrite
|
49
|
+
* this getter with their own values. It is good karma to always include
|
76
50
|
* the values from the parent class.
|
77
|
-
*
|
51
|
+
*
|
78
52
|
* ```javascript
|
79
53
|
* get defaults() {
|
80
54
|
* return Object.assign({}, super.defaults, {
|
81
55
|
* mykey: true
|
82
56
|
* });
|
83
57
|
* }
|
84
|
-
*
|
58
|
+
*
|
85
59
|
* ```
|
86
60
|
*
|
87
61
|
* @return {object}
|
@@ -113,6 +87,3 @@ class BaseWithOptions extends Base {
|
|
113
87
|
|
114
88
|
|
115
89
|
}
|
116
|
-
|
117
|
-
assignToNamespace('Monster.Types', BaseWithOptions);
|
118
|
-
export {Monster, BaseWithOptions}
|
@@ -1,36 +1,22 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
import {assignToNamespace} from "../namespace.js";
|
4
|
-
|
5
|
-
|
6
1
|
/**
|
7
|
-
*
|
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
|
8
6
|
*/
|
9
|
-
|
7
|
+
|
8
|
+
import {validateString} from "./validate.mjs";
|
9
|
+
|
10
|
+
export {toBinary, fromBinary}
|
10
11
|
|
11
12
|
/**
|
12
13
|
* You can call the function via the monster namespace `Monster.Types.toBinary()`.
|
13
14
|
*
|
14
|
-
* ```
|
15
|
-
* <script type="module">
|
16
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
17
|
-
* Monster.Types.toBinary()
|
18
|
-
* </script>
|
19
|
-
* ```
|
20
|
-
*
|
21
|
-
* Alternatively, you can also integrate this function individually.
|
22
|
-
*
|
23
|
-
* ```
|
24
|
-
* <script type="module">
|
25
|
-
* import {toBinary} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/types/binary.js';
|
26
|
-
* toBinary()
|
27
|
-
* </script>
|
28
|
-
* ```
|
29
|
-
*
|
30
15
|
* @param {String} binary
|
31
16
|
* @return {String}
|
32
17
|
* @throws {TypeError} value is not a string
|
33
18
|
* @memberOf Monster.Types
|
19
|
+
* @license AGPLv3
|
34
20
|
* @since 1.18.0
|
35
21
|
*/
|
36
22
|
function toBinary(string) {
|
@@ -52,26 +38,11 @@ function toBinary(string) {
|
|
52
38
|
/**
|
53
39
|
* You can call the function via the monster namespace `Monster.Types.fromBinary()`.
|
54
40
|
*
|
55
|
-
* ```
|
56
|
-
* <script type="module">
|
57
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
58
|
-
* Monster.Types.fromBinary()
|
59
|
-
* </script>
|
60
|
-
* ```
|
61
|
-
*
|
62
|
-
* Alternatively, you can also integrate this function individually.
|
63
|
-
*
|
64
|
-
* ```
|
65
|
-
* <script type="module">
|
66
|
-
* import {fromBinary} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/types/binary.js';
|
67
|
-
* fromBinary()
|
68
|
-
* </script>
|
69
|
-
* ```
|
70
|
-
*
|
71
41
|
* @param {String} binary
|
72
42
|
* @return {String}
|
73
43
|
* @throws {TypeError} value is not a string
|
74
44
|
* @memberOf Monster.Types
|
45
|
+
* @license AGPLv3
|
75
46
|
* @since 1.18.0
|
76
47
|
*/
|
77
48
|
function fromBinary(binary) {
|
@@ -87,6 +58,3 @@ function fromBinary(binary) {
|
|
87
58
|
return result;
|
88
59
|
}
|
89
60
|
|
90
|
-
|
91
|
-
assignToNamespace('Monster.Types', toBinary, fromBinary);
|
92
|
-
export {Monster, toBinary, fromBinary};
|
@@ -1,13 +1,16 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
import {assignToNamespace} from "../namespace.js";
|
4
1
|
/**
|
5
|
-
*
|
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
6
|
*/
|
7
|
-
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
7
|
+
|
8
|
+
import {Base} from "./base.mjs";
|
9
|
+
import {isString} from "./is.mjs";
|
10
|
+
import {MediaType, parseMediaType} from "./mediatype.mjs";
|
11
|
+
import {validateBoolean, validateInstance, validateString} from "./validate.mjs";
|
12
|
+
|
13
|
+
export {DataUrl, parseDataURL}
|
11
14
|
|
12
15
|
/**
|
13
16
|
* @private
|
@@ -18,22 +21,7 @@ const internal = Symbol('internal');
|
|
18
21
|
/**
|
19
22
|
* You can create an object via the monster namespace `new Monster.Types.DataUrl()`.
|
20
23
|
*
|
21
|
-
*
|
22
|
-
* <script type="module">
|
23
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
24
|
-
* new Monster.Types.DataUrl()
|
25
|
-
* </script>
|
26
|
-
* ```
|
27
|
-
*
|
28
|
-
* Alternatively, you can also integrate this function individually.
|
29
|
-
*
|
30
|
-
* ```
|
31
|
-
* <script type="module">
|
32
|
-
* import {DataUrl} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/types/dataurl.js';
|
33
|
-
* new DataUrl()
|
34
|
-
* </script>
|
35
|
-
* ```
|
36
|
-
*
|
24
|
+
* @license AGPLv3
|
37
25
|
* @since 1.8.0
|
38
26
|
* @copyright schukai GmbH
|
39
27
|
* @memberOf Monster.Types
|
@@ -96,22 +84,6 @@ class DataUrl extends Base {
|
|
96
84
|
/**
|
97
85
|
* You can call the function via the monster namespace `Monster.Types.parseDataURL()`.
|
98
86
|
*
|
99
|
-
* ```
|
100
|
-
* <script type="module">
|
101
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/monster.js';
|
102
|
-
* console.log(Monster.Types.parseDataURL())
|
103
|
-
* </script>
|
104
|
-
* ```
|
105
|
-
*
|
106
|
-
* Alternatively, you can also integrate this function individually.
|
107
|
-
*
|
108
|
-
* ```
|
109
|
-
* <script type="module">
|
110
|
-
* import {parseDataURL} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.31.0/dist/modules/types/dataurl.js';
|
111
|
-
* console.log(parseDataURL())
|
112
|
-
* </script>
|
113
|
-
* ```
|
114
|
-
*
|
115
87
|
* Specification:
|
116
88
|
*
|
117
89
|
* ```
|
@@ -167,10 +139,4 @@ function parseDataURL(dataurl) {
|
|
167
139
|
}
|
168
140
|
|
169
141
|
return new DataUrl(content, mediatype, base64Flag);
|
170
|
-
|
171
|
-
|
172
142
|
}
|
173
|
-
|
174
|
-
|
175
|
-
assignToNamespace('Monster.Types', parseDataURL, DataUrl);
|
176
|
-
export {Monster, parseDataURL, DataUrl};
|
@@ -1,11 +1,16 @@
|
|
1
|
-
|
1
|
+
|
2
2
|
|
3
3
|
/**
|
4
|
-
*
|
4
|
+
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
|
5
|
+
* Node module: @schukai/monster
|
6
|
+
* This file is licensed under the AGPLv3 License.
|
7
|
+
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
5
8
|
*/
|
6
9
|
|
7
|
-
|
8
|
-
import {validateFunction, validateObject, validateString} from "./validate.
|
10
|
+
|
11
|
+
import {validateFunction, validateObject, validateString} from "./validate.mjs";
|
12
|
+
|
13
|
+
export {getGlobal, getGlobalObject, getGlobalFunction}
|
9
14
|
|
10
15
|
/**
|
11
16
|
* @type {objec}
|
@@ -63,6 +68,7 @@ let globalReference;
|
|
63
68
|
*
|
64
69
|
* If globalThis is not available, it will be polyfilled
|
65
70
|
*
|
71
|
+
* @license AGPLv3
|
66
72
|
* @since 1.6.0
|
67
73
|
* @memberOf Monster.Types
|
68
74
|
* @returns {objec} globalThis
|
@@ -78,8 +84,8 @@ function getGlobal() {
|
|
78
84
|
*
|
79
85
|
* ```
|
80
86
|
* <script type="module">
|
81
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
82
|
-
* Monster.Types.getGlobalObject('document')
|
87
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.mjs';
|
88
|
+
* Monster.Types.getGlobalObject('document')
|
83
89
|
* // ↦ { }
|
84
90
|
* </script>
|
85
91
|
* ```
|
@@ -88,12 +94,13 @@ function getGlobal() {
|
|
88
94
|
*
|
89
95
|
* ```
|
90
96
|
* <script type="module">
|
91
|
-
* import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
92
|
-
* getGlobalObject('document')
|
97
|
+
* import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/types/global.mjs';
|
98
|
+
* getGlobalObject('document')
|
93
99
|
* // ↦ { }
|
94
100
|
* </script>
|
95
101
|
* ```
|
96
102
|
*
|
103
|
+
* @license AGPLv3
|
97
104
|
* @since 1.6.0
|
98
105
|
* @memberOf Monster.Types
|
99
106
|
* @param {string} name
|
@@ -117,7 +124,7 @@ function getGlobalObject(name) {
|
|
117
124
|
*
|
118
125
|
* ```
|
119
126
|
* <script type="module">
|
120
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
127
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.mjs';
|
121
128
|
* console.log(Monster.Types.getGlobalFunction('parseInt')) // ↦ f parseInt() { }
|
122
129
|
* </script>
|
123
130
|
* ```
|
@@ -126,11 +133,12 @@ function getGlobalObject(name) {
|
|
126
133
|
*
|
127
134
|
* ```
|
128
135
|
* <script type="module">
|
129
|
-
* import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.
|
136
|
+
* import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/types/global.mjs';
|
130
137
|
* console.log(getGlobalFunction('parseInt')) // ↦ f parseInt() { }
|
131
138
|
* </script>
|
132
139
|
* ```
|
133
140
|
*
|
141
|
+
* @license AGPLv3
|
134
142
|
* @since 1.6.0
|
135
143
|
* @memberOf Monster.Types
|
136
144
|
* @param {string} name
|
@@ -148,5 +156,5 @@ function getGlobalFunction(name) {
|
|
148
156
|
}
|
149
157
|
|
150
158
|
|
151
|
-
|
152
|
-
|
159
|
+
|
160
|
+
|