Skip to content
Snippets Groups Projects
Verified Commit 18583969 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: commit save point

parent 486a6bf5
No related branches found
No related tags found
No related merge requests found
Showing
with 152 additions and 49 deletions
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {getGlobal} from "../types/global.mjs";
import {validateString} from "../types/validate.mjs";
......@@ -14,7 +18,7 @@ export {getDocument, getWindow, getDocumentFragmentFromString}
*
* ```
* <script type="module">
* import {getDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/dom/util.mjs';
* import {getDocument} from '@schukai/monster/source/dom/util.mjs';
* console.log(getDocument())
* </script>
* ```
......@@ -47,6 +51,7 @@ export {getDocument, getWindow, getDocumentFragmentFromString}
* ```
*
* @returns {object}
* @license AGPLv3
* @since 1.6.0
* @copyright schukai GmbH
* @memberOf Monster.DOM
......@@ -66,7 +71,7 @@ function getDocument() {
*
* ```
* <script type="module">
* import {getWindow} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/dom/util.mjs';
* import {getWindow} from '@schukai/monster/source/dom/util.mjs';
* console.log(getWindow(null))
* </script>
* ```
......@@ -101,6 +106,7 @@ function getDocument() {
* ```
*
* @returns {object}
* @license AGPLv3
* @since 1.6.0
* @copyright schukai GmbH
* @memberOf Monster.DOM
......@@ -121,7 +127,7 @@ function getWindow() {
*
* ```
* <script type="module">
* import {getDocumentFragmentFromString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/dom/util.mjs';
* import {getDocumentFragmentFromString} from '@schukai/monster/source/dom/util.mjs';
* console.log(getDocumentFragmentFromString('<div></div>'))
* </script>
* ```
......@@ -154,6 +160,7 @@ function getWindow() {
* ```
*
* @returns {DocumentFragment}
* @license AGPLv3
* @since 1.6.0
* @copyright schukai GmbH
* @memberOf Monster.DOM
......
......@@ -2,10 +2,14 @@
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {internalSymbol} from "../../constants.mjs";
import {Base} from "../../types/base.mjs";
import {getGlobal, getGlobalFunction} from "../../types/global.mjs";
......@@ -19,11 +23,12 @@ export {Factory}
*
* ```
* <script type="module">
* import {Factory} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/dom/worker/factory.mjs';
* import {Factory} from '@schukai/monster/source/dom/worker/factory.mjs';
* console.log(new Factory())
* </script>
* ```
*
* @license AGPLv3
* @since 1.25.0
* @copyright schukai GmbH
* @memberOf Monster.DOM.Worker
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {internalSymbol} from "../constants.mjs";
import {extend} from "../data/extend.mjs";
......@@ -25,15 +29,15 @@ const internalTranslationSymbol = Symbol('internalTranslation')
*
* ```
* <script type="module">
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/formatter.mjs';
* import {Formatter} from '@schukai/monster/source/i18n/formatter.mjs';
* new Formatter()
* </script>
* ```
*
* @example
*
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/formatter.mjs';
* import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/translations.mjs';
* import {Formatter} from '@schukai/monster/source/i18n/formatter.mjs';
* import {Translations} from '@schukai/monster/source/i18n/translations.mjs';
*
* const translations = new Translations('en')
* .assignTranslations({
......@@ -43,6 +47,7 @@ const internalTranslationSymbol = Symbol('internalTranslation')
* new Formatter({}, translations).format("thekey:animal=dog::food=cake")
* // ↦ dog has eaten the cake!
*
* @license AGPLv3
* @since 1.26.0
* @copyright schukai GmbH
* @memberOf Monster.I18n
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Base} from "../types/base.mjs";
import {validateString} from "../types/validate.mjs";
import {clone} from "../util/clone.mjs";
......@@ -27,7 +31,7 @@ const localeStringSymbol = Symbol('localeString');
*
* ```
* <script type="module">
* import {Locale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/locale.mjs';
* import {Locale} from '@schukai/monster/source/i18n/locale.mjs';
* new Locale()
* </script>
* ```
......@@ -63,6 +67,7 @@ const localeStringSymbol = Symbol('localeString');
* in the middle)
* ```
*
* @license AGPLv3
* @since 1.13.0
* @copyright schukai GmbH
* @memberOf Monster.I18n
......@@ -196,7 +201,7 @@ class Locale extends Base {
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source//monster.mjs';
* import {Monster} from '@schukai/monster/source//monster.mjs';
* new Monster.I18n.createLocale()
* </script>
* ```
......@@ -205,7 +210,7 @@ class Locale extends Base {
*
* ```
* <script type="module">
* import {createLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/locale.mjs';
* import {createLocale} from '@schukai/monster/source/i18n/locale.mjs';
* createLocale()
* </script>
* ```
......@@ -260,6 +265,7 @@ class Locale extends Base {
*
* @param {string} locale
* @returns {Locale}
* @license AGPLv3
* @since 1.14.0
* @copyright schukai GmbH
* @memberOf Monster.I18n
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {BaseWithOptions} from "../types/basewithoptions.mjs";
import {Locale} from "./locale.mjs"
import {Translations} from "./translations.mjs"
......@@ -15,11 +19,12 @@ export {Provider}
*
* ```
* <script type="module">
* import {Provider} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/provider.mjs';
* import {Provider} from '@schukai/monster/source/i18n/provider.mjs';
* new Provider()
* </script>
* ```
*
* @license AGPLv3
* @since 1.13.0
* @copyright schukai GmbH
* @memberOf Monster.I18n
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {internalSymbol} from "../../constants.mjs";
import {extend} from "../../data/extend.mjs";
import {Formatter} from "../../text/formatter.mjs";
......@@ -21,19 +25,20 @@ export {Fetch}
*
* ```
* <script type="module">
* import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/providers/fetch.mjs';
* import {Fetch} from '@schukai/monster/source/i18n/providers/fetch.mjs';
* new Fetch()
* </script>
* ```
*
* @example <caption>das ist ein test</caption>
*
* import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/providers/fetch.mjs';
* import {Fetch} from '@schukai/monster/source/i18n/providers/fetch.mjs';
*
* // fetch from API
* const translation = new Fetch('https://example.com/${language}.json').getTranslation('en-GB');
* // ↦ https://example.com/en.json
*
* @license AGPLv3
* @since 1.13.0
* @copyright schukai GmbH
* @memberOf Monster.I18n.Providers
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Base} from "../types/base.mjs";
import {isObject, isString} from "../types/is.mjs";
import {validateInstance, validateInteger, validateObject, validateString} from "../types/validate.mjs";
......@@ -16,15 +20,15 @@ export {Translations}
*
* ```
* <script type="module">
* import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/translations.mjs';
* import {Translations} from '@schukai/monster/source/i18n/translations.mjs';
* new Translations()
* </script>
* ```
*
* @example
*
* import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/translations.mjs';
* import {parseLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/i18n/locale.mjs';
* import {Translations} from '@schukai/monster/source/i18n/translations.mjs';
* import {parseLocale} from '@schukai/monster/source/i18n/locale.mjs';
*
* const translation = new Translations(parseLocale('en-GB'));
*
......@@ -44,6 +48,7 @@ export {Translations}
* console.log(translation.getPluralRuleText('text2',2));
* // -> click n times
*
* @license AGPLv3
* @since 1.13.0
* @copyright schukai GmbH
* @memberOf Monster.I18n
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Base} from '../types/base.mjs';
import {validateInstance, validateInteger} from "../types/validate.mjs";
import {LogEntry} from "./logentry.mjs";
......@@ -16,11 +20,12 @@ export {Handler}
*
* ```
* <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/logging/handler.mjs';
* import {ID} from '@schukai/monster/source/logging/handler.mjs';
* console.log(new Handler())
* </script>
* ```
*
* @license AGPLv3
* @since 1.5.0
* @copyright schukai GmbH
* @memberOf Monster.Logging
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Base} from '../../types/base.mjs';
import {getGlobalObject} from "../../types/global.mjs";
import {Handler} from '../handler.mjs';
......@@ -16,11 +20,12 @@ export {ConsoleHandler}
*
* ```
* <script type="module">
* import {ConsoleHandler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/logging/handler/console.mjs';
* import {ConsoleHandler} from '@schukai/monster/source/logging/handler/console.mjs';
* console.log(new ConsoleHandler())
* </script>
* ```
*
* @license AGPLv3
* @since 1.5.0
* @copyright schukai GmbH
* @memberOf Monster.Logging.Handler
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Base} from '../types/base.mjs';
import {validateInteger} from '../types/validate.mjs';
......@@ -15,11 +19,12 @@ export {LogEntry}
*
* ```
* <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/logging/logentry.mjs';
* import {ID} from '@schukai/monster/source/logging/logentry.mjs';
* console.log(new LogEntry())
* </script>
* ```
*
* @license AGPLv3
* @since 1.5.0
* @copyright schukai GmbH
* @memberOf Monster.Logging
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Handler} from '../logging/handler.mjs';
import {LogEntry} from '../logging/logentry.mjs';
......@@ -66,11 +70,12 @@ const OFF = 0;
*
* ```
* <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/logging/logger.mjs';
* import {ID} from '@schukai/monster/source/logging/logger.mjs';
* new Logger()
* </script>
* ```
*
* @license AGPLv3
* @since 1.5.0
* @copyright schukai GmbH
* @memberOf Monster.Logging
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {getGlobal} from '../types/global.mjs';
export {random}
......@@ -14,7 +18,7 @@ export {random}
*
* ```
* <script type="module">
* import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/math/random.mjs';
* import {random} from '@schukai/monster/source/math/random.mjs';
* random(1,10)
* // ↦ 5
* </script>
......@@ -28,6 +32,7 @@ export {random}
* @throws {Error} we cannot generate numbers larger than 53 bits.
* @throws {Error} the distance is too small to create a random number.
* @license AGPLv3
* @since 1.0.0
* @copyright schukai GmbH
*/
......
......@@ -104,6 +104,7 @@ export {Monster}
/**
* This class has no other purpose than to exist.
*
* @license AGPLv3
* @since 2.0.0
* @copyright schukai GmbH
* @memberOf Monster
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {internalSymbol} from "../constants.mjs";
import {extend} from "../data/extend.mjs";
import {Pipe} from "../data/pipe.mjs";
......@@ -53,7 +57,7 @@ const workingDataSymbol = Symbol('workingData');
*
* ```
* <script type="module">
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/text/formatter.mjs';
* import {Formatter} from '@schukai/monster/source/text/formatter.mjs';
* new Formatter()
* </script>
* ```
......@@ -98,7 +102,7 @@ const workingDataSymbol = Symbol('workingData');
*
* @example
*
* import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/text/formatter.mjs';
* import {Formatter} from '@schukai/monster/source/text/formatter.mjs';
*
* new Formatter({
* a: {
......@@ -111,6 +115,7 @@ const workingDataSymbol = Symbol('workingData');
*
* // ↦ Hello World!
*
* @license AGPLv3
* @since 1.12.0
* @copyright schukai GmbH
* @memberOf Monster.Text
......@@ -269,6 +274,7 @@ function format(text) {
/**
* @private
* @license AGPLv3
* @since 1.12.0
* @param text
* @return {string}
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
export {Base}
/**
......@@ -11,13 +15,14 @@ export {Base}
*
* ```
* <script type="module">
* import {Base} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/types/base.mjs';
* import {Base} from '@schukai/monster/source/types/base.mjs';
* new Base()
* </script>
* ```
*
* The class was formerly called Object.
*
* @license AGPLv3
* @since 1.5.0
* @copyright schukai GmbH
* @memberOf Monster.Types
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {internalSymbol} from "../constants.mjs";
import {extend} from "../data/extend.mjs";
import {Pathfinder} from "../data/pathfinder.mjs";
......@@ -20,7 +24,7 @@ export {BaseWithOptions}
*
* ```html
* <script type="module">
* import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/types/basewithoptions.mjs';
* import {BaseWithOptions} from '@schukai/monster/source/types/basewithoptions.mjs';
* new BaseWithOptions()
* </script>
* ```
......@@ -40,6 +44,7 @@ export {BaseWithOptions}
*
* The class was formerly called Object.
*
* @license AGPLv3
* @since 1.13.0
* @copyright schukai GmbH
* @memberOf Monster.Types
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {validateString} from "./validate.mjs";
export {toBinary, fromBinary}
......@@ -12,7 +16,7 @@ export {toBinary, fromBinary}
*
* ```
* <script type="module">
* import {toBinary} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/types/binary.mjs';
* import {toBinary} from '@schukai/monster/source/types/binary.mjs';
* toBinary()
* </script>
* ```
......@@ -21,6 +25,7 @@ export {toBinary, fromBinary}
* @return {String}
* @throws {TypeError} value is not a string
* @memberOf Monster.Types
* @license AGPLv3
* @since 1.18.0
*/
function toBinary(string) {
......@@ -44,7 +49,7 @@ function toBinary(string) {
*
* ```
* <script type="module">
* import {fromBinary} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/types/binary.mjs';
* import {fromBinary} from '@schukai/monster/source/types/binary.mjs';
* fromBinary()
* </script>
* ```
......@@ -53,6 +58,7 @@ function toBinary(string) {
* @return {String}
* @throws {TypeError} value is not a string
* @memberOf Monster.Types
* @license AGPLv3
* @since 1.18.0
*/
function fromBinary(binary) {
......
......@@ -2,9 +2,13 @@
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Base} from "./base.mjs";
import {isString} from "./is.mjs";
import {MediaType, parseMediaType} from "./mediatype.mjs";
......@@ -24,11 +28,12 @@ const internal = Symbol('internal');
*
* ```
* <script type="module">
* import {DataUrl} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/types/dataurl.mjs';
* import {DataUrl} from '@schukai/monster/source/types/dataurl.mjs';
* new DataUrl()
* </script>
* ```
*
* @license AGPLv3
* @since 1.8.0
* @copyright schukai GmbH
* @memberOf Monster.Types
......@@ -93,7 +98,7 @@ class DataUrl extends Base {
*
* ```
* <script type="module">
* import {parseDataURL} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/types/dataurl.mjs';
* import {parseDataURL} from '@schukai/monster/source/types/dataurl.mjs';
* parseDataURL(...)
* </script>
* ```
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {validateFunction, validateObject, validateString} from "./validate.mjs";
export {getGlobal, getGlobalObject, getGlobalFunction}
......@@ -64,6 +68,7 @@ let globalReference;
*
* If globalThis is not available, it will be polyfilled
*
* @license AGPLv3
* @since 1.6.0
* @memberOf Monster.Types
* @returns {objec} globalThis
......@@ -95,6 +100,7 @@ function getGlobal() {
* </script>
* ```
*
* @license AGPLv3
* @since 1.6.0
* @memberOf Monster.Types
* @param {string} name
......@@ -132,6 +138,7 @@ function getGlobalObject(name) {
* </script>
* ```
*
* @license AGPLv3
* @since 1.6.0
* @memberOf Monster.Types
* @param {string} name
......
/**
* @author schukai GmbH
* Copyright schukai GmbH and contributors 2022. All Rights Reserved.
* Node module: @schukai/monster
* This file is licensed under the AGPLv3 License.
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
*/
import {Base} from './base.mjs';
import {validateString} from "./validate.mjs";
......@@ -24,13 +28,14 @@ let internalCounter = new Map;
*
* ```
* <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/types/id.mjs';
* import {ID} from '@schukai/monster/source/types/id.mjs';
* console.log(new ID())
* </script>
* ```
*
* As of version 1.6.0 there is the new RandomID. this ID class is continuous from now on.
*
* @license AGPLv3
* @since 1.0.0
* @copyright schukai GmbH
* @memberOf Monster.Types
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment