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 58 deletions
......@@ -15,6 +15,7 @@ export {
* @private
* @type {symbol}
* @memberOf Monster
* @license AGPLv3
* @since 1.24.0
*/
const internalSymbol = Symbol('internalData');
......@@ -23,6 +24,7 @@ const internalSymbol = Symbol('internalData');
* @private
* @type {symbol}
* @memberOf Monster
* @license AGPLv3
* @since 1.25.0
*/
const internalStateSymbol = Symbol('state');
......
// 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
/**
* 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';
......@@ -16,6 +18,7 @@ export {AbstractConstraint}
*
* Derived classes must implement the method isValid().
*
* @license AGPLv3
* @since 1.3.0
* @copyright schukai GmbH
* @memberOf Monster.Constraints
......
/**
* @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 {AbstractConstraint} from "./abstract.mjs";
......@@ -15,6 +16,7 @@ export {AbstractOperator}
*
* Operators allow you to link constraints together. for example, you can check whether a value is an object or an array. each operator has two operands that are linked together.
*
* @license AGPLv3
* @since 1.3.0
* @copyright schukai GmbH
* @memberOf Monster.Constraints
......
/**
* @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 {AbstractOperator} from "./abstractoperator.mjs";
export {AndOperator}
......@@ -17,16 +21,16 @@ export {AndOperator}
*
* ```
* <script type="module">
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/andoperator.mjs';
* import {AndOperator} from '@schukai/monster/source/constraints/andoperator.mjs';
* new AndOperator();
* </script>
* ```
*
* @example
*
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/valid.mjs';
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/invalid.mjs';
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/andoperator.mjs';
* import {Valid} from '@schukai/monster/source/constraints/valid.mjs';
* import {Invalid} from '@schukai/monster/source/constraints/invalid.mjs';
* import {AndOperator} from '@schukai/monster/source/constraints/andoperator.mjs';
*
* new AndOperator(
* new Valid(), new Valid()).isValid()
......@@ -40,6 +44,7 @@ export {AndOperator}
* .catch(()=>console.log(false));
* // ↦ false
*
* @license AGPLv3
* @since 1.3.0
* @copyright schukai GmbH
* @memberOf Monster.Constraints
......
/**
* @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 {AbstractConstraint} from "./abstract.mjs";
export {Invalid}
......@@ -17,20 +21,21 @@ export {Invalid}
*
* ```
* <script type="module">
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/invalid.mjs';
* import {Invalid} from '@schukai/monster/source/constraints/invalid.mjs';
* new Invalid();
* </script>
* ```
*
* @example
*
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/invalid.mjs';
* import {Invalid} from '@schukai/monster/source/constraints/invalid.mjs';
*
* new Invalid().isValid()
* .then(()=>console.log(true))
* .catch(()=>console.log(false));
* // ↦ false
*
* @license AGPLv3
* @since 1.3.0
* @copyright schukai GmbH
* @memberOf Monster.Constraints
......
/**
* @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 {isArray} from "../types/is.mjs";
import {AbstractConstraint} from "./abstract.mjs";
......@@ -16,14 +20,14 @@ export {IsArray}
*
* ```
* <script type="module">
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/isarray.mjs';
* import {IsArray} from '@schukai/monster/source/constraints/isarray.mjs';
* console.log(new IsArray())
* </script>
* ```
*
* @example
*
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/isarray.mjs';
* import {IsArray} from '@schukai/monster/source/constraints/isarray.mjs';
*
* new IsArray()
* .isValid([])
......@@ -35,6 +39,7 @@ export {IsArray}
* .catch(e=>console.log(e));
* // ↦ 99
*
* @license AGPLv3
* @since 1.3.0
* @copyright schukai GmbH
* @memberOf Monster.Constraints
......
/**
* @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 {isObject} from "../types/is.mjs";
import {AbstractConstraint} from "./abstract.mjs";
......@@ -16,14 +20,14 @@ export {IsObject}
*
* ```
* <script type="module">
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/isobject.mjs';
* import {IsObject} from '@schukai/monster/source/constraints/isobject.mjs';
* console.log(new IsObject())
* </script>
* ```
*
* @example
*
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/isobject.mjs';
* import {IsObject} from '@schukai/monster/source/constraints/isobject.mjs';
*
* new IsObject()
* .isValid({})
......@@ -36,6 +40,7 @@ export {IsObject}
* .catch(e=>console.log(e));
* // ↦ 99
*
* @license AGPLv3
* @since 1.3.0
* @copyright schukai GmbH
* @memberOf Monster.Constraints
......
/**
* @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 {AbstractOperator} from "./abstractoperator.mjs";
export {OrOperator}
......@@ -17,16 +21,16 @@ export {OrOperator}
*
* ```
* <script type="module">
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraint/oroperator.mjs';
* import {OrOperator} from '@schukai/monster/source/constraint/oroperator.mjs';
* new OrOperator();
* </script>
* ```
*
* @example
*
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/valid.mjs';
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/invalid.mjs';
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/oroperator.mjs';
* import {Valid} from '@schukai/monster/source/constraints/valid.mjs';
* import {Invalid} from '@schukai/monster/source/constraints/invalid.mjs';
* import {OrOperator} from '@schukai/monster/source/constraints/oroperator.mjs';
*
* new OrOperator(
* new Valid(), new Invalid()).isValid()
......@@ -40,6 +44,7 @@ export {OrOperator}
* .catch(()=>console.log(false));
* // ↦ false
*
* @license AGPLv3
* @since 1.3.0
* @copyright schukai GmbH
* @memberOf Monster.Constraints
......
/**
* @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 {AbstractConstraint} from "./abstract.mjs";
export {Valid}
......@@ -17,20 +21,21 @@ export {Valid}
*
* ```
* <script type="module">
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/valid.mjs';
* import {Valid} from '@schukai/monster/source/constraints/valid.mjs';
* new Valid();
* </script>
* ```
*
* @example
*
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/constraints/valid.mjs';
* import {Valid} from '@schukai/monster/source/constraints/valid.mjs';
*
* new Valid().isValid()
* .then(()=>console.log(true))
* .catch(()=>console.log(false));
* // ↦ true
*
* @license AGPLv3
* @since 1.3.0
* @copyright schukai GmbH
* @memberOf Monster.Constraints
......
/**
* @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 {isFunction, isObject, isString} from "../types/is.mjs";
import {validateString} from "../types/validate.mjs";
import {clone} from "../util/clone.mjs";
......@@ -27,7 +31,7 @@ const PARENT = '^';
*
* ```
* <script type="module">
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/buildmap.mjs';
* import {buildMap} from '@schukai/monster/source/data/buildmap.mjs';
* console.log(buildMap())
* </script>
* ```
......@@ -38,7 +42,7 @@ const PARENT = '^';
*
* @example
*
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/buildmap.mjs';
* import {buildMap} from '@schukai/monster/source/data/buildmap.mjs';
* // a typical data structure as reported by an api
*
* let map;
......@@ -253,7 +257,7 @@ function buildFlatMap(subject, selector, key, parentMap) {
* Alternatively to a string selector a callback can be specified. this must return a map.
*
* @example
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/buildmap.mjs';
* import {buildMap} from '@schukai/monster/source/data/buildmap.mjs';
*
* let obj = {
* "data": [
......@@ -376,6 +380,7 @@ function buildFlatMap(subject, selector, key, parentMap) {
* @callback Monster.Data~exampleSelectorCallback
* @param {*} subject subject
* @return Map
* @license AGPLv3
* @since 1.17.0
* @memberOf Monster.Data
* @see {@link Monster.Data.buildMap}
......
/**
* @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 {isArray, isObject} from "../types/is.mjs";
import {Node} from "../types/node.mjs";
import {NodeList} from "../types/nodelist.mjs";
......@@ -37,7 +41,7 @@ const rootSymbol = Symbol('root');
*
* ```
* <script type="module">
* import {buildTree} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/buildtree.mjs';
* import {buildTree} from '@schukai/monster/source/data/buildtree.mjs';
* buildTree()
* </script>
* ```
......@@ -52,6 +56,7 @@ const rootSymbol = Symbol('root');
* @throws {TypeError} value is neither a string nor a function
* @throws {TypeError} the selector callback must return a map
* @throws {Error} the object has no value for the specified id
* @license AGPLv3
* @since 1.26.0
*/
function buildTree(subject, selector, idKey, parentIDKey, options) {
......
/**
* @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";
......@@ -20,6 +24,7 @@ export {Datasource}
* @private
* @type {symbol}
* @memberOf Monster.Data
* @license AGPLv3
* @since 1.24.0
*/
const internalDataSymbol = Symbol('internalData');
......@@ -30,14 +35,14 @@ const internalDataSymbol = Symbol('internalData');
*
* ```
* <script type="module">
* import {Datasource} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/datasource.mjs';
* import {Datasource} from '@schukai/monster/source/data/datasource.mjs';
* new Datasource()
* </script>
* ```
*
* @example
*
* import {Datasource} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/datasource.mjs'
* import {Datasource} from '@schukai/monster/source/data/datasource.mjs'
*
* class MyDatasource extends Datasource {
*
......@@ -45,6 +50,7 @@ const internalDataSymbol = Symbol('internalData');
*
* const ds = new MyDatasource();
*
* @license AGPLv3
* @since 1.22.0
* @copyright schukai GmbH
* @memberOf Monster.Data
......
/**
* @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 {isObject} from "../../types/is.mjs";
import {Datasource} from "../datasource.mjs";
......@@ -18,14 +22,14 @@ export {RestAPI}
*
* ```
* <script type="module">
* import {RestAPI} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/datasource/restapi.mjs';
* import {RestAPI} from '@schukai/monster/source/data/datasource/restapi.mjs';
* new RestAPI()
* </script>
* ```
*
* @example
*
* import {RestAPI} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/datasource/restapi.mjs';
* import {RestAPI} from '@schukai/monster/source/data/datasource/restapi.mjs';
*
* const ds = new RestAPI({
* url: 'https://httpbin.org/get'
......@@ -37,6 +41,7 @@ export {RestAPI}
* ds.write().then(()=>console.log('done'));
* ds.read().then(()=>console.log('done'));
*
* @license AGPLv3
* @since 1.22.0
* @copyright schukai GmbH
* @memberOf Monster.Data.Datasource
......
/**
* @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";
export {WriteError}
......@@ -11,6 +15,7 @@ export {WriteError}
/**
* Error message for API requests with extension of request and validation.
*
* @license AGPLv3
* @since 1.24.0
* @copyright schukai GmbH
* @memberOf Monster.Data.Datasource.RestAPI
......
/**
* @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 {validateString} from "../../types/validate.mjs";
import {Datasource} from "../datasource.mjs";
......@@ -21,17 +25,18 @@ const storageObjectSymbol = Symbol('storageObject');
*
* ```
* <script type="module">
* import {Storage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/datasource/storage.mjs';
* import {Storage} from '@schukai/monster/source/data/datasource/storage.mjs';
* new Storage()
* </script>
* ```
*
* @example
*
* import {Storage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/datasource/storage.mjs';
* import {Storage} from '@schukai/monster/source/data/datasource/storage.mjs';
*
* new Datasource();
*
* @license AGPLv3
* @since 1.22.0
* @copyright schukai GmbH
* @memberOf Monster.Data.Datasource
......
/**
* @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 {getGlobalObject} from "../../../types/global.mjs";
import {Datasource} from "../../datasource.mjs";
......@@ -16,11 +20,12 @@ export {LocalStorage}
*
* ```
* <script type="module">
* import {LocalStorage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/datasource/storage/localstorage.mjs';
* import {LocalStorage} from '@schukai/monster/source/data/datasource/storage/localstorage.mjs';
* new LocalStorage()
* </script>
* ```
*
* @license AGPLv3
* @since 1.22.0
* @copyright schukai GmbH
* @memberOf Monster.Data.Datasource.Storage
......
/**
* @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 {getGlobalObject} from "../../../types/global.mjs";
import {Datasource} from "../../datasource.mjs";
......@@ -16,11 +20,12 @@ export {SessionStorage}
*
* ```
* <script type="module">
* import {SessionStorage} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/datasource/storage/sessionstorage.mjs';
* import {SessionStorage} from '@schukai/monster/source/data/datasource/storage/sessionstorage.mjs';
* new SessionStorage()
* </script>
* ```
*
* @license AGPLv3
* @since 1.22.0
* @copyright schukai GmbH
* @memberOf Monster.Data.Datasource.Storage
......
/**
* @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 {isArray, isObject} from "../types/is.mjs";
import {typeOf} from "../types/typeof.mjs";
......@@ -17,14 +21,14 @@ export {diff}
*
* ```
* <script type="module">
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/diff.mjs';
* import {Diff} from '@schukai/monster/source/data/diff.mjs';
* Diff(a, b)
* </script>
* ```
*
* @example
*
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/diff.mjs';
* import {Diff} from '@schukai/monster/source/data/diff.mjs';
*
* // given are two objects x and y.
*
......@@ -67,6 +71,7 @@ export {diff}
* @param {*} first
* @param {*} second
* @return {array}
* @license AGPLv3
* @since 1.6.0
* @copyright schukai GmbH
* @memberOf Monster.Data
......
/**
* @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 {isArray, isObject} from "../types/is.mjs";
import {typeOf} from "../types/typeof.mjs";
......@@ -15,7 +19,7 @@ export {extend}
*
* ```
* <script type="module">
* import {extend} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/extend.mjs';
* import {extend} from '@schukai/monster/source/data/extend.mjs';
* extend(a, b)
* </script>
* ```
......@@ -23,6 +27,7 @@ export {extend}
* @param {object} target
* @param {object}
* @return {object}
* @license AGPLv3
* @since 1.10.0
* @copyright schukai GmbH
* @memberOf Monster.Data
......
/**
* @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 {isArray, isInteger, isObject, isPrimitive} from '../types/is.mjs';
import {Stack} from "../types/stack.mjs";
......@@ -30,7 +34,7 @@ const WILDCARD = '*';
*
* ```
* <script type="module">
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/pathfinder.mjs';
* import {Pathfinder} from '@schukai/monster/source/data/pathfinder.mjs';
* console.log(new Pathfinder())
* </script>
* ```
......@@ -72,7 +76,7 @@ const WILDCARD = '*';
*
* @example
*
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/pathfinder.mjs';
* import {Pathfinder} from '@schukai/monster/source/data/pathfinder.mjs';
*
* let value = new Pathfinder({
* a: {
......@@ -98,7 +102,7 @@ const WILDCARD = '*';
*
* @example
*
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@latest/source/data/pathfinder.mjs';
* import {Pathfinder} from '@schukai/monster/source/data/pathfinder.mjs';
*
* let p = new Pathfinder({
* a: {
......@@ -118,6 +122,7 @@ const WILDCARD = '*';
* let r = p.getVia("*.x.*.c");
* console.log(r);
*
* @license AGPLv3
* @since 1.4.0
* @copyright schukai GmbH
* @memberOf Monster.Data
......@@ -435,6 +440,7 @@ function assignProperty(object, key, value) {
* @throws {TypeError} unsupported type
* @throws {Error} the journey is not at its end
* @throws {Error} unsupported action for this data type
* @license AGPLv3
* @since 1.6.0
* @private
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment