Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1.31
  • master
  • 1.10.0
  • 1.30.1
  • 1.31.0
  • 1.8.0
  • 1.9.0
  • 3.100.0
  • 3.100.1
  • 3.100.10
  • 3.100.11
  • 3.100.12
  • 3.100.13
  • 3.100.14
  • 3.100.15
  • 3.100.16
  • 3.100.17
  • 3.100.18
  • 3.100.19
  • 3.100.2
  • 3.100.20
  • 3.100.3
  • 3.100.4
  • 3.100.5
  • 3.100.6
  • 3.100.7
  • 3.100.8
  • 3.100.9
  • 3.101.0
  • 3.101.1
  • 3.101.2
  • 3.101.3
  • 3.102.0
  • 3.102.1
  • 3.102.2
  • 3.102.3
  • 3.102.4
  • 3.102.5
  • 3.102.6
  • 3.103.0
  • 3.103.1
  • 3.104.0
  • 3.104.1
  • 3.105.0
  • 3.105.1
  • 3.105.2
  • 3.106.0
  • 3.106.1
  • 3.107.0
  • 3.108.0
  • 3.108.1
  • 3.108.2
  • 3.108.3
  • 3.108.4
  • 3.108.5
  • 3.109.0
  • 3.110.0
  • 3.110.1
  • 3.110.2
  • 3.110.3
  • 3.110.4
  • 3.111.0
  • 3.112.0
  • 3.112.1
  • 3.112.2
  • 3.112.3
  • 3.112.4
  • 3.113.0
  • 3.114.0
  • 3.114.1
  • 3.114.2
  • 3.114.3
  • 3.114.4
  • 3.114.5
  • 3.114.6
  • 3.114.7
  • 3.115.0
  • 3.115.1
  • 3.115.2
  • 3.115.3
  • 3.115.4
  • 3.116.0
  • 3.116.1
  • 3.117.0
  • 3.117.1
  • 3.117.2
  • 3.117.3
  • 3.118.0
  • 3.118.1
  • 3.119.0
  • 3.120.0
  • 3.121.0
  • 3.51.5
  • 3.52.0
  • 3.52.1
  • 3.53.0
  • 3.54.0
  • 3.55.0
  • 3.55.1
  • 3.55.2
  • 3.55.3
  • 3.55.4
102 results

Target

Select target project
  • oss/libraries/javascript/monster
1 result
Select Git revision
  • 1.31
  • master
  • 1.10.0
  • 1.30.1
  • 1.31.0
  • 1.8.0
  • 1.9.0
  • 3.100.0
  • 3.100.1
  • 3.100.10
  • 3.100.11
  • 3.100.12
  • 3.100.13
  • 3.100.14
  • 3.100.15
  • 3.100.16
  • 3.100.17
  • 3.100.18
  • 3.100.19
  • 3.100.2
  • 3.100.20
  • 3.100.3
  • 3.100.4
  • 3.100.5
  • 3.100.6
  • 3.100.7
  • 3.100.8
  • 3.100.9
  • 3.101.0
  • 3.101.1
  • 3.101.2
  • 3.101.3
  • 3.102.0
  • 3.102.1
  • 3.102.2
  • 3.102.3
  • 3.102.4
  • 3.102.5
  • 3.102.6
  • 3.103.0
  • 3.103.1
  • 3.104.0
  • 3.104.1
  • 3.105.0
  • 3.105.1
  • 3.105.2
  • 3.106.0
  • 3.106.1
  • 3.107.0
  • 3.108.0
  • 3.108.1
  • 3.108.2
  • 3.108.3
  • 3.108.4
  • 3.108.5
  • 3.109.0
  • 3.110.0
  • 3.110.1
  • 3.110.2
  • 3.110.3
  • 3.110.4
  • 3.111.0
  • 3.112.0
  • 3.112.1
  • 3.112.2
  • 3.112.3
  • 3.112.4
  • 3.113.0
  • 3.114.0
  • 3.114.1
  • 3.114.2
  • 3.114.3
  • 3.114.4
  • 3.114.5
  • 3.114.6
  • 3.114.7
  • 3.115.0
  • 3.115.1
  • 3.115.2
  • 3.115.3
  • 3.115.4
  • 3.116.0
  • 3.116.1
  • 3.117.0
  • 3.117.1
  • 3.117.2
  • 3.117.3
  • 3.118.0
  • 3.118.1
  • 3.119.0
  • 3.120.0
  • 3.121.0
  • 3.51.5
  • 3.52.0
  • 3.52.1
  • 3.53.0
  • 3.54.0
  • 3.55.0
  • 3.55.1
  • 3.55.2
  • 3.55.3
  • 3.55.4
102 results
Show changes
...@@ -65,12 +65,6 @@ describe('DOM', function () { ...@@ -65,12 +65,6 @@ describe('DOM', function () {
mocks.innerHTML = ""; mocks.innerHTML = "";
}) })
describe('Updater()', function () {
describe('Example code', function () {
})
})
describe('Updater()', function () { describe('Updater()', function () {
describe('test Errors', function () { describe('test Errors', function () {
...@@ -78,10 +72,10 @@ describe('DOM', function () { ...@@ -78,10 +72,10 @@ describe('DOM', function () {
expect(() => new Updater()).to.throw(TypeError) expect(() => new Updater()).to.throw(TypeError)
}) })
it('should throw value is not an instance of HTMLElement Error', function () { it('should throw value is wrong', function () {
let element = document.getElementById('test1') let element = document.getElementById('test1')
expect(() => new Updater(element)).to.throw(TypeError) expect(() => new Updater(element,null)).to.throw(TypeError)
}) })
it('should throw Error: the value is not iterable', function (done) { it('should throw Error: the value is not iterable', function (done) {
......
...@@ -7,7 +7,7 @@ describe('Monster', function () { ...@@ -7,7 +7,7 @@ describe('Monster', function () {
let monsterVersion let monsterVersion
/**#@+ dont touch, replaced by make with package.json version */ /**#@+ dont touch, replaced by make with package.json version */
monsterVersion = new Version('1.8.0') monsterVersion = new Version('1.9.0')
/**#@-*/ /**#@-*/
let m = Monster.getVersion(); let m = Monster.getVersion();
......
...@@ -8,7 +8,8 @@ import { ...@@ -8,7 +8,8 @@ import {
isInstance, isInstance,
isFunction, isFunction,
isIterable, isIterable,
isInteger isInteger,
isSymbol
} from "../../../source/types/is.js"; } from "../../../source/types/is.js";
...@@ -50,6 +51,34 @@ describe('Is', function () { ...@@ -50,6 +51,34 @@ describe('Is', function () {
}); });
});
describe('.isSymbol()', function () {
[
['test1', false],
[undefined, false],
[null, false],
[() => {
}, false],
[2, false],
[parseInt("a"), false],
[false, false],
[true, false],
[4.5, false],
[{}, false],
[[1, 2, 3], false],
[Symbol("foo"), true],
].forEach(function (data) {
let a = data.shift()
let b = data.shift()
it('is.isSymbol(' + typeof a + ') should return ' + b, function () {
expect(isSymbol(a)).is.equal(b)
});
});
}); });
describe('.isInteger()', function () { describe('.isInteger()', function () {
......
...@@ -8,7 +8,8 @@ import { ...@@ -8,7 +8,8 @@ import {
validateFunction, validateFunction,
validateInteger, validateInteger,
validateInstance, validateInstance,
validateIterable validateIterable,
validateSymbol
} from "../../../source/types/validate.js" } from "../../../source/types/validate.js"
import {Base} from "../../../source/types/base.js" import {Base} from "../../../source/types/base.js"
...@@ -90,6 +91,43 @@ describe('validate', function () { ...@@ -90,6 +91,43 @@ describe('validate', function () {
}); });
});
describe('.validateSymbol()', function () {
[
['test1', false],
[undefined, false],
[null, false],
[() => {
}, false],
[2, false],
[false, false],
[true, false],
[4.5, false],
[{}, false],
[[1, 2, 3], false],
[Symbol("foo"), true],
].forEach(function (data) {
let a = data.shift()
let b = data.shift()
if (b === false) {
it('.validateSymbol(' + typeof a + ') should throw TypeException ' + b, function () {
expect(() => validateSymbol(a)).to.throw(TypeError);
});
} else {
it('.validateSymbol(' + typeof a + ') should not throw TypeException ' + b, function () {
expect(validateSymbol(a)).to.be.equal(a);
});
}
});
}); });
describe('.validateIterable()', function () { describe('.validateIterable()', function () {
......
...@@ -5,6 +5,7 @@ import "../cases/logging/handler.js"; ...@@ -5,6 +5,7 @@ import "../cases/logging/handler.js";
import "../cases/logging/logentry.js"; import "../cases/logging/logentry.js";
import "../cases/dom/handle.js"; import "../cases/dom/handle.js";
import "../cases/dom/updater.js"; import "../cases/dom/updater.js";
import "../cases/dom/attributes.js";
import "../cases/dom/template.js"; import "../cases/dom/template.js";
import "../cases/dom/util.js"; import "../cases/dom/util.js";
import "../cases/dom/assembler.js"; import "../cases/dom/assembler.js";
......
...@@ -4802,7 +4802,7 @@ Object.defineProperty(exports, 'CryptoKey', { ...@@ -4802,7 +4802,7 @@ Object.defineProperty(exports, 'CryptoKey', {
exports.Crypto = Crypto; exports.Crypto = Crypto;
   
}).call(this)}).call(this,require("buffer").Buffer) }).call(this)}).call(this,require("buffer").Buffer)
},{"@peculiar/asn1-schema":36,"@peculiar/json-schema":45,"buffer":128,"crypto":173,"process":1212,"pvtsutils":989,"tslib":1059,"webcrypto-core":1078}],47:[function(require,module,exports){ },{"@peculiar/asn1-schema":36,"@peculiar/json-schema":45,"buffer":128,"crypto":173,"process":1214,"pvtsutils":989,"tslib":1059,"webcrypto-core":1078}],47:[function(require,module,exports){
"use strict"; "use strict";
function noop() { } function noop() { }
function once(emitter, name) { function once(emitter, name) {
...@@ -220990,7 +220990,7 @@ exports.AbstractConstraint = AbstractConstraint; ...@@ -220990,7 +220990,7 @@ exports.AbstractConstraint = AbstractConstraint;
   
_namespace.Monster.assignToNamespace('Monster.Constraints', AbstractConstraint); _namespace.Monster.assignToNamespace('Monster.Constraints', AbstractConstraint);
   
},{"../namespace.js":1151,"../types/base.js":1152,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1127:[function(require,module,exports){ },{"../namespace.js":1152,"../types/base.js":1153,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1127:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -221105,7 +221105,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221105,7 +221105,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/andoperator.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/andoperator.js';
* new Monster.Constraint.AndOperator(); * new Monster.Constraint.AndOperator();
* </script> * </script>
* ``` * ```
...@@ -221114,16 +221114,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221114,16 +221114,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/andoperator.js'; * import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/andoperator.js';
* new AndOperator(); * new AndOperator();
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/valid.js'; * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/valid.js';
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/invalid.js'; * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/invalid.js';
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/andoperator.js'; * import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/andoperator.js';
* *
* new AndOperator( * new AndOperator(
* new Valid(), new Valid()).isValid() * new Valid(), new Valid()).isValid()
...@@ -221213,7 +221213,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221213,7 +221213,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/invalid.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/invalid.js';
* new Monster.Constraint.Invalid(); * new Monster.Constraint.Invalid();
* </script> * </script>
* ``` * ```
...@@ -221222,14 +221222,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221222,14 +221222,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/invalid.js'; * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/invalid.js';
* new Invalid(); * new Invalid();
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/invalid.js'; * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/invalid.js';
* *
* new Invalid().isValid() * new Invalid().isValid()
* .then(()=>console.log(true)) * .then(()=>console.log(true))
...@@ -221312,7 +221312,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221312,7 +221312,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/isarray.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/isarray.js';
* console.log(new Monster.Constraint.IsArray()) * console.log(new Monster.Constraint.IsArray())
* </script> * </script>
* ``` * ```
...@@ -221321,14 +221321,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221321,14 +221321,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/isarray.js'; * import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/isarray.js';
* console.log(new IsArray()) * console.log(new IsArray())
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/isarray.js'; * import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/isarray.js';
* *
* new IsArray() * new IsArray()
* .isValid([]) * .isValid([])
...@@ -221378,7 +221378,7 @@ exports.IsArray = IsArray; ...@@ -221378,7 +221378,7 @@ exports.IsArray = IsArray;
   
_abstract.Monster.assignToNamespace('Monster.Constraints', IsArray); _abstract.Monster.assignToNamespace('Monster.Constraints', IsArray);
   
},{"../types/is.js":1155,"./abstract.js":1126,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1131:[function(require,module,exports){ },{"../types/is.js":1156,"./abstract.js":1126,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1131:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -221420,7 +221420,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221420,7 +221420,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/isobject.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/isobject.js';
* console.log(new Monster.Constraint.IsObject()) * console.log(new Monster.Constraint.IsObject())
* </script> * </script>
* ``` * ```
...@@ -221429,14 +221429,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221429,14 +221429,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/isobject.js'; * import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/isobject.js';
* console.log(new IsObject()) * console.log(new IsObject())
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/isobject.js'; * import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/isobject.js';
* *
* new IsObject() * new IsObject()
* .isValid({}) * .isValid({})
...@@ -221487,7 +221487,7 @@ exports.IsObject = IsObject; ...@@ -221487,7 +221487,7 @@ exports.IsObject = IsObject;
   
_abstract.Monster.assignToNamespace('Monster.Constraints', IsObject); _abstract.Monster.assignToNamespace('Monster.Constraints', IsObject);
   
},{"../types/is.js":1155,"./abstract.js":1126,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1132:[function(require,module,exports){ },{"../types/is.js":1156,"./abstract.js":1126,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1132:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -221527,7 +221527,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221527,7 +221527,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraint/oroperator.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraint/oroperator.js';
* new Monster.Constraint.OrOperator(); * new Monster.Constraint.OrOperator();
* </script> * </script>
* ``` * ```
...@@ -221536,16 +221536,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221536,16 +221536,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraint/oroperator.js'; * import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraint/oroperator.js';
* new OrOperator(); * new OrOperator();
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/valid.js'; * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/valid.js';
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/invalid.js'; * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/invalid.js';
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/oroperator.js'; * import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/oroperator.js';
* *
* new OrOperator( * new OrOperator(
* new Valid(), new Invalid()).isValid() * new Valid(), new Invalid()).isValid()
...@@ -221658,7 +221658,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221658,7 +221658,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/valid.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/valid.js';
* new Monster.Constraint.Valid(); * new Monster.Constraint.Valid();
* </script> * </script>
* ``` * ```
...@@ -221667,14 +221667,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -221667,14 +221667,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/valid.js'; * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/valid.js';
* new Valid(); * new Valid();
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/valid.js'; * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/constraints/valid.js';
* *
* new Valid().isValid() * new Valid().isValid()
* .then(()=>console.log(true)) * .then(()=>console.log(true))
...@@ -221762,7 +221762,7 @@ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return ...@@ -221762,7 +221762,7 @@ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/buildmap.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/buildmap.js';
* console.log(Monster.Data.buildMap()) * console.log(Monster.Data.buildMap())
* </script> * </script>
* ``` * ```
...@@ -221771,7 +221771,7 @@ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return ...@@ -221771,7 +221771,7 @@ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/buildmap.js'; * import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/buildmap.js';
* console.log(buildMap()) * console.log(buildMap())
* </script> * </script>
* ``` * ```
...@@ -221911,7 +221911,7 @@ function build(subject, definition, defaultValue) { ...@@ -221911,7 +221911,7 @@ function build(subject, definition, defaultValue) {
   
_namespace.Monster.assignToNamespace('Monster.Data', buildMap); _namespace.Monster.assignToNamespace('Monster.Data', buildMap);
   
},{"../namespace.js":1151,"../types/is.js":1155,"../types/validate.js":1165,"./pathfinder.js":1136,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/setPrototypeOf":20,"@babel/runtime/helpers/toConsumableArray":23,"@babel/runtime/helpers/typeof":24}],1135:[function(require,module,exports){ },{"../namespace.js":1152,"../types/is.js":1156,"../types/validate.js":1166,"./pathfinder.js":1136,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/setPrototypeOf":20,"@babel/runtime/helpers/toConsumableArray":23,"@babel/runtime/helpers/typeof":24}],1135:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -221943,7 +221943,7 @@ var _is = require("../types/is.js"); ...@@ -221943,7 +221943,7 @@ var _is = require("../types/is.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/diff.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/diff.js';
* console.log(Monster.Data.Diff(a, b)) * console.log(Monster.Data.Diff(a, b))
* </script> * </script>
* ``` * ```
...@@ -221952,14 +221952,14 @@ var _is = require("../types/is.js"); ...@@ -221952,14 +221952,14 @@ var _is = require("../types/is.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/diff.js'; * import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/diff.js';
* console.log(Diff(a, b)) * console.log(Diff(a, b))
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/diff.js'; * import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/diff.js';
* *
* // given are two objects x and y. * // given are two objects x and y.
* *
...@@ -222175,7 +222175,7 @@ function getOperator(a, b) { ...@@ -222175,7 +222175,7 @@ function getOperator(a, b) {
   
_is.Monster.assignToNamespace('Monster.Data', Diff); _is.Monster.assignToNamespace('Monster.Data', Diff);
   
},{"../types/is.js":1155,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1136:[function(require,module,exports){ },{"../types/is.js":1156,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1136:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -222242,7 +222242,7 @@ var WILDCARD = '*'; ...@@ -222242,7 +222242,7 @@ var WILDCARD = '*';
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/pathfinder.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/pathfinder.js';
* console.log(new Monster.Data.Pathfinder()) * console.log(new Monster.Data.Pathfinder())
* </script> * </script>
* ``` * ```
...@@ -222251,7 +222251,7 @@ var WILDCARD = '*'; ...@@ -222251,7 +222251,7 @@ var WILDCARD = '*';
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/pathfinder.js'; * import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/pathfinder.js';
* console.log(new Pathfinder()) * console.log(new Pathfinder())
* </script> * </script>
* ``` * ```
...@@ -222293,7 +222293,7 @@ var WILDCARD = '*'; ...@@ -222293,7 +222293,7 @@ var WILDCARD = '*';
* *
* @example * @example
* *
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/pathfinder.js'; * import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/pathfinder.js';
* *
* let value = new Pathfinder({ * let value = new Pathfinder({
* a: { * a: {
...@@ -222319,7 +222319,7 @@ var WILDCARD = '*'; ...@@ -222319,7 +222319,7 @@ var WILDCARD = '*';
* *
* @example * @example
* *
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/pathfinder.js'; * import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/pathfinder.js';
* *
* let p = new Pathfinder({ * let p = new Pathfinder({
* a: { * a: {
...@@ -222663,7 +222663,7 @@ function deleteValueViaPath(object, path) { ...@@ -222663,7 +222663,7 @@ function deleteValueViaPath(object, path) {
return; return;
} }
   
},{"../namespace.js":1151,"../types/base.js":1152,"../types/is.js":1155,"../types/stack.js":1161,"../types/validate.js":1165,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/slicedToArray":21,"@babel/runtime/helpers/toConsumableArray":23,"@babel/runtime/helpers/typeof":24}],1137:[function(require,module,exports){ },{"../namespace.js":1152,"../types/base.js":1153,"../types/is.js":1156,"../types/stack.js":1162,"../types/validate.js":1166,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/slicedToArray":21,"@babel/runtime/helpers/toConsumableArray":23,"@babel/runtime/helpers/typeof":24}],1137:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -222714,7 +222714,7 @@ var DELIMITER = '|'; ...@@ -222714,7 +222714,7 @@ var DELIMITER = '|';
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/pipe.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/pipe.js';
* console.log(new Monster.Data.Pipe()) * console.log(new Monster.Data.Pipe())
* </script> * </script>
* ``` * ```
...@@ -222723,7 +222723,7 @@ var DELIMITER = '|'; ...@@ -222723,7 +222723,7 @@ var DELIMITER = '|';
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/pipe.js'; * import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/pipe.js';
* console.log(new Pipe()) * console.log(new Pipe())
* </script> * </script>
* ``` * ```
...@@ -222734,7 +222734,7 @@ var DELIMITER = '|'; ...@@ -222734,7 +222734,7 @@ var DELIMITER = '|';
* the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char. * the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char.
* *
* @example * @example
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/pipe.js'; * import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/pipe.js';
* *
* let obj = { * let obj = {
* a: { * a: {
...@@ -222779,6 +222779,7 @@ var Pipe = /*#__PURE__*/function (_Base) { ...@@ -222779,6 +222779,7 @@ var Pipe = /*#__PURE__*/function (_Base) {
* *
* @param {string} name * @param {string} name
* @param {function} callback * @param {function} callback
* @param {object} context
* @returns {Transformer} * @returns {Transformer}
* @throws {TypeError} value is not a string * @throws {TypeError} value is not a string
* @throws {TypeError} value is not a function * @throws {TypeError} value is not a function
...@@ -222787,17 +222788,15 @@ var Pipe = /*#__PURE__*/function (_Base) { ...@@ -222787,17 +222788,15 @@ var Pipe = /*#__PURE__*/function (_Base) {
   
(0, _createClass2["default"])(Pipe, [{ (0, _createClass2["default"])(Pipe, [{
key: "setCallback", key: "setCallback",
value: function setCallback(name, callback) { value: function setCallback(name, callback, context) {
for (var _i = 0, _Object$entries = Object.entries(this.pipe); _i < _Object$entries.length; _i++) { for (var _i = 0, _Object$entries = Object.entries(this.pipe); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2), var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
t = _Object$entries$_i[1]; t = _Object$entries$_i[1];
   
t.setCallback(name, callback); t.setCallback(name, callback, context);
} }
   
return this; // return this.pipe.reduce((accumulator, transformer, currentIndex, array) => { return this;
// return transformer.setCallback(name,callback);
// }, value);
} }
/** /**
* run a pipe * run a pipe
...@@ -222821,7 +222820,7 @@ exports.Pipe = Pipe; ...@@ -222821,7 +222820,7 @@ exports.Pipe = Pipe;
   
_namespace.Monster.assignToNamespace('Monster.Data', Pipe); _namespace.Monster.assignToNamespace('Monster.Data', Pipe);
   
},{"../namespace.js":1151,"../types/base.js":1152,"../types/validate.js":1165,"./transformer.js":1138,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/slicedToArray":21}],1138:[function(require,module,exports){ },{"../namespace.js":1152,"../types/base.js":1153,"../types/validate.js":1166,"./transformer.js":1138,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/slicedToArray":21}],1138:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -222862,6 +222861,8 @@ var _namespace = require("../namespace.js"); ...@@ -222862,6 +222861,8 @@ var _namespace = require("../namespace.js");
   
var _base = require("../types/base.js"); var _base = require("../types/base.js");
   
var _global = require("../types/global.js");
var _validate = require("../types/validate.js"); var _validate = require("../types/validate.js");
   
var _is = require("../types/is.js"); var _is = require("../types/is.js");
...@@ -222891,7 +222892,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -222891,7 +222892,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/transformer.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/transformer.js';
* console.log(new Monster.Data.Transformer()) * console.log(new Monster.Data.Transformer())
* </script> * </script>
* ``` * ```
...@@ -222900,7 +222901,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -222900,7 +222901,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/transformer.js'; * import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/transformer.js';
* console.log(new Transformer()) * console.log(new Transformer())
* </script> * </script>
* ``` * ```
...@@ -222977,7 +222978,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -222977,7 +222978,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* @example * @example
* *
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/data/transformer.js'; * import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/data/transformer.js';
* *
* const transformer = new Transformer("tolower") * const transformer = new Transformer("tolower")
* *
...@@ -223015,6 +223016,7 @@ var Transformer = /*#__PURE__*/function (_Base) { ...@@ -223015,6 +223016,7 @@ var Transformer = /*#__PURE__*/function (_Base) {
* *
* @param {string} name * @param {string} name
* @param {function} callback * @param {function} callback
* @param {object} context
* @returns {Transformer} * @returns {Transformer}
* @throws {TypeError} value is not a string * @throws {TypeError} value is not a string
* @throws {TypeError} value is not a function * @throws {TypeError} value is not a function
...@@ -223023,10 +223025,18 @@ var Transformer = /*#__PURE__*/function (_Base) { ...@@ -223023,10 +223025,18 @@ var Transformer = /*#__PURE__*/function (_Base) {
   
(0, _createClass2["default"])(Transformer, [{ (0, _createClass2["default"])(Transformer, [{
key: "setCallback", key: "setCallback",
value: function setCallback(name, callback) { value: function setCallback(name, callback, context) {
(0, _validate.validateString)(name); (0, _validate.validateString)(name);
(0, _validate.validateFunction)(callback); (0, _validate.validateFunction)(callback);
this.callbacks.set(name, callback);
if (context !== undefined) {
(0, _validate.validateObject)(context);
}
this.callbacks.set(name, {
callback: callback,
context: context
});
return this; return this;
} }
/** /**
...@@ -223148,6 +223158,8 @@ function convertToString(value) { ...@@ -223148,6 +223158,8 @@ function convertToString(value) {
   
   
function transform(value) { function transform(value) {
var _callback;
var args = (0, _clone.clone)(this.args); var args = (0, _clone.clone)(this.args);
var key; var key;
   
...@@ -223195,18 +223207,21 @@ function transform(value) { ...@@ -223195,18 +223207,21 @@ function transform(value) {
*/ */
var callback; var callback;
var callbackName = args.shift(); var callbackName = args.shift();
var context = (0, _global.getGlobal)();
   
if ((0, _is.isObject)(value) && value.hasOwnProperty(callbackName)) { if ((0, _is.isObject)(value) && value.hasOwnProperty(callbackName)) {
callback = value[callbackName]; callback = value[callbackName];
} else if (this.callbacks.has(callbackName)) { } else if (this.callbacks.has(callbackName)) {
callback = this.callbacks.get(callbackName); var s = this.callbacks.get(callbackName);
callback = s === null || s === void 0 ? void 0 : s['callback'];
context = s === null || s === void 0 ? void 0 : s['context'];
} else if ((typeof window === "undefined" ? "undefined" : (0, _typeof2["default"])(window)) === 'object' && window.hasOwnProperty(callbackName)) { } else if ((typeof window === "undefined" ? "undefined" : (0, _typeof2["default"])(window)) === 'object' && window.hasOwnProperty(callbackName)) {
callback = window[callbackName]; callback = window[callbackName];
} }
   
(0, _validate.validateFunction)(callback); (0, _validate.validateFunction)(callback);
args.unshift(value); args.unshift(value);
return callback.apply(void 0, (0, _toConsumableArray2["default"])(args)); return (_callback = callback).call.apply(_callback, [context].concat((0, _toConsumableArray2["default"])(args)));
   
case 'plain': case 'plain':
case 'plaintext': case 'plaintext':
...@@ -223325,7 +223340,7 @@ function transform(value) { ...@@ -223325,7 +223340,7 @@ function transform(value) {
return value; return value;
} }
   
},{"../namespace.js":1151,"../types/base.js":1152,"../types/id.js":1154,"../types/is.js":1155,"../types/validate.js":1165,"../util/clone.js":1167,"./pathfinder.js":1136,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/setPrototypeOf":20,"@babel/runtime/helpers/toConsumableArray":23,"@babel/runtime/helpers/typeof":24}],1139:[function(require,module,exports){ },{"../namespace.js":1152,"../types/base.js":1153,"../types/global.js":1154,"../types/id.js":1155,"../types/is.js":1156,"../types/validate.js":1166,"../util/clone.js":1168,"./pathfinder.js":1136,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/setPrototypeOf":20,"@babel/runtime/helpers/toConsumableArray":23,"@babel/runtime/helpers/typeof":24}],1139:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -223378,7 +223393,7 @@ var ATTRIBUTEPREFIX = "data-monster-"; ...@@ -223378,7 +223393,7 @@ var ATTRIBUTEPREFIX = "data-monster-";
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/assembler.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/assembler.js';
* console.log(new Monster.DOM.Assembler()) * console.log(new Monster.DOM.Assembler())
* </script> * </script>
* ``` * ```
...@@ -223387,7 +223402,7 @@ var ATTRIBUTEPREFIX = "data-monster-"; ...@@ -223387,7 +223402,7 @@ var ATTRIBUTEPREFIX = "data-monster-";
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/assembler.js'; * import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/assembler.js';
* console.log(new Assembler()) * console.log(new Assembler())
* </script> * </script>
* ``` * ```
...@@ -223471,7 +223486,472 @@ exports.Assembler = Assembler; ...@@ -223471,7 +223486,472 @@ exports.Assembler = Assembler;
   
_base.Monster.assignToNamespace('Monster.DOM', Assembler); _base.Monster.assignToNamespace('Monster.DOM', Assembler);
   
},{"../types/base.js":1152,"../types/global.js":1153,"../types/proxyobserver.js":1158,"../types/validate.js":1165,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1140:[function(require,module,exports){ },{"../types/base.js":1153,"../types/global.js":1154,"../types/proxyobserver.js":1159,"../types/validate.js":1166,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1140:[function(require,module,exports){
'use strict';
/**
* @author schukai GmbH
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addToObjectLink = addToObjectLink;
exports.removeObjectLink = removeObjectLink;
exports.hasObjectLink = hasObjectLink;
exports.clearAttributeTokens = clearAttributeTokens;
exports.replaceAttributeToken = replaceAttributeToken;
exports.containsAttributeToken = containsAttributeToken;
exports.removeAttributeToken = removeAttributeToken;
exports.addAttributeToken = addAttributeToken;
exports.toggleAttributeToken = toggleAttributeToken;
exports.getLinkedObjects = getLinkedObjects;
Object.defineProperty(exports, "Monster", {
enumerable: true,
get: function get() {
return _namespace.Monster;
}
});
var _namespace = require("../namespace.js");
var _tokenlist = require("../types/tokenlist.js");
var _validate = require("../types/validate.js");
var _constants = require("./constants.js");
/**
* You can call the method via the monster namespace `new Monster.DOM.addToObjectLink()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.addToObjectLink();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {addToObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* addToObjectLink();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {Symbol} symbol
* @param {Object} object
* @return {boolean}
*/
function addToObjectLink(element, symbol, object) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateSymbol)(symbol);
if ((element === null || element === void 0 ? void 0 : element[symbol]) === undefined) {
element[symbol] = new Set();
}
addAttributeToken(element, _constants.ATTRIBUTE_OBJECTLINK, symbol.toString());
element[symbol].add(object);
return element;
}
/**
* You can call the method via the monster namespace `new Monster.DOM.removeObjectLink()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.removeObjectLink();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {removeObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* removeObjectLink();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {Symbol} symbol
* @return {boolean}
*/
function removeObjectLink(element, symbol) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateSymbol)(symbol);
if ((element === null || element === void 0 ? void 0 : element[symbol]) === undefined) {
return element;
}
removeAttributeToken(element, _constants.ATTRIBUTE_OBJECTLINK, symbol.toString());
delete element[symbol];
return element;
}
/**
* You can call the method via the monster namespace `new Monster.DOM.hasObjectLink()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.hasObjectLink();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {hasObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* hasObjectLink();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {Symbol} symbol
* @return {boolean}
*/
function hasObjectLink(element, symbol) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateSymbol)(symbol);
if ((element === null || element === void 0 ? void 0 : element[symbol]) === undefined) {
return false;
}
return containsAttributeToken(element, _constants.ATTRIBUTE_OBJECTLINK, symbol.toString());
}
/**
* The ObjectLink can be used to attach objects to HTMLElements. The elements are kept in a set under a unique
* symbol and can be read via an iterator {@see getLinkedObjects}.
*
* In addition, elements with an objectLink receive the attribute `data-monster-objectlink`.
*
* With the method {@see addToObjectLink} the objects can be added.
*
* You can call the method via the monster namespace `new Monster.DOM.getLinkedObjects()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.getLinkedObjects();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {getLinkedObjects} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* getLinkedObjects();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {Symbol} symbol
* @return {Iterator}
* @throws {Error} there is no object link for symbol
*/
function getLinkedObjects(element, symbol) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateSymbol)(symbol);
if ((element === null || element === void 0 ? void 0 : element[symbol]) === undefined) {
throw new Error('there is no object link for ' + symbol.toString());
}
return element === null || element === void 0 ? void 0 : element[symbol][Symbol.iterator]();
}
/**
* With this method tokens in an attribute can be switched on or off. For example, classes can be switched on and off in the elements class attribute.
*
* Tokens are always separated by a space.
*
* You can call the method via the monster namespace `new Monster.DOM.toggleAttributeToken()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.toggleAttributeToken();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {toggleAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* toggleAttributeToken();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {string} key
* @param {string} token
* @return {HTMLElement}
*/
function toggleAttributeToken(element, key, token) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateString)(token);
(0, _validate.validateString)(key);
if (!element.hasAttribute(key)) {
element.setAttribute(key, token);
return element;
}
element.setAttribute(key, new _tokenlist.TokenList(element.getAttribute(key)).toggle(token).toString());
return element;
}
/**
* this method can be used to add a token to an attribute. Tokens are always separated by a space.
*
* You can call the method via the monster namespace `new Monster.DOM.addAttributeToken()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.addAttributeToken();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {addAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* addAttributeToken();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {string} key
* @param {string} token
* @return {HTMLElement}
*/
function addAttributeToken(element, key, token) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateString)(token);
(0, _validate.validateString)(key);
if (!element.hasAttribute(key)) {
element.setAttribute(key, token);
return element;
}
element.setAttribute(key, new _tokenlist.TokenList(element.getAttribute(key)).add(token).toString());
return element;
}
/**
* This function can be used to remove tokens from an attribute.
*
* Tokens are always separated by a space.
*
* You can call the method via the monster namespace `new Monster.DOM.removeAttributeToken()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.removeAttributeToken();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {removeAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* removeAttributeToken();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {string} key
* @param {string} token
* @return {HTMLElement}
*/
function removeAttributeToken(element, key, token) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateString)(token);
(0, _validate.validateString)(key);
if (!element.hasAttribute(key)) {
return element;
}
element.setAttribute(key, new _tokenlist.TokenList(element.getAttribute(key)).remove(token).toString());
return element;
}
/**
* This method can be used to determine whether an attribute has a token.
*
* Tokens are always separated by a space.
*
* You can call the method via the monster namespace `new Monster.DOM.containsAttributeToken()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.containsAttributeToken();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {containsAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* containsAttributeToken();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {string} key
* @param {string} token
* @return {boolean}
*/
function containsAttributeToken(element, key, token) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateString)(token);
(0, _validate.validateString)(key);
if (!element.hasAttribute(key)) {
return false;
}
return new _tokenlist.TokenList(element.getAttribute(key)).contains(token);
}
/**
* Tokens are always separated by a space.
*
* You can call the method via the monster namespace `new Monster.DOM.replaceAttributeToken()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.replaceAttributeToken();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {replaceAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* replaceAttributeToken();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {string} key
* @param {string} from
* @param {string} to
* @return {HTMLElement}
*/
function replaceAttributeToken(element, key, from, to) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateString)(from);
(0, _validate.validateString)(to);
(0, _validate.validateString)(key);
if (!element.hasAttribute(key)) {
return element;
}
element.setAttribute(key, new _tokenlist.TokenList(element.getAttribute(key)).replace(from, to).toString());
return element;
}
/**
* Tokens are always separated by a space.
*
* You can call the method via the monster namespace `new Monster.DOM.clearAttributeTokens()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* Monster.DOM.clearAttributeTokens();
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {clearAttributeTokens} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/attributes.js';
* clearAttributeTokens();
* </script>
* ```
*
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/DOM
* @param {HTMLElement} element
* @param {string} key
* @return {HTMLElement}
*/
function clearAttributeTokens(element, key) {
(0, _validate.validateInstance)(element, HTMLElement);
(0, _validate.validateString)(key);
if (!element.hasAttribute(key)) {
return element;
}
element.setAttribute(key, "");
return element;
}
_namespace.Monster.assignToNamespace('Monster.DOM', getLinkedObjects, addToObjectLink, removeObjectLink, hasObjectLink, clearAttributeTokens, replaceAttributeToken, containsAttributeToken, removeAttributeToken, addAttributeToken, toggleAttributeToken);
},{"../namespace.js":1152,"../types/tokenlist.js":1163,"../types/validate.js":1166,"./constants.js":1141}],1141:[function(require,module,exports){
'use strict'; 'use strict';
   
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
...@@ -223483,7 +223963,7 @@ Object.defineProperty(exports, "Monster", { ...@@ -223483,7 +223963,7 @@ Object.defineProperty(exports, "Monster", {
return _namespace.Monster; return _namespace.Monster;
} }
}); });
exports.ATTRIBUTE_UPDATER_REMOVE = exports.ATTRIBUTE_UPDATER_INSERT_REFERENCE = exports.ATTRIBUTE_UPDATER_INSERT = exports.ATTRIBUTE_UPDATER_REPLACE = exports.ATTRIBUTE_UPDATER_ATTRIBUTES = exports.ATTRIBUTE_THEME_NAME = exports.ATTRIBUTE_THEME_PREFIX = exports.DEFAULT_THEME = exports.ATTRIBUTE_OPTIONS = exports.ATTRIBUTE_PREFIX = void 0; exports.ATTRIBUTE_OBJECTLINK = exports.ATTRIBUTE_UPDATER_BIND = exports.ATTRIBUTE_UPDATER_REMOVE = exports.ATTRIBUTE_UPDATER_INSERT_REFERENCE = exports.ATTRIBUTE_UPDATER_INSERT = exports.ATTRIBUTE_UPDATER_REPLACE = exports.ATTRIBUTE_UPDATER_ATTRIBUTES = exports.ATTRIBUTE_THEME_NAME = exports.ATTRIBUTE_THEME_PREFIX = exports.DEFAULT_THEME = exports.ATTRIBUTE_OPTIONS = exports.ATTRIBUTE_PREFIX = void 0;
   
var _namespace = require("../namespace.js"); var _namespace = require("../namespace.js");
   
...@@ -223568,9 +224048,25 @@ var ATTRIBUTE_UPDATER_INSERT_REFERENCE = ATTRIBUTE_PREFIX + 'insert-reference'; ...@@ -223568,9 +224048,25 @@ var ATTRIBUTE_UPDATER_INSERT_REFERENCE = ATTRIBUTE_PREFIX + 'insert-reference';
   
exports.ATTRIBUTE_UPDATER_INSERT_REFERENCE = ATTRIBUTE_UPDATER_INSERT_REFERENCE; exports.ATTRIBUTE_UPDATER_INSERT_REFERENCE = ATTRIBUTE_UPDATER_INSERT_REFERENCE;
var ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_PREFIX + 'remove'; var ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_PREFIX + 'remove';
/**
* @memberOf Monster/DOM
* @type {string}
* @since 1.9.0
*/
exports.ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_UPDATER_REMOVE; exports.ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_UPDATER_REMOVE;
var ATTRIBUTE_UPDATER_BIND = ATTRIBUTE_PREFIX + 'bind';
/**
* @memberOf Monster/DOM
* @type {string}
* @since 1.9.0
*/
exports.ATTRIBUTE_UPDATER_BIND = ATTRIBUTE_UPDATER_BIND;
var ATTRIBUTE_OBJECTLINK = ATTRIBUTE_PREFIX + 'objectlink';
exports.ATTRIBUTE_OBJECTLINK = ATTRIBUTE_OBJECTLINK;
   
},{"../namespace.js":1151}],1141:[function(require,module,exports){ },{"../namespace.js":1152}],1142:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -223626,7 +224122,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -223626,7 +224122,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {CustomElement} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/customelement.js'; * import {CustomElement} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/customelement.js';
* console.log(new Monster.DOM.CustomElement()) * console.log(new Monster.DOM.CustomElement())
* </script> * </script>
* ``` * ```
...@@ -223635,7 +224131,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -223635,7 +224131,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {CustomElement} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/customelement.js'; * import {CustomElement} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/customelement.js';
* console.log(new CustomElement()) * console.log(new CustomElement())
* </script> * </script>
* ``` * ```
...@@ -223958,7 +224454,7 @@ function registerCustomElement(element) { ...@@ -223958,7 +224454,7 @@ function registerCustomElement(element) {
   
_validate.Monster.assignToNamespace('Monster.DOM', CustomElement, registerCustomElement); _validate.Monster.assignToNamespace('Monster.DOM', CustomElement, registerCustomElement);
   
},{"../types/global.js":1153,"../types/validate.js":1165,"./constants.js":1140,"./template.js":1143,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/wrapNativeSuper":26}],1142:[function(require,module,exports){ },{"../types/global.js":1154,"../types/validate.js":1166,"./constants.js":1141,"./template.js":1144,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/wrapNativeSuper":26}],1143:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -224028,7 +224524,7 @@ var MONSTERDOMHANDLE = Symbol('MonsterHandle'); ...@@ -224028,7 +224524,7 @@ var MONSTERDOMHANDLE = Symbol('MonsterHandle');
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/handle.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/handle.js';
* console.log(new Monster.DOM.Handle()) * console.log(new Monster.DOM.Handle())
* </script> * </script>
* ``` * ```
...@@ -224037,14 +224533,14 @@ var MONSTERDOMHANDLE = Symbol('MonsterHandle'); ...@@ -224037,14 +224533,14 @@ var MONSTERDOMHANDLE = Symbol('MonsterHandle');
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Handle} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/handle.js'; * import {Handle} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/handle.js';
* console.log(new Handle()) * console.log(new Handle())
* </script> * </script>
* ``` * ```
* *
* @since 1.6.0 * @since 1.6.0
* @copyright schukai GmbH * @copyright schukai GmbH
* @memberOf Monster.DOM * @memberOf Monster/DOM
*/ */
   
var Handle = /*#__PURE__*/function (_Base) { var Handle = /*#__PURE__*/function (_Base) {
...@@ -224202,7 +224698,7 @@ function createMutationObserver() { ...@@ -224202,7 +224698,7 @@ function createMutationObserver() {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/handle.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/handle.js';
* console.log(Monster.DOM.getHandleFromNode()) * console.log(Monster.DOM.getHandleFromNode())
* </script> * </script>
* ``` * ```
...@@ -224211,7 +224707,7 @@ function createMutationObserver() { ...@@ -224211,7 +224707,7 @@ function createMutationObserver() {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {getHandleFromNode} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/handle.js'; * import {getHandleFromNode} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/handle.js';
* console.log(getHandleFromNode()) * console.log(getHandleFromNode())
* </script> * </script>
* ``` * ```
...@@ -224244,7 +224740,7 @@ function getHandleFromNode(node) { ...@@ -224244,7 +224740,7 @@ function getHandleFromNode(node) {
   
_base.Monster.assignToNamespace('Monster.DOM', getHandleFromNode, Handle); _base.Monster.assignToNamespace('Monster.DOM', getHandleFromNode, Handle);
   
},{"../types/base.js":1152,"../types/global.js":1153,"../types/id.js":1154,"../types/is.js":1155,"../types/observer.js":1156,"../types/proxyobserver.js":1158,"../types/stack.js":1161,"../types/validate.js":1165,"./assembler.js":1139,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1143:[function(require,module,exports){ },{"../types/base.js":1153,"../types/global.js":1154,"../types/id.js":1155,"../types/is.js":1156,"../types/observer.js":1157,"../types/proxyobserver.js":1159,"../types/stack.js":1162,"../types/validate.js":1166,"./assembler.js":1139,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1144:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -224291,7 +224787,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -224291,7 +224787,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/template.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/template.js';
* console.log(new Monster.DOM.Template()) * console.log(new Monster.DOM.Template())
* </script> * </script>
* ``` * ```
...@@ -224300,7 +224796,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -224300,7 +224796,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Template} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/template.js'; * import {Template} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/template.js';
* console.log(new Template()) * console.log(new Template())
* </script> * </script>
* ``` * ```
...@@ -224363,7 +224859,7 @@ var Template = /*#__PURE__*/function (_Base) { ...@@ -224363,7 +224859,7 @@ var Template = /*#__PURE__*/function (_Base) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/template.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/template.js';
* console.log(Monster.DOM.findDocumentTemplate()) * console.log(Monster.DOM.findDocumentTemplate())
* </script> * </script>
* ``` * ```
...@@ -224372,7 +224868,7 @@ var Template = /*#__PURE__*/function (_Base) { ...@@ -224372,7 +224868,7 @@ var Template = /*#__PURE__*/function (_Base) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {findTemplate} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/template.js'; * import {findTemplate} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/template.js';
* console.log(findDocumentTemplate()) * console.log(findDocumentTemplate())
* </script> * </script>
* ``` * ```
...@@ -224412,7 +224908,7 @@ function findDocumentTemplate(id) { ...@@ -224412,7 +224908,7 @@ function findDocumentTemplate(id) {
   
_base.Monster.assignToNamespace('Monster.DOM', Template, findDocumentTemplate); _base.Monster.assignToNamespace('Monster.DOM', Template, findDocumentTemplate);
   
},{"../types/base.js":1152,"../types/global.js":1153,"../types/validate.js":1165,"./theme.js":1144,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1144:[function(require,module,exports){ },{"../types/base.js":1153,"../types/global.js":1154,"../types/validate.js":1166,"./theme.js":1145,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1145:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -224459,7 +224955,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -224459,7 +224955,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/theme.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/theme.js';
* console.log(new Monster.DOM.Theme()) * console.log(new Monster.DOM.Theme())
* </script> * </script>
* ``` * ```
...@@ -224468,14 +224964,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -224468,14 +224964,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Theme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/theme.js'; * import {Theme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/theme.js';
* console.log(new Theme()) * console.log(new Theme())
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {getDocumentTheme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/theme.js'; * import {getDocumentTheme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/theme.js';
* *
* const theme = getDocumentTheme(); * const theme = getDocumentTheme();
* console.log(theme.getName()); * console.log(theme.getName());
...@@ -224555,7 +225051,7 @@ function getDocumentTheme() { ...@@ -224555,7 +225051,7 @@ function getDocumentTheme() {
   
_base.Monster.assignToNamespace('Monster.DOM', Theme, getDocumentTheme); _base.Monster.assignToNamespace('Monster.DOM', Theme, getDocumentTheme);
   
},{"../types/base.js":1152,"../types/global.js":1153,"../types/validate.js":1165,"./constants.js":1140,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1145:[function(require,module,exports){ },{"../types/base.js":1153,"../types/global.js":1154,"../types/validate.js":1166,"./constants.js":1141,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1146:[function(require,module,exports){
'use strict'; 'use strict';
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -224585,10 +225081,14 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime ...@@ -224585,10 +225081,14 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
   
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
   
var _pathfinder = require("../data/pathfinder.js");
var _pipe = require("../data/pipe.js"); var _pipe = require("../data/pipe.js");
   
var _base = require("../types/base.js"); var _base = require("../types/base.js");
   
var _global = require("../types/global.js");
var _is = require("../types/is.js"); var _is = require("../types/is.js");
   
var _observer = require("../types/observer.js"); var _observer = require("../types/observer.js");
...@@ -224620,11 +225120,15 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -224620,11 +225120,15 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
*/ */
   
/** /**
* The updater class connects an object with the dom. in this way, structures and contents in the DOM can be programmatically adapted via attributes.
*
* For example, to include a string from an object, the attribute `data-monster-replace` can be used.
*
* you can call the method via the monster namespace `new Monster.DOM.Updater()`. * you can call the method via the monster namespace `new Monster.DOM.Updater()`.
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/updater.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/updater.js';
* console.log(new Monster.DOM.Updater()) * console.log(new Monster.DOM.Updater())
* </script> * </script>
* ``` * ```
...@@ -224633,14 +225137,36 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -224633,14 +225137,36 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/updater.js'; * import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/updater.js';
* console.log(new Updater()) * console.log(new Updater())
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/updater.js';
* *
* // First we prepare the html document.
* // This is done here via script, but can also be inserted into the document as pure html.
* // To do this, simply insert the tag <h1 data-monster-replace="path:headline"></h1>.
* const body = document.querySelector('body');
* const headline = document.createElement('h1');
* headline.setAttribute('data-monster-replace','path:headline')
* body.appendChild(headline);
*
* // the data structure
* let obj = {
* headline: "Hello World",
* };
*
* // Now comes the real magic. we pass the updater the parent HTMLElement
* // and the desired data structure.
* const updater = new Updater(body, obj);
* updater.run();
*
* // Now you can change the data structure and the HTML will follow these changes.
* const subject = updater.getSubject();
* subject['headline'] = "Hello World!"
* *
* @since 1.8.0 * @since 1.8.0
* @copyright schukai GmbH * @copyright schukai GmbH
...@@ -224648,6 +225174,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -224648,6 +225174,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* @throws {Error} the value is not iterable * @throws {Error} the value is not iterable
* @throws {Error} pipes are not allowed when cloning a node. * @throws {Error} pipes are not allowed when cloning a node.
* @throws {Error} no template was found with the specified key. * @throws {Error} no template was found with the specified key.
* @throws {Error} the maximum depth for the recursion is reached.
* @throws {TypeError} value is not a object
* @throws {TypeError} value is not an instance of HTMLElement
*/ */
var Updater = /*#__PURE__*/function (_Base) { var Updater = /*#__PURE__*/function (_Base) {
(0, _inherits2["default"])(Updater, _Base); (0, _inherits2["default"])(Updater, _Base);
...@@ -224657,7 +225186,9 @@ var Updater = /*#__PURE__*/function (_Base) { ...@@ -224657,7 +225186,9 @@ var Updater = /*#__PURE__*/function (_Base) {
/** /**
* @since 1.8.0 * @since 1.8.0
* @param {HTMLElement} element * @param {HTMLElement} element
* @param {object|ProxyObserver} subject * @param {object|ProxyObserver|undefined} subject
* @throws {TypeError} value is not a object
* @throws {TypeError} value is not an instance of HTMLElement
*/ */
function Updater(element, subject) { function Updater(element, subject) {
var _this; var _this;
...@@ -224669,6 +225200,7 @@ var Updater = /*#__PURE__*/function (_Base) { ...@@ -224669,6 +225200,7 @@ var Updater = /*#__PURE__*/function (_Base) {
*/ */
   
_this.element = (0, _validate.validateInstance)(element, HTMLElement); _this.element = (0, _validate.validateInstance)(element, HTMLElement);
if (subject === undefined) subject = {};
   
if (!(0, _is.isInstance)(subject, _proxyobserver.ProxyObserver)) { if (!(0, _is.isInstance)(subject, _proxyobserver.ProxyObserver)) {
subject = new _proxyobserver.ProxyObserver(subject); subject = new _proxyobserver.ProxyObserver(subject);
...@@ -224676,10 +225208,13 @@ var Updater = /*#__PURE__*/function (_Base) { ...@@ -224676,10 +225208,13 @@ var Updater = /*#__PURE__*/function (_Base) {
   
_this.last = {}; _this.last = {};
_this.callbacks = new Map(); _this.callbacks = new Map();
_this.callbacks.set('checkstate', getCheckStateCallback.call((0, _assertThisInitialized2["default"])(_this)));
/** /**
* @type {object} * @type {object}
*/ */
   
_this.subject = subject.attachObserver(new _observer.Observer(function () { _this.subject = subject.attachObserver(new _observer.Observer(function () {
var s = _this.subject.getRealSubject(); var s = _this.subject.getRealSubject();
   
...@@ -224696,21 +225231,100 @@ var Updater = /*#__PURE__*/function (_Base) { ...@@ -224696,21 +225231,100 @@ var Updater = /*#__PURE__*/function (_Base) {
updateAttributes.call((0, _assertThisInitialized2["default"])(_this), change); updateAttributes.call((0, _assertThisInitialized2["default"])(_this), change);
} }
})); }));
_this.eventTypes = ['keyup', 'click', 'change', 'drop', 'touchend'];
return _this; return _this;
} }
/** /**
* *
* @return {Promise} * @see https://developer.mozilla.org/de/docs/Web/Events
* @since 1.9.0
* @param {Array} types
* @return {Updater}
*/ */
   
   
(0, _createClass2["default"])(Updater, [{ (0, _createClass2["default"])(Updater, [{
key: "setEventTypes",
value: function setEventTypes(types) {
this.eventTypes = validateArray(types);
return this;
}
/**
*
* @since 1.9.0
* @return {Updater}
*/
}, {
key: "enableEventProcessing",
value: function enableEventProcessing() {
this.disableEventProcessing();
var _iterator = _createForOfIteratorHelper(this.eventTypes),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var type = _step.value;
this.element.addEventListener(type, getControlEventHandler.call(this));
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return this;
}
/**
*
* @since 1.9.0
* @return {Updater}
*/
}, {
key: "disableEventProcessing",
value: function disableEventProcessing() {
var _iterator2 = _createForOfIteratorHelper(this.eventTypes),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var type = _step2.value;
this.element.removeEventListener(type, getControlEventHandler.call(this));
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
return this;
}
/**
* Let the magic begin
*
* The run method must be called for the update to start working.
*
* @return {Promise}
*/
}, {
key: "run", key: "run",
value: function run() { value: function run() {
this.last = {}; // the key __init__has no further meaning and is only
// used to create the diff for empty objects.
this.last = {
'__init__': true
};
return this.subject.notifyObservers(); return this.subject.notifyObservers();
} }
/** /**
* If you have passed a ProxyObserver in the constructor, you will get the same object here.
* However, if you have passed a simple object, you will get the ProxyObserver here.
*
* For changes the ProxyObserver must be used.
*
* @since 1.8.0 * @since 1.8.0
* @return {ProxyObserver} * @return {ProxyObserver}
*/ */
...@@ -224721,6 +225335,8 @@ var Updater = /*#__PURE__*/function (_Base) { ...@@ -224721,6 +225335,8 @@ var Updater = /*#__PURE__*/function (_Base) {
return this.subject.getSubject(); return this.subject.getSubject();
} }
/** /**
* This method can be used to register commands that can be called via call: instruction.
* This can be used to provide a pipe with its own functionality.
* *
* @param {string} name * @param {string} name
* @param {function} callback * @param {function} callback
...@@ -224738,6 +225354,108 @@ var Updater = /*#__PURE__*/function (_Base) { ...@@ -224738,6 +225354,108 @@ var Updater = /*#__PURE__*/function (_Base) {
}]); }]);
return Updater; return Updater;
}(_base.Base); }(_base.Base);
/**
* @private
* @since 1.9.0
* @return {function}
*/
exports.Updater = Updater;
function getCheckStateCallback() {
var self = this;
return function (current) {
if (this instanceof HTMLInputElement) {
if (['radio', 'checkbox'].indexOf(this.type) !== -1) {
return this.value + "" === current + "" ? 'true' : undefined;
}
} else if (this instanceof HTMLOptionElement) {
if ((0, _is.isArray)(current) && current.indexOf(this.value) !== -1) {
return 'true';
}
return undefined;
}
};
}
/**
* @private
*/
var symbol = Symbol('EventHandler');
/**
* @private
* @return {function}
*/
function getControlEventHandler() {
var self = this;
if (self[symbol]) {
return self[symbol];
}
var pathfinder = new _pathfinder.Pathfinder(this.subject.getSubject());
self[symbol] = function (event) {
var element = event.target;
if (!element.hasAttribute(_constants.ATTRIBUTE_UPDATER_BIND)) {
return;
}
var path = element.getAttribute(_constants.ATTRIBUTE_UPDATER_BIND);
if (path.indexOf('path:') !== 0) {
throw new Error();
}
path = path.substr(5);
var value;
if (element instanceof HTMLInputElement) {
switch (element.type) {
case 'checkbox':
value = element.checked ? element.value : undefined;
break;
default:
value = element.value;
break;
}
} else if (element instanceof HTMLSelectElement) {
switch (element.type) {
case 'select-one':
value = element.value;
break;
case 'select-multiple':
value = element.value;
var options = element.querySelectorAll(":scope option:checked");
value = Array.from(options).map(function (_ref) {
var value = _ref.value;
return value;
});
break;
}
} else {
throw new Error();
}
var copy = (0, _clone.clone)(self.subject.getRealSubject());
var pf = new _pathfinder.Pathfinder(copy);
pf.setVia(path, value);
var diff = new _diff.Diff(copy, self.subject.getRealSubject());
if (diff.length > 0) {
pathfinder.setVia(path, value);
}
};
return self[symbol];
}
/** /**
* @private * @private
* @since 1.8.0 * @since 1.8.0
...@@ -224746,23 +225464,21 @@ var Updater = /*#__PURE__*/function (_Base) { ...@@ -224746,23 +225464,21 @@ var Updater = /*#__PURE__*/function (_Base) {
*/ */
   
   
exports.Updater = Updater;
function removeElement(change) { function removeElement(change) {
var _iterator = _createForOfIteratorHelper(this.element.querySelectorAll(':scope [' + _constants.ATTRIBUTE_UPDATER_REMOVE + ']').entries()), var _iterator3 = _createForOfIteratorHelper(this.element.querySelectorAll(':scope [' + _constants.ATTRIBUTE_UPDATER_REMOVE + ']').entries()),
_step; _step3;
   
try { try {
for (_iterator.s(); !(_step = _iterator.n()).done;) { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var _step$value = (0, _slicedToArray2["default"])(_step.value, 2), var _step3$value = (0, _slicedToArray2["default"])(_step3.value, 2),
element = _step$value[1]; element = _step3$value[1];
   
element.parentNode.removeChild(element); element.parentNode.removeChild(element);
} }
} catch (err) { } catch (err) {
_iterator.e(err); _iterator3.e(err);
} finally { } finally {
_iterator.f(); _iterator3.f();
} }
   
return this; return this;
...@@ -224775,6 +225491,7 @@ function removeElement(change) { ...@@ -224775,6 +225491,7 @@ function removeElement(change) {
* @throws {Error} the value is not iterable * @throws {Error} the value is not iterable
* @throws {Error} pipes are not allowed when cloning a node. * @throws {Error} pipes are not allowed when cloning a node.
* @throws {Error} no template was found with the specified key. * @throws {Error} no template was found with the specified key.
* @throws {Error} the maximum depth for the recursion is reached.
*/ */
   
   
...@@ -224784,23 +225501,30 @@ function insertElement(change) { ...@@ -224784,23 +225501,30 @@ function insertElement(change) {
var self = this; var self = this;
var subject = self.subject.getRealSubject(); var subject = self.subject.getRealSubject();
var document = (0, _util.getDocument)(); var document = (0, _util.getDocument)();
var mem = new WeakSet();
var wd = 0;
while (true) {
var found = false;
wd++;
var p = (0, _clone.clone)(change === null || change === void 0 ? void 0 : change['path']); var p = (0, _clone.clone)(change === null || change === void 0 ? void 0 : change['path']);
if (!(0, _is.isArray)(p)) return this; if (!(0, _is.isArray)(p)) return this;
var mem = new WeakSet();
   
while (p.length > 0) { while (p.length > 0) {
var current = p.join('.'); var current = p.join('.');
var list = this.element.querySelectorAll(':scope [' + _constants.ATTRIBUTE_UPDATER_INSERT + '*="path:' + current + '"]').entries();
   
var _iterator2 = _createForOfIteratorHelper(this.element.querySelectorAll(':scope [' + _constants.ATTRIBUTE_UPDATER_INSERT + '*="path:' + current + '"]').entries()), var _iterator4 = _createForOfIteratorHelper(list),
_step2; _step4;
   
try { try {
var _loop = function _loop() { var _loop = function _loop() {
var _step2$value = (0, _slicedToArray2["default"])(_step2.value, 2), var _step4$value = (0, _slicedToArray2["default"])(_step4.value, 2),
containerElement = _step2$value[1]; containerElement = _step4$value[1];
   
if (mem.has(containerElement)) return "continue"; if (mem.has(containerElement)) return "continue";
mem.add(containerElement); mem.add(containerElement);
found = true;
var attributes = containerElement.getAttribute(_constants.ATTRIBUTE_UPDATER_INSERT); var attributes = containerElement.getAttribute(_constants.ATTRIBUTE_UPDATER_INSERT);
var def = attributes.trim(); var def = attributes.trim();
var i = def.indexOf(' '); var i = def.indexOf(' ');
...@@ -224862,19 +225586,26 @@ function insertElement(change) { ...@@ -224862,19 +225586,26 @@ function insertElement(change) {
} }
}; };
   
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
var _ret = _loop(); var _ret = _loop();
   
if (_ret === "continue") continue; if (_ret === "continue") continue;
} }
} catch (err) { } catch (err) {
_iterator2.e(err); _iterator4.e(err);
} finally { } finally {
_iterator2.f(); _iterator4.f();
} }
   
p.pop(); p.pop();
} }
if (found === false) break;
if (wd++ > 200) {
throw new Error('the maximum depth for the recursion is reached.');
}
}
} }
/** /**
* *
...@@ -224903,9 +225634,12 @@ function appendNewDocumentFragment(container, key, ref, path) { ...@@ -224903,9 +225634,12 @@ function appendNewDocumentFragment(container, key, ref, path) {
   
if (node instanceof HTMLElement) { if (node instanceof HTMLElement) {
node.setAttribute(_constants.ATTRIBUTE_UPDATER_INSERT_REFERENCE, ref); node.setAttribute(_constants.ATTRIBUTE_UPDATER_INSERT_REFERENCE, ref);
if (node.hasAttribute(_constants.ATTRIBUTE_UPDATER_REPLACE)) {
var value = node.getAttribute(_constants.ATTRIBUTE_UPDATER_REPLACE); var value = node.getAttribute(_constants.ATTRIBUTE_UPDATER_REPLACE);
node.setAttribute(_constants.ATTRIBUTE_UPDATER_REPLACE, value.replace("path:" + key, "path:" + path)); node.setAttribute(_constants.ATTRIBUTE_UPDATER_REPLACE, value.replace("path:" + key, "path:" + path));
} }
}
   
container.appendChild(node); container.appendChild(node);
} }
...@@ -224926,7 +225660,6 @@ function updateContent(change) { ...@@ -224926,7 +225660,6 @@ function updateContent(change) {
return this; return this;
} }
/** /**
*
* @private * @private
* @since 1.8.0 * @since 1.8.0
* @param {HTMLElement} container * @param {HTMLElement} container
...@@ -224945,15 +225678,15 @@ function runUpdateContent(container, parts, subject) { ...@@ -224945,15 +225678,15 @@ function runUpdateContent(container, parts, subject) {
   
while (parts.length > 0) { while (parts.length > 0) {
var current = parts.join('.'); var current = parts.join('.');
parts.pop(); parts.pop(); // Unfortunately, static data is always changed as well, since it is not possible to react to changes here.
   
var _iterator3 = _createForOfIteratorHelper(container.querySelectorAll(':scope [' + _constants.ATTRIBUTE_UPDATER_REPLACE + '^="path:' + current + '"]').entries()), var _iterator5 = _createForOfIteratorHelper(container.querySelectorAll(':scope [' + _constants.ATTRIBUTE_UPDATER_REPLACE + '^="path:' + current + '"], [' + _constants.ATTRIBUTE_UPDATER_REPLACE + '^="static:"]').entries()),
_step3; _step5;
   
try { try {
var _loop2 = function _loop2() { var _loop2 = function _loop2() {
var _step3$value = (0, _slicedToArray2["default"])(_step3.value, 2), var _step5$value = (0, _slicedToArray2["default"])(_step5.value, 2),
element = _step3$value[1]; element = _step5$value[1];
   
if (mem.has(element)) return "continue"; if (mem.has(element)) return "continue";
mem.add(element); mem.add(element);
...@@ -224978,15 +225711,15 @@ function runUpdateContent(container, parts, subject) { ...@@ -224978,15 +225711,15 @@ function runUpdateContent(container, parts, subject) {
} }
}; };
   
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
var _ret2 = _loop2(); var _ret2 = _loop2();
   
if (_ret2 === "continue") continue; if (_ret2 === "continue") continue;
} }
} catch (err) { } catch (err) {
_iterator3.e(err); _iterator5.e(err);
} finally { } finally {
_iterator3.f(); _iterator5.f();
} }
} }
} }
...@@ -225000,10 +225733,9 @@ function runUpdateContent(container, parts, subject) { ...@@ -225000,10 +225733,9 @@ function runUpdateContent(container, parts, subject) {
   
   
function updateAttributes(change) { function updateAttributes(change) {
var self = this; var subject = this.subject.getRealSubject();
var subject = self.subject.getRealSubject();
var p = (0, _clone.clone)(change === null || change === void 0 ? void 0 : change['path']); var p = (0, _clone.clone)(change === null || change === void 0 ? void 0 : change['path']);
runUpdateAttributes(this.element, p, subject); runUpdateAttributes.call(this, this.element, p, subject);
return this; return this;
} }
/** /**
...@@ -225016,6 +225748,9 @@ function updateAttributes(change) { ...@@ -225016,6 +225748,9 @@ function updateAttributes(change) {
   
   
function runUpdateAttributes(container, parts, subject) { function runUpdateAttributes(container, parts, subject) {
var _this4 = this;
var self = this;
if (!(0, _is.isArray)(parts)) return; if (!(0, _is.isArray)(parts)) return;
parts = (0, _clone.clone)(parts); parts = (0, _clone.clone)(parts);
var mem = new WeakSet(); var mem = new WeakSet();
...@@ -225024,19 +225759,19 @@ function runUpdateAttributes(container, parts, subject) { ...@@ -225024,19 +225759,19 @@ function runUpdateAttributes(container, parts, subject) {
var current = parts.join('.'); var current = parts.join('.');
parts.pop(); parts.pop();
   
var _iterator4 = _createForOfIteratorHelper(container.querySelectorAll(':scope [' + _constants.ATTRIBUTE_UPDATER_ATTRIBUTES + '*="path:' + current + '"]').entries()), var _iterator6 = _createForOfIteratorHelper(container.querySelectorAll(':scope [' + _constants.ATTRIBUTE_UPDATER_ATTRIBUTES + '*="path:' + current + '"]').entries()),
_step4; _step6;
   
try { try {
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { var _loop3 = function _loop3() {
var _step4$value = (0, _slicedToArray2["default"])(_step4.value, 2), var _step6$value = (0, _slicedToArray2["default"])(_step6.value, 2),
element = _step4$value[1]; element = _step6$value[1];
   
if (mem.has(element)) continue; if (mem.has(element)) return "continue";
mem.add(element); mem.add(element);
var attributes = element.getAttribute(_constants.ATTRIBUTE_UPDATER_ATTRIBUTES); var attributes = element.getAttribute(_constants.ATTRIBUTE_UPDATER_ATTRIBUTES);
   
for (var _i6 = 0, _Object$entries5 = Object.entries(attributes.split(',')); _i6 < _Object$entries5.length; _i6++) { var _loop4 = function _loop4() {
var _Object$entries5$_i = (0, _slicedToArray2["default"])(_Object$entries5[_i6], 2), var _Object$entries5$_i = (0, _slicedToArray2["default"])(_Object$entries5[_i6], 2),
def = _Object$entries5$_i[1]; def = _Object$entries5$_i[1];
   
...@@ -225044,24 +225779,83 @@ function runUpdateAttributes(container, parts, subject) { ...@@ -225044,24 +225779,83 @@ function runUpdateAttributes(container, parts, subject) {
var i = def.indexOf(' '); var i = def.indexOf(' ');
var name = def.substr(0, i).trim(); var name = def.substr(0, i).trim();
var cmd = def.substr(i).trim(); var cmd = def.substr(i).trim();
var value = new _pipe.Pipe(cmd).run(subject); var pipe = new _pipe.Pipe(cmd);
self.callbacks.forEach(function (f, n) {
pipe.setCallback(n, f, element);
});
var value = pipe.run(subject);
   
if (element.getAttribute(name) !== value) { if (value === undefined) {
element.removeAttribute(name);
} else if (element.getAttribute(name) !== value) {
element.setAttribute(name, value); element.setAttribute(name, value);
} }
handleInputControlAttributeUpdate.call(_this4, element, name, value);
};
for (var _i6 = 0, _Object$entries5 = Object.entries(attributes.split(',')); _i6 < _Object$entries5.length; _i6++) {
_loop4();
} }
};
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
var _ret3 = _loop3();
if (_ret3 === "continue") continue;
} }
} catch (err) { } catch (err) {
_iterator4.e(err); _iterator6.e(err);
} finally { } finally {
_iterator4.f(); _iterator6.f();
}
}
}
/**
* @private
* @param element
* @param name
* @param value
*/
function handleInputControlAttributeUpdate(element, name, value) {
var self = this;
if (element instanceof HTMLElement) {
switch (element.type) {
case 'text':
if (name === 'value') {
element.value = value === undefined ? "" : value;
}
break;
case 'radio':
if (name === 'checked' && value !== undefined) {
element.checked = true;
} else {
element.checked = false;
}
break;
case 'checkbox':
break;
default:
if (name === 'value' && value !== undefined) {
element.value = value;
}
break;
} }
} }
} }
   
_base.Monster.assignToNamespace('Monster.DOM', Updater); _base.Monster.assignToNamespace('Monster.DOM', Updater);
   
},{"../data/diff.js":1135,"../data/pipe.js":1137,"../dom/constants.js":1140,"../types/base.js":1152,"../types/is.js":1155,"../types/observer.js":1156,"../types/proxyobserver.js":1158,"../types/validate.js":1165,"../util/clone.js":1167,"./util.js":1146,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/slicedToArray":21}],1146:[function(require,module,exports){ },{"../data/diff.js":1135,"../data/pathfinder.js":1136,"../data/pipe.js":1137,"../dom/constants.js":1141,"../types/base.js":1153,"../types/global.js":1154,"../types/is.js":1156,"../types/observer.js":1157,"../types/proxyobserver.js":1159,"../types/validate.js":1166,"../util/clone.js":1168,"./util.js":1147,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/slicedToArray":21}],1147:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -225093,7 +225887,7 @@ var _validate = require("../types/validate.js"); ...@@ -225093,7 +225887,7 @@ var _validate = require("../types/validate.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/util.js';
* console.log(Monster.DOM.getDocument()) * console.log(Monster.DOM.getDocument())
* </script> * </script>
* ``` * ```
...@@ -225102,7 +225896,7 @@ var _validate = require("../types/validate.js"); ...@@ -225102,7 +225896,7 @@ var _validate = require("../types/validate.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {getDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js'; * import {getDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/util.js';
* console.log(getDocument()) * console.log(getDocument())
* </script> * </script>
* ``` * ```
...@@ -225156,7 +225950,7 @@ function getDocument() { ...@@ -225156,7 +225950,7 @@ function getDocument() {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/util.js';
* console.log(Monster.DOM.getWindow()) * console.log(Monster.DOM.getWindow())
* </script> * </script>
* ``` * ```
...@@ -225165,7 +225959,7 @@ function getDocument() { ...@@ -225165,7 +225959,7 @@ function getDocument() {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {getWindow} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js'; * import {getWindow} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/util.js';
* console.log(getWindow(null)) * console.log(getWindow(null))
* </script> * </script>
* ``` * ```
...@@ -225225,7 +226019,7 @@ function getWindow() { ...@@ -225225,7 +226019,7 @@ function getWindow() {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/util.js';
* console.log(Monster.DOM.getDocumentFragmentFromString()) * console.log(Monster.DOM.getDocumentFragmentFromString())
* </script> * </script>
* ``` * ```
...@@ -225234,7 +226028,7 @@ function getWindow() { ...@@ -225234,7 +226028,7 @@ function getWindow() {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {getDocumentFragmentFromString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js'; * import {getDocumentFragmentFromString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/util.js';
* console.log(getDocumentFragmentFromString('<div></div>')) * console.log(getDocumentFragmentFromString('<div></div>'))
* </script> * </script>
* ``` * ```
...@@ -225285,7 +226079,7 @@ function getDocumentFragmentFromString(html) { ...@@ -225285,7 +226079,7 @@ function getDocumentFragmentFromString(html) {
   
_global.Monster.assignToNamespace('Monster.DOM', getWindow, getDocument, getDocumentFragmentFromString); _global.Monster.assignToNamespace('Monster.DOM', getWindow, getDocument, getDocumentFragmentFromString);
   
},{"../types/global.js":1153,"../types/validate.js":1165,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1147:[function(require,module,exports){ },{"../types/global.js":1154,"../types/validate.js":1166,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1148:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -225333,7 +226127,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -225333,7 +226127,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/logging/handler.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/logging/handler.js';
* console.log(new Monster.Logging.Handler()) * console.log(new Monster.Logging.Handler())
* </script> * </script>
* ``` * ```
...@@ -225342,7 +226136,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -225342,7 +226136,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/logging/handler.js'; * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/logging/handler.js';
* console.log(new Handler()) * console.log(new Handler())
* </script> * </script>
* ``` * ```
...@@ -225531,7 +226325,7 @@ exports.Handler = Handler; ...@@ -225531,7 +226325,7 @@ exports.Handler = Handler;
   
_namespace.Monster.assignToNamespace('Monster.Logging', Handler); _namespace.Monster.assignToNamespace('Monster.Logging', Handler);
   
},{"../namespace.js":1151,"../types/base.js":1152,"../types/validate.js":1165,"./logentry.js":1148,"./logger.js":1149,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1148:[function(require,module,exports){ },{"../namespace.js":1152,"../types/base.js":1153,"../types/validate.js":1166,"./logentry.js":1149,"./logger.js":1150,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1149:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -225575,7 +226369,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -225575,7 +226369,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/logging/logentry.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/logging/logentry.js';
* console.log(new Monster.Logging.LogEntry()) * console.log(new Monster.Logging.LogEntry())
* </script> * </script>
* ``` * ```
...@@ -225584,7 +226378,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -225584,7 +226378,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/logging/logentry.js'; * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/logging/logentry.js';
* console.log(new LogEntry()) * console.log(new LogEntry())
* </script> * </script>
* ``` * ```
...@@ -225647,7 +226441,7 @@ exports.LogEntry = LogEntry; ...@@ -225647,7 +226441,7 @@ exports.LogEntry = LogEntry;
   
_namespace.Monster.assignToNamespace('Monster.Logging', LogEntry); _namespace.Monster.assignToNamespace('Monster.Logging', LogEntry);
   
},{"../namespace.js":1151,"../types/base.js":1152,"../types/validate.js":1165,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1149:[function(require,module,exports){ },{"../namespace.js":1152,"../types/base.js":1153,"../types/validate.js":1166,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1150:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -225763,7 +226557,7 @@ var OFF = 0; ...@@ -225763,7 +226557,7 @@ var OFF = 0;
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/logging/logger.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/logging/logger.js';
* console.log(new Monster.Logging.Logger()) * console.log(new Monster.Logging.Logger())
* </script> * </script>
* ``` * ```
...@@ -225772,7 +226566,7 @@ var OFF = 0; ...@@ -225772,7 +226566,7 @@ var OFF = 0;
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/logging/logger.js'; * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/logging/logger.js';
* console.log(new Logger()) * console.log(new Logger())
* </script> * </script>
* ``` * ```
...@@ -226018,7 +226812,7 @@ function triggerLog(loglevel) { ...@@ -226018,7 +226812,7 @@ function triggerLog(loglevel) {
return logger; return logger;
} }
   
},{"../logging/handler.js":1147,"../logging/logentry.js":1148,"../namespace.js":1151,"../types/base.js":1152,"../types/validate.js":1165,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1150:[function(require,module,exports){ },{"../logging/handler.js":1148,"../logging/logentry.js":1149,"../namespace.js":1152,"../types/base.js":1153,"../types/validate.js":1166,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1151:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -226044,7 +226838,7 @@ var _global = require("../types/global.js"); ...@@ -226044,7 +226838,7 @@ var _global = require("../types/global.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/math/random.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/math/random.js';
* console.log(Monster.Math.random(1,10)) // ↦ 5 * console.log(Monster.Math.random(1,10)) // ↦ 5
* </script> * </script>
* ``` * ```
...@@ -226053,7 +226847,7 @@ var _global = require("../types/global.js"); ...@@ -226053,7 +226847,7 @@ var _global = require("../types/global.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/math/random.js'; * import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/math/random.js';
* console.log(random(1,10)) // ↦ 5 * console.log(random(1,10)) // ↦ 5
* </script> * </script>
* ``` * ```
...@@ -226145,7 +226939,7 @@ function create(min, max) { ...@@ -226145,7 +226939,7 @@ function create(min, max) {
   
_global.Monster.assignToNamespace('Monster.Math', random); _global.Monster.assignToNamespace('Monster.Math', random);
   
},{"../types/global.js":1153}],1151:[function(require,module,exports){ },{"../types/global.js":1154}],1152:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @namespace Monster * @namespace Monster
...@@ -226237,7 +227031,7 @@ assignToNamespace('Monster', assignToNamespace); ...@@ -226237,7 +227031,7 @@ assignToNamespace('Monster', assignToNamespace);
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/namespace.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/namespace.js';
* function hello() { * function hello() {
* console.log('Hello World!'); * console.log('Hello World!');
* } * }
...@@ -226327,7 +227121,7 @@ function namespaceFor(parts) { ...@@ -226327,7 +227121,7 @@ function namespaceFor(parts) {
return space; return space;
} }
   
},{"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":12}],1152:[function(require,module,exports){ },{"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":12}],1153:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -226371,7 +227165,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -226371,7 +227165,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/base.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/base.js';
* console.log(new Monster.Types.Base()) * console.log(new Monster.Types.Base())
* console.log(new Monster.Types.Base()) * console.log(new Monster.Types.Base())
* </script> * </script>
...@@ -226381,7 +227175,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -226381,7 +227175,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Object} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/base.js'; * import {Object} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/base.js';
* console.log(new Base()) * console.log(new Base())
* console.log(new Base()) * console.log(new Base())
* </script> * </script>
...@@ -226421,7 +227215,7 @@ exports.Base = Base; ...@@ -226421,7 +227215,7 @@ exports.Base = Base;
   
_namespace.Monster.assignToNamespace('Monster.Types', Base); _namespace.Monster.assignToNamespace('Monster.Types', Base);
   
},{"../namespace.js":1151,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/wrapNativeSuper":26}],1153:[function(require,module,exports){ },{"../namespace.js":1152,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/wrapNativeSuper":26}],1154:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -226494,7 +227288,7 @@ function getGlobal() { ...@@ -226494,7 +227288,7 @@ function getGlobal() {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/global.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/global.js';
* console.log(Monster.Types.getGlobalObject('document')) // ↦ { } * console.log(Monster.Types.getGlobalObject('document')) // ↦ { }
* </script> * </script>
* ``` * ```
...@@ -226503,7 +227297,7 @@ function getGlobal() { ...@@ -226503,7 +227297,7 @@ function getGlobal() {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/global.js'; * import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/global.js';
* console.log(getGlobalObject('document')) // ↦ { } * console.log(getGlobalObject('document')) // ↦ { }
* </script> * </script>
* ``` * ```
...@@ -226534,7 +227328,7 @@ function getGlobalObject(name) { ...@@ -226534,7 +227328,7 @@ function getGlobalObject(name) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/global.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/global.js';
* console.log(Monster.Types.getGlobalFunction('parseInt')) // ↦ f parseInt() { } * console.log(Monster.Types.getGlobalFunction('parseInt')) // ↦ f parseInt() { }
* </script> * </script>
* ``` * ```
...@@ -226543,7 +227337,7 @@ function getGlobalObject(name) { ...@@ -226543,7 +227337,7 @@ function getGlobalObject(name) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/global.js'; * import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/global.js';
* console.log(getGlobalFunction('parseInt')) // ↦ f parseInt() { } * console.log(getGlobalFunction('parseInt')) // ↦ f parseInt() { }
* </script> * </script>
* ``` * ```
...@@ -226570,7 +227364,7 @@ function getGlobalFunction(name) { ...@@ -226570,7 +227364,7 @@ function getGlobalFunction(name) {
   
_namespace.Monster.assignToNamespace('Monster.Types', getGlobal, getGlobalObject, getGlobalFunction); _namespace.Monster.assignToNamespace('Monster.Types', getGlobal, getGlobalObject, getGlobalFunction);
   
},{"../namespace.js":1151,"./validate.js":1165,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1154:[function(require,module,exports){ },{"../namespace.js":1152,"./validate.js":1166,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1155:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -226623,7 +227417,7 @@ var internalCounter = new Map(); ...@@ -226623,7 +227417,7 @@ var internalCounter = new Map();
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/id.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/id.js';
* console.log(new Monster.Types.ID()) * console.log(new Monster.Types.ID())
* </script> * </script>
* ``` * ```
...@@ -226632,7 +227426,7 @@ var internalCounter = new Map(); ...@@ -226632,7 +227426,7 @@ var internalCounter = new Map();
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/id.js'; * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/id.js';
* console.log(new ID()) * console.log(new ID())
* </script> * </script>
* ``` * ```
...@@ -226691,7 +227485,7 @@ exports.ID = ID; ...@@ -226691,7 +227485,7 @@ exports.ID = ID;
   
_base.Monster.assignToNamespace('Monster.Types', ID); _base.Monster.assignToNamespace('Monster.Types', ID);
   
},{"./base.js":1152,"./validate.js":1165,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1155:[function(require,module,exports){ },{"./base.js":1153,"./validate.js":1166,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1156:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -226711,6 +227505,7 @@ exports.isArray = isArray; ...@@ -226711,6 +227505,7 @@ exports.isArray = isArray;
exports.isFunction = isFunction; exports.isFunction = isFunction;
exports.isIterable = isIterable; exports.isIterable = isIterable;
exports.isInteger = isInteger; exports.isInteger = isInteger;
exports.isSymbol = isSymbol;
Object.defineProperty(exports, "Monster", { Object.defineProperty(exports, "Monster", {
enumerable: true, enumerable: true,
get: function get() { get: function get() {
...@@ -226729,7 +227524,7 @@ var _namespace = require("../namespace.js"); ...@@ -226729,7 +227524,7 @@ var _namespace = require("../namespace.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isIterable(null)) // ↦ false * console.log(Monster.Types.isIterable(null)) // ↦ false
* console.log(Monster.Types.isIterable('hello')) // ↦ true * console.log(Monster.Types.isIterable('hello')) // ↦ true
* console.log(Monster.Types.isIterable([])) // ↦ true * console.log(Monster.Types.isIterable([])) // ↦ true
...@@ -226740,7 +227535,7 @@ var _namespace = require("../namespace.js"); ...@@ -226740,7 +227535,7 @@ var _namespace = require("../namespace.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {isIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isIterable(null)) // ↦ false * console.log(isIterable(null)) // ↦ false
* console.log(isIterable('hello')) // ↦ true * console.log(isIterable('hello')) // ↦ true
* console.log(isIterable([])) // ↦ true * console.log(isIterable([])) // ↦ true
...@@ -226765,7 +227560,7 @@ function isIterable(value) { ...@@ -226765,7 +227560,7 @@ function isIterable(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isPrimitive('2')) // ↦ false * console.log(Monster.Types.isPrimitive('2')) // ↦ false
* console.log(Monster.Types.isPrimitive([])) // ↦ true * console.log(Monster.Types.isPrimitive([])) // ↦ true
* </script> * </script>
...@@ -226775,7 +227570,7 @@ function isIterable(value) { ...@@ -226775,7 +227570,7 @@ function isIterable(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {isPrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isPrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isPrimitive('2')) // ↦ true * console.log(isPrimitive('2')) // ↦ true
* console.log(isPrimitive([])) // ↦ false * console.log(isPrimitive([])) // ↦ false
* </script> * </script>
...@@ -226804,6 +227599,40 @@ function isPrimitive(value) { ...@@ -226804,6 +227599,40 @@ function isPrimitive(value) {
   
return false; return false;
} }
/**
* Checks whether the value passed is a symbol
*
* You can call the method via the monster namespace `Monster.Types.isSymbol()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isSymbol('2')) // ↦ false
* console.log(Monster.Types.isSymbol(Symbol('test')) // ↦ true
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {isSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isSymbol(Symbol('a'))) // ↦ true
* console.log(isSymbol([]) // ↦ false
* </script>
* ```
*
* @param {*} value
* @returns {boolean}
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/Types
*/
function isSymbol(value) {
return 'symbol' === (0, _typeof2["default"])(value) ? true : false;
}
/** /**
* Checks whether the value passed is a boolean * Checks whether the value passed is a boolean
* *
...@@ -226811,7 +227640,7 @@ function isPrimitive(value) { ...@@ -226811,7 +227640,7 @@ function isPrimitive(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isBoolean('2')) // ↦ false * console.log(Monster.Types.isBoolean('2')) // ↦ false
* console.log(Monster.Types.isBoolean([])) // ↦ false * console.log(Monster.Types.isBoolean([])) // ↦ false
* console.log(Monster.Types.isBoolean(true)) // ↦ true * console.log(Monster.Types.isBoolean(true)) // ↦ true
...@@ -226822,7 +227651,7 @@ function isPrimitive(value) { ...@@ -226822,7 +227651,7 @@ function isPrimitive(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {isBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isBoolean('2')) // ↦ false * console.log(isBoolean('2')) // ↦ false
* console.log(isBoolean([])) // ↦ false * console.log(isBoolean([])) // ↦ false
* console.log(isBoolean(2>4)) // ↦ true * console.log(isBoolean(2>4)) // ↦ true
...@@ -226851,7 +227680,7 @@ function isBoolean(value) { ...@@ -226851,7 +227680,7 @@ function isBoolean(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isString('2')) // ↦ true * console.log(Monster.Types.isString('2')) // ↦ true
* console.log(Monster.Types.isString([])) // ↦ false * console.log(Monster.Types.isString([])) // ↦ false
* </script> * </script>
...@@ -226861,7 +227690,7 @@ function isBoolean(value) { ...@@ -226861,7 +227690,7 @@ function isBoolean(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {isString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isString('2')) // ↦ true * console.log(isString('2')) // ↦ true
* console.log(isString([])) // ↦ false * console.log(isString([])) // ↦ false
* </script> * </script>
...@@ -226889,7 +227718,7 @@ function isString(value) { ...@@ -226889,7 +227718,7 @@ function isString(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isObject('2')) // ↦ false * console.log(Monster.Types.isObject('2')) // ↦ false
* console.log(Monster.Types.isObject([])) // ↦ false * console.log(Monster.Types.isObject([])) // ↦ false
* console.log(Monster.Types.isObject({})) // ↦ true * console.log(Monster.Types.isObject({})) // ↦ true
...@@ -226900,7 +227729,7 @@ function isString(value) { ...@@ -226900,7 +227729,7 @@ function isString(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isObject('2')) // ↦ false * console.log(isObject('2')) // ↦ false
* console.log(isObject([])) // ↦ false * console.log(isObject([])) // ↦ false
* </script> * </script>
...@@ -226931,7 +227760,7 @@ function isObject(value) { ...@@ -226931,7 +227760,7 @@ function isObject(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isInstance('2')) // ↦ false * console.log(Monster.Types.isInstance('2')) // ↦ false
* console.log(Monster.Types.isInstance([])) // ↦ false * console.log(Monster.Types.isInstance([])) // ↦ false
* console.log(Monster.Types.isInstance({})) // ↦ true * console.log(Monster.Types.isInstance({})) // ↦ true
...@@ -226942,7 +227771,7 @@ function isObject(value) { ...@@ -226942,7 +227771,7 @@ function isObject(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {isInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isInstance('2')) // ↦ false * console.log(isInstance('2')) // ↦ false
* console.log(isInstance([])) // ↦ false * console.log(isInstance([])) // ↦ false
* </script> * </script>
...@@ -226970,7 +227799,7 @@ function isInstance(value, instance) { ...@@ -226970,7 +227799,7 @@ function isInstance(value, instance) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isArray('2')) // ↦ false * console.log(Monster.Types.isArray('2')) // ↦ false
* console.log(Monster.Types.isArray([])) // ↦ true * console.log(Monster.Types.isArray([])) // ↦ true
* </script> * </script>
...@@ -226980,7 +227809,7 @@ function isInstance(value, instance) { ...@@ -226980,7 +227809,7 @@ function isInstance(value, instance) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {isArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isArray('2')) // ↦ false * console.log(isArray('2')) // ↦ false
* console.log(isArray([])) // ↦ true * console.log(isArray([])) // ↦ true
* </script> * </script>
...@@ -227008,7 +227837,7 @@ function isArray(value) { ...@@ -227008,7 +227837,7 @@ function isArray(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isFunction(()=>{})) // ↦ true * console.log(Monster.Types.isFunction(()=>{})) // ↦ true
* console.log(Monster.Types.isFunction('2')) // ↦ false * console.log(Monster.Types.isFunction('2')) // ↦ false
* console.log(Monster.Types.isFunction([])) // ↦ false * console.log(Monster.Types.isFunction([])) // ↦ false
...@@ -227019,7 +227848,7 @@ function isArray(value) { ...@@ -227019,7 +227848,7 @@ function isArray(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {isFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isFunction(()=>{})) // ↦ true * console.log(isFunction(()=>{})) // ↦ true
* console.log(isFunction('2')) // ↦ false * console.log(isFunction('2')) // ↦ false
* console.log(isFunction([])) // ↦ false * console.log(isFunction([])) // ↦ false
...@@ -227051,7 +227880,7 @@ function isFunction(value) { ...@@ -227051,7 +227880,7 @@ function isFunction(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(Monster.Types.isInteger(()=>{})) // ↦ true * console.log(Monster.Types.isInteger(()=>{})) // ↦ true
* console.log(Monster.Types.isInteger('2')) // ↦ false * console.log(Monster.Types.isInteger('2')) // ↦ false
* console.log(Monster.Types.isInteger(2)) // ↦ true * console.log(Monster.Types.isInteger(2)) // ↦ true
...@@ -227062,7 +227891,7 @@ function isFunction(value) { ...@@ -227062,7 +227891,7 @@ function isFunction(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {isInteger} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isInteger} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* console.log(isInteger(()=>{})) // ↦ true * console.log(isInteger(()=>{})) // ↦ true
* console.log(isInteger('2')) // ↦ false * console.log(isInteger('2')) // ↦ false
* console.log(isInteger(2)) // ↦ true * console.log(isInteger(2)) // ↦ true
...@@ -227081,9 +227910,9 @@ function isInteger(value) { ...@@ -227081,9 +227910,9 @@ function isInteger(value) {
return Number.isInteger(value); return Number.isInteger(value);
} }
   
_namespace.Monster.assignToNamespace('Monster.Types', isPrimitive, isBoolean, isString, isObject, isArray, isFunction, isIterable, isInteger); _namespace.Monster.assignToNamespace('Monster.Types', isPrimitive, isBoolean, isString, isObject, isArray, isFunction, isIterable, isInteger, isSymbol);
   
},{"../namespace.js":1151,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1156:[function(require,module,exports){ },{"../namespace.js":1152,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1157:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -227133,7 +227962,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227133,7 +227962,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/observer.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/observer.js';
* console.log(new Monster.Types.Observer()) * console.log(new Monster.Types.Observer())
* </script> * </script>
* ``` * ```
...@@ -227142,7 +227971,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227142,7 +227971,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/observer.js'; * import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/observer.js';
* console.log(new Observer()) * console.log(new Observer())
* </script> * </script>
* ``` * ```
...@@ -227176,7 +228005,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227176,7 +228005,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* @example * @example
* *
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/observer.js'; * import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/observer.js';
* *
* const observer = new Observer(function(a, b, c) { * const observer = new Observer(function(a, b, c) {
* console.log(this, a, b, c); // ↦ "a", 2, true * console.log(this, a, b, c); // ↦ "a", 2, true
...@@ -227315,7 +228144,7 @@ exports.Observer = Observer; ...@@ -227315,7 +228144,7 @@ exports.Observer = Observer;
   
_namespace.Monster.assignToNamespace('Monster.Types', Observer); _namespace.Monster.assignToNamespace('Monster.Types', Observer);
   
},{"../namespace.js":1151,"./base.js":1152,"./is.js":1155,"./tokenlist.js":1162,"./uniquequeue.js":1164,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1157:[function(require,module,exports){ },{"../namespace.js":1152,"./base.js":1153,"./is.js":1156,"./tokenlist.js":1163,"./uniquequeue.js":1165,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1158:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -227363,7 +228192,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227363,7 +228192,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/observerlist.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/observerlist.js';
* console.log(new Monster.Types.ObserverList()) * console.log(new Monster.Types.ObserverList())
* console.log(new Monster.Types.ObserverList()) * console.log(new Monster.Types.ObserverList())
* </script> * </script>
...@@ -227373,7 +228202,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227373,7 +228202,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {ObserverList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/observerlist.js'; * import {ObserverList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/observerlist.js';
* console.log(ObserverList()) * console.log(ObserverList())
* console.log(ObserverList()) * console.log(ObserverList())
* </script> * </script>
...@@ -227485,7 +228314,7 @@ exports.ObserverList = ObserverList; ...@@ -227485,7 +228314,7 @@ exports.ObserverList = ObserverList;
   
_namespace.Monster.assignToNamespace('Monster.Types', ObserverList); _namespace.Monster.assignToNamespace('Monster.Types', ObserverList);
   
},{"../namespace.js":1151,"./base.js":1152,"./observer.js":1156,"./validate.js":1165,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1158:[function(require,module,exports){ },{"../namespace.js":1152,"./base.js":1153,"./observer.js":1157,"./validate.js":1166,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1159:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -227541,7 +228370,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227541,7 +228370,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/proxyobserver.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/proxyobserver.js';
* console.log(new Monster.Types.ProxyObserver()) * console.log(new Monster.Types.ProxyObserver())
* </script> * </script>
* ``` * ```
...@@ -227550,7 +228379,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227550,7 +228379,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/proxyobserver.js'; * import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/proxyobserver.js';
* console.log(new ProxyObserver()) * console.log(new ProxyObserver())
* </script> * </script>
* ``` * ```
...@@ -227561,9 +228390,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227561,9 +228390,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* @example * @example
* *
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/proxyobserver.js'; * import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/proxyobserver.js';
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/observer.js'; * import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/observer.js';
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/is.js'; * import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/is.js';
* *
* const o = new Observer(function () { * const o = new Observer(function () {
* if (isObject(this) && this instanceof ProxyObserver) { * if (isObject(this) && this instanceof ProxyObserver) {
...@@ -227779,7 +228608,7 @@ function getHandler() { ...@@ -227779,7 +228608,7 @@ function getHandler() {
return handler; return handler;
} }
   
},{"../namespace.js":1151,"./base.js":1152,"./is.js":1155,"./observer.js":1156,"./observerlist.js":1157,"./validate.js":1165,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/typeof":24}],1159:[function(require,module,exports){ },{"../namespace.js":1152,"./base.js":1153,"./is.js":1156,"./observer.js":1157,"./observerlist.js":1158,"./validate.js":1166,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/typeof":24}],1160:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -227816,7 +228645,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227816,7 +228645,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/queue.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/queue.js';
* console.log(new Monster.Types.Queue()) * console.log(new Monster.Types.Queue())
* </script> * </script>
* ``` * ```
...@@ -227825,14 +228654,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -227825,14 +228654,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/queue.js'; * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/queue.js';
* console.log(new Queue()) * console.log(new Queue())
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/queue.js'; * import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/queue.js';
* *
* const queue = new Queue; * const queue = new Queue;
* *
...@@ -227947,7 +228776,7 @@ exports.Queue = Queue; ...@@ -227947,7 +228776,7 @@ exports.Queue = Queue;
   
_base.Monster.assignToNamespace('Monster.Types', Queue); _base.Monster.assignToNamespace('Monster.Types', Queue);
   
},{"./base.js":1152,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1160:[function(require,module,exports){ },{"./base.js":1153,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1161:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -227994,7 +228823,7 @@ var internalCounter = 0; ...@@ -227994,7 +228823,7 @@ var internalCounter = 0;
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/randomid.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/randomid.js';
* console.log(new Monster.Types.RandomID()) * console.log(new Monster.Types.RandomID())
* </script> * </script>
* ``` * ```
...@@ -228003,7 +228832,7 @@ var internalCounter = 0; ...@@ -228003,7 +228832,7 @@ var internalCounter = 0;
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {RandomID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/randomid.js'; * import {RandomID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/randomid.js';
* console.log(new RandomID()) * console.log(new RandomID())
* </script> * </script>
* ``` * ```
...@@ -228040,7 +228869,7 @@ exports.RandomID = RandomID; ...@@ -228040,7 +228869,7 @@ exports.RandomID = RandomID;
   
_id.Monster.assignToNamespace('Monster.Types', RandomID); _id.Monster.assignToNamespace('Monster.Types', RandomID);
   
},{"../math/random.js":1150,"./global.js":1153,"./id.js":1154,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1161:[function(require,module,exports){ },{"../math/random.js":1151,"./global.js":1154,"./id.js":1155,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1162:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -228077,7 +228906,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -228077,7 +228906,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/stack.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/stack.js';
* console.log(new Monster.Types.Stack()) * console.log(new Monster.Types.Stack())
* </script> * </script>
* ``` * ```
...@@ -228086,7 +228915,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -228086,7 +228915,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/stack.js'; * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/stack.js';
* console.log(new Stack()) * console.log(new Stack())
* </script> * </script>
* ``` * ```
...@@ -228188,7 +229017,7 @@ exports.Stack = Stack; ...@@ -228188,7 +229017,7 @@ exports.Stack = Stack;
   
_base.Monster.assignToNamespace('Monster.Types', Stack); _base.Monster.assignToNamespace('Monster.Types', Stack);
   
},{"./base.js":1152,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1162:[function(require,module,exports){ },{"./base.js":1153,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1163:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -228244,7 +229073,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -228244,7 +229073,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/tokenlist.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/tokenlist.js';
* console.log(new Monster.Types.TokenList("myclass row")) * console.log(new Monster.Types.TokenList("myclass row"))
* console.log(new Monster.Types.TokenList("myclass row")) * console.log(new Monster.Types.TokenList("myclass row"))
* </script> * </script>
...@@ -228254,7 +229083,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -228254,7 +229083,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {TokenList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/tokenlist.js'; * import {TokenList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/tokenlist.js';
* console.log(new TokenList("myclass row")) * console.log(new TokenList("myclass row"))
* console.log(new TokenList("myclass row")) * console.log(new TokenList("myclass row"))
* </script> * </script>
...@@ -228624,7 +229453,7 @@ function toggleValue(token) { ...@@ -228624,7 +229453,7 @@ function toggleValue(token) {
   
_namespace.Monster.assignToNamespace('Monster.Types', TokenList); _namespace.Monster.assignToNamespace('Monster.Types', TokenList);
   
},{"../namespace.js":1151,"../types/is.js":1155,"../types/validate.js":1165,"./base.js":1152,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1163:[function(require,module,exports){ },{"../namespace.js":1152,"../types/is.js":1156,"../types/validate.js":1166,"./base.js":1153,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1164:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -228650,7 +229479,7 @@ var _namespace = require("../namespace.js"); ...@@ -228650,7 +229479,7 @@ var _namespace = require("../namespace.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/typeof.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/typeof.js';
* console.log(Monster.Types.typeOf()) * console.log(Monster.Types.typeOf())
* </script> * </script>
* ``` * ```
...@@ -228659,14 +229488,14 @@ var _namespace = require("../namespace.js"); ...@@ -228659,14 +229488,14 @@ var _namespace = require("../namespace.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/typeof.js'; * import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/typeof.js';
* console.log(typeOf()) * console.log(typeOf())
* </script> * </script>
* ``` * ```
* *
* @example * @example
* *
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/typeof.js'; * import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/typeof.js';
* *
* console.log(typeOf(undefined)); // ↦ undefined * console.log(typeOf(undefined)); // ↦ undefined
* console.log(typeOf("")); // ↦ string * console.log(typeOf("")); // ↦ string
...@@ -228696,7 +229525,7 @@ function typeOf(value) { ...@@ -228696,7 +229525,7 @@ function typeOf(value) {
   
_namespace.Monster.assignToNamespace('Monster.Types', typeOf); _namespace.Monster.assignToNamespace('Monster.Types', typeOf);
   
},{"../namespace.js":1151}],1164:[function(require,module,exports){ },{"../namespace.js":1152}],1165:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -228737,7 +229566,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -228737,7 +229566,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/uniquequeue.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/uniquequeue.js';
* console.log(new Monster.Types.UniqueQueue()) * console.log(new Monster.Types.UniqueQueue())
* </script> * </script>
* ``` * ```
...@@ -228746,7 +229575,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -228746,7 +229575,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {UniqueQueue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/uniquequeue.js'; * import {UniqueQueue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/uniquequeue.js';
* console.log(new UniqueQueue()) * console.log(new UniqueQueue())
* </script> * </script>
* ``` * ```
...@@ -228831,7 +229660,7 @@ exports.UniqueQueue = UniqueQueue; ...@@ -228831,7 +229660,7 @@ exports.UniqueQueue = UniqueQueue;
   
_queue.Monster.assignToNamespace('Monster.Types', UniqueQueue); _queue.Monster.assignToNamespace('Monster.Types', UniqueQueue);
   
},{"./queue.js":1159,"./validate.js":1165,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/get":9,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1165:[function(require,module,exports){ },{"./queue.js":1160,"./validate.js":1166,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/get":9,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1166:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -228849,6 +229678,7 @@ exports.validateArray = validateArray; ...@@ -228849,6 +229678,7 @@ exports.validateArray = validateArray;
exports.validateFunction = validateFunction; exports.validateFunction = validateFunction;
exports.validateIterable = validateIterable; exports.validateIterable = validateIterable;
exports.validateInteger = validateInteger; exports.validateInteger = validateInteger;
exports.validateSymbol = validateSymbol;
Object.defineProperty(exports, "Monster", { Object.defineProperty(exports, "Monster", {
enumerable: true, enumerable: true,
get: function get() { get: function get() {
...@@ -228867,9 +229697,9 @@ var _is = require("./is.js"); ...@@ -228867,9 +229697,9 @@ var _is = require("./is.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validateIterable('2')) // ↦ TypeError * console.log(Monster.Types.validateIterable('2')) // ↦ TypeError
* console.log(Monster.Types.validateIterable([])) // ↦ undefined * console.log(Monster.Types.validateIterable([])) // ↦ value
* </script> * </script>
* ``` * ```
* *
...@@ -228877,9 +229707,9 @@ var _is = require("./is.js"); ...@@ -228877,9 +229707,9 @@ var _is = require("./is.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {validateIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {validateIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validateIterable('2')) // ↦ TypeError * console.log(validateIterable('2')) // ↦ TypeError
* console.log(validateIterable([])) // ↦ undefined * console.log(validateIterable([])) // ↦ value
* </script> * </script>
* ``` * ```
* *
...@@ -228907,8 +229737,8 @@ function validateIterable(value) { ...@@ -228907,8 +229737,8 @@ function validateIterable(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validatePrimitive('2')) // ↦ undefined * console.log(Monster.Types.validatePrimitive('2')) // ↦ value
* console.log(Monster.Types.validatePrimitive([])) // ↦ TypeError * console.log(Monster.Types.validatePrimitive([])) // ↦ TypeError
* </script> * </script>
* ``` * ```
...@@ -228917,8 +229747,8 @@ function validateIterable(value) { ...@@ -228917,8 +229747,8 @@ function validateIterable(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {validatePrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {validatePrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validatePrimitive('2')) // ↦ undefined * console.log(validatePrimitive('2')) // ↦ value
* console.log(validatePrimitive([])) // ↦ TypeError * console.log(validatePrimitive([])) // ↦ TypeError
* </script> * </script>
* ``` * ```
...@@ -228949,8 +229779,8 @@ function validatePrimitive(value) { ...@@ -228949,8 +229779,8 @@ function validatePrimitive(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validateBoolean(true)) // ↦ undefined * console.log(Monster.Types.validateBoolean(true)) // ↦ value
* console.log(Monster.Types.validateBoolean('2')) // ↦ TypeError * console.log(Monster.Types.validateBoolean('2')) // ↦ TypeError
* console.log(Monster.Types.validateBoolean([])) // ↦ TypeError * console.log(Monster.Types.validateBoolean([])) // ↦ TypeError
* </script> * </script>
...@@ -228960,8 +229790,8 @@ function validatePrimitive(value) { ...@@ -228960,8 +229790,8 @@ function validatePrimitive(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {validateBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {validateBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validateBoolean(false)) // ↦ undefined * console.log(validateBoolean(false)) // ↦ value
* console.log(validateBoolean('2')) // ↦ TypeError * console.log(validateBoolean('2')) // ↦ TypeError
* console.log(validateBoolean([])) // ↦ TypeError * console.log(validateBoolean([])) // ↦ TypeError
* </script> * </script>
...@@ -228991,8 +229821,8 @@ function validateBoolean(value) { ...@@ -228991,8 +229821,8 @@ function validateBoolean(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validateString('2')) // ↦ undefined * console.log(Monster.Types.validateString('2')) // ↦ value
* console.log(Monster.Types.validateString([])) // ↦ TypeError * console.log(Monster.Types.validateString([])) // ↦ TypeError
* </script> * </script>
* ``` * ```
...@@ -229001,8 +229831,8 @@ function validateBoolean(value) { ...@@ -229001,8 +229831,8 @@ function validateBoolean(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {validateString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {validateString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validateString('2')) // ↦ undefined * console.log(validateString('2')) // ↦ value
* console.log(validateString([])) // ↦ TypeError * console.log(validateString([])) // ↦ TypeError
* </script> * </script>
* ``` * ```
...@@ -229030,8 +229860,8 @@ function validateString(value) { ...@@ -229030,8 +229860,8 @@ function validateString(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validateObject({})) // ↦ undefined * console.log(Monster.Types.validateObject({})) // ↦ value
* console.log(Monster.Types.validateObject('2')) // ↦ TypeError * console.log(Monster.Types.validateObject('2')) // ↦ TypeError
* console.log(Monster.Types.validateObject([])) // ↦ TypeError * console.log(Monster.Types.validateObject([])) // ↦ TypeError
* </script> * </script>
...@@ -229041,8 +229871,8 @@ function validateString(value) { ...@@ -229041,8 +229871,8 @@ function validateString(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {validateObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {validateObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validateObject({})) // ↦ undefined * console.log(validateObject({})) // ↦ value
* console.log(validateObject('2')) // ↦ TypeError * console.log(validateObject('2')) // ↦ TypeError
* console.log(validateObject([])) // ↦ TypeError * console.log(validateObject([])) // ↦ TypeError
* </script> * </script>
...@@ -229071,8 +229901,8 @@ function validateObject(value) { ...@@ -229071,8 +229901,8 @@ function validateObject(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validateInstance({}, Object)) // ↦ undefined * console.log(Monster.Types.validateInstance({}, Object)) // ↦ value
* console.log(Monster.Types.validateInstance('2', Object)) // ↦ TypeError * console.log(Monster.Types.validateInstance('2', Object)) // ↦ TypeError
* console.log(Monster.Types.validateInstance([], Object)) // ↦ TypeError * console.log(Monster.Types.validateInstance([], Object)) // ↦ TypeError
* </script> * </script>
...@@ -229082,8 +229912,8 @@ function validateObject(value) { ...@@ -229082,8 +229912,8 @@ function validateObject(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {validateInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {validateInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validateInstance({}, Object)) // ↦ undefined * console.log(validateInstance({}, Object)) // ↦ value
* console.log(validateInstance('2', Object)) // ↦ TypeError * console.log(validateInstance('2', Object)) // ↦ TypeError
* console.log(validateInstance([], Object)) // ↦ TypeError * console.log(validateInstance([], Object)) // ↦ TypeError
* </script> * </script>
...@@ -229122,9 +229952,9 @@ function validateInstance(value, instance) { ...@@ -229122,9 +229952,9 @@ function validateInstance(value, instance) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validateArray('2')) // ↦ TypeError * console.log(Monster.Types.validateArray('2')) // ↦ TypeError
* console.log(Monster.Types.validateArray([])) // ↦ undefined * console.log(Monster.Types.validateArray([])) // ↦ value
* </script> * </script>
* ``` * ```
* *
...@@ -229132,9 +229962,9 @@ function validateInstance(value, instance) { ...@@ -229132,9 +229962,9 @@ function validateInstance(value, instance) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {validateArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {validateArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validateArray('2')) // ↦ TypeError * console.log(validateArray('2')) // ↦ TypeError
* console.log(validateArray([])) // ↦ undefined * console.log(validateArray([])) // ↦ value
* </script> * </script>
* ``` * ```
* *
...@@ -229154,6 +229984,45 @@ function validateArray(value) { ...@@ -229154,6 +229984,45 @@ function validateArray(value) {
   
return value; return value;
} }
/**
* This method checks if the type matches the symbol type. this function is identical to isSymbol() except that a TypeError is thrown.
*
* You can call the method via the monster namespace `Monster.Types.validateSymbol()`.
*
* ```
* <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validateSymbol('2')) // ↦ TypeError
* console.log(Monster.Types.validateSymbol([])) // ↦ value
* </script>
* ```
*
* Alternatively, you can also integrate this function individually.
*
* ```
* <script type="module">
* import {validateSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validateSymbol('2')) // ↦ TypeError
* console.log(validateSymbol()) // ↦ value
* </script>
* ```
*
* @param {*} value
* @return {*}
* @since 1.9.0
* @copyright schukai GmbH
* @memberOf Monster/Types
* @throws {TypeError} value is not an symbol
*/
function validateSymbol(value) {
if (!(0, _is.isSymbol)(value)) {
throw new TypeError('value is not an symbol');
}
return value;
}
/** /**
* This method checks if the type matches the function type. this function is identical to isFunction() except that a TypeError is thrown. * This method checks if the type matches the function type. this function is identical to isFunction() except that a TypeError is thrown.
* *
...@@ -229161,8 +230030,8 @@ function validateArray(value) { ...@@ -229161,8 +230030,8 @@ function validateArray(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validateFunction(()=>{})) // ↦ undefined * console.log(Monster.Types.validateFunction(()=>{})) // ↦ value
* console.log(Monster.Types.validateFunction('2')) // ↦ TypeError * console.log(Monster.Types.validateFunction('2')) // ↦ TypeError
* console.log(Monster.Types.validateFunction([])) // ↦ TypeError * console.log(Monster.Types.validateFunction([])) // ↦ TypeError
* </script> * </script>
...@@ -229172,8 +230041,8 @@ function validateArray(value) { ...@@ -229172,8 +230041,8 @@ function validateArray(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validateFunction(()=>{})) // ↦ undefined * console.log(validateFunction(()=>{})) // ↦ value
* console.log(validateFunction('2')) // ↦ TypeError * console.log(validateFunction('2')) // ↦ TypeError
* console.log(validateFunction([])) // ↦ TypeError * console.log(validateFunction([])) // ↦ TypeError
* </script> * </script>
...@@ -229202,10 +230071,10 @@ function validateFunction(value) { ...@@ -229202,10 +230071,10 @@ function validateFunction(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(Monster.Types.validateInteger(true)) // ↦ TypeError * console.log(Monster.Types.validateInteger(true)) // ↦ TypeError
* console.log(Monster.Types.validateInteger('2')) // ↦ TypeError * console.log(Monster.Types.validateInteger('2')) // ↦ TypeError
* console.log(Monster.Types.validateInteger(2)) // ↦ undefined * console.log(Monster.Types.validateInteger(2)) // ↦ value
* </script> * </script>
* ``` * ```
* *
...@@ -229213,10 +230082,10 @@ function validateFunction(value) { ...@@ -229213,10 +230082,10 @@ function validateFunction(value) {
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/validate.js'; * import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/validate.js';
* console.log(validateInteger(true)) // ↦ TypeError * console.log(validateInteger(true)) // ↦ TypeError
* console.log(validateInteger('2')) // ↦ TypeError * console.log(validateInteger('2')) // ↦ TypeError
* console.log(validateInteger(2)) // ↦ undefined * console.log(validateInteger(2)) // ↦ value
* </script> * </script>
* ``` * ```
* *
...@@ -229239,7 +230108,7 @@ function validateInteger(value) { ...@@ -229239,7 +230108,7 @@ function validateInteger(value) {
   
_namespace.Monster.assignToNamespace('Monster.Types', validatePrimitive, validateBoolean, validateString, validateObject, validateArray, validateFunction, validateIterable, validateInteger); _namespace.Monster.assignToNamespace('Monster.Types', validatePrimitive, validateBoolean, validateString, validateObject, validateArray, validateFunction, validateIterable, validateInteger);
   
},{"../namespace.js":1151,"./is.js":1155}],1166:[function(require,module,exports){ },{"../namespace.js":1152,"./is.js":1156}],1167:[function(require,module,exports){
'use strict'; 'use strict';
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -229281,7 +230150,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -229281,7 +230150,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/version.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/version.js';
* console.log(new Monster.Types.Version('1.2.3')) // ↦ 1.2.3 * console.log(new Monster.Types.Version('1.2.3')) // ↦ 1.2.3
* console.log(new Monster.Types.Version('1')) // ↦ 1.0.0 * console.log(new Monster.Types.Version('1')) // ↦ 1.0.0
* </script> * </script>
...@@ -229291,7 +230160,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -229291,7 +230160,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/version.js'; * import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/version.js';
* console.log(new Version('1.2.3')) // ↦ 1.2.3 * console.log(new Version('1.2.3')) // ↦ 1.2.3
* console.log(new Version('1')) // ↦ 1.0.0 * console.log(new Version('1')) // ↦ 1.0.0
* </script> * </script>
...@@ -229299,7 +230168,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -229299,7 +230168,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* @example * @example
* *
* import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/version.js'; * import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/version.js';
* *
* new Version('1.0.0') // ↦ 1.0.0 * new Version('1.0.0') // ↦ 1.0.0
* new Version(1) // ↦ 1.0.0 * new Version(1) // ↦ 1.0.0
...@@ -229432,7 +230301,7 @@ var monsterVersion; ...@@ -229432,7 +230301,7 @@ var monsterVersion;
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/version.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/version.js';
* console.log(Monster.getVersion()) * console.log(Monster.getVersion())
* console.log(Monster.getVersion()) * console.log(Monster.getVersion())
* </script> * </script>
...@@ -229442,7 +230311,7 @@ var monsterVersion; ...@@ -229442,7 +230311,7 @@ var monsterVersion;
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {getVersion} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/version.js'; * import {getVersion} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/version.js';
* console.log(getVersion()) * console.log(getVersion())
* console.log(getVersion()) * console.log(getVersion())
* </script> * </script>
...@@ -229462,7 +230331,7 @@ function getVersion() { ...@@ -229462,7 +230331,7 @@ function getVersion() {
/**#@+ dont touch, replaced by make with package.json version */ /**#@+ dont touch, replaced by make with package.json version */
   
   
monsterVersion = new Version('1.8.0'); monsterVersion = new Version('1.9.0');
/**#@-*/ /**#@-*/
   
return monsterVersion; return monsterVersion;
...@@ -229470,7 +230339,7 @@ function getVersion() { ...@@ -229470,7 +230339,7 @@ function getVersion() {
   
_namespace.Monster.assignToNamespace('Monster', getVersion); _namespace.Monster.assignToNamespace('Monster', getVersion);
   
},{"../namespace.js":1151,"./base.js":1152,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1167:[function(require,module,exports){ },{"../namespace.js":1152,"./base.js":1153,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19}],1168:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -229510,7 +230379,7 @@ var _global = require("../types/global.js"); ...@@ -229510,7 +230379,7 @@ var _global = require("../types/global.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/util/clone.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/util/clone.js';
* console.log(Monster.Util.clone({})) * console.log(Monster.Util.clone({}))
* </script> * </script>
* ``` * ```
...@@ -229519,7 +230388,7 @@ var _global = require("../types/global.js"); ...@@ -229519,7 +230388,7 @@ var _global = require("../types/global.js");
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {clone} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/util/clone.js'; * import {clone} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/util/clone.js';
* console.log(clone({})) * console.log(clone({}))
* </script> * </script>
* ``` * ```
...@@ -229635,7 +230504,7 @@ function cloneObject(obj) { ...@@ -229635,7 +230504,7 @@ function cloneObject(obj) {
   
_namespace.Monster.assignToNamespace('Monster.Util', clone); _namespace.Monster.assignToNamespace('Monster.Util', clone);
   
},{"../namespace.js":1151,"../types/global.js":1153,"../types/is.js":1155,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1168:[function(require,module,exports){ },{"../namespace.js":1152,"../types/global.js":1154,"../types/is.js":1156,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24}],1169:[function(require,module,exports){
'use strict'; 'use strict';
/** /**
* @author schukai GmbH * @author schukai GmbH
...@@ -229679,7 +230548,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -229679,7 +230548,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/util/comparator.js'; * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/util/comparator.js';
* console.log(new Monster.Util.Comparator()) * console.log(new Monster.Util.Comparator())
* </script> * </script>
* ``` * ```
...@@ -229688,7 +230557,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -229688,7 +230557,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* ``` * ```
* <script type="module"> * <script type="module">
* import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/util/comparator.js'; * import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/util/comparator.js';
* console.log(new Comparator()) * console.log(new Comparator())
* </script> * </script>
* ``` * ```
...@@ -229713,7 +230582,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re ...@@ -229713,7 +230582,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
* *
* @example * @example
* *
* import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/util/comparator.js'; * import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/util/comparator.js';
* *
* console.log(new Comparator().lessThanOrEqual(2, 5)) * console.log(new Comparator().lessThanOrEqual(2, 5))
* // ↦ true * // ↦ true
...@@ -229862,7 +230731,7 @@ exports.Comparator = Comparator; ...@@ -229862,7 +230731,7 @@ exports.Comparator = Comparator;
   
_base.Monster.assignToNamespace('Monster.Util', Comparator); _base.Monster.assignToNamespace('Monster.Util', Comparator);
   
},{"../types/base.js":1152,"../types/is.js":1155,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/typeof":24}],1169:[function(require,module,exports){ },{"../types/base.js":1153,"../types/is.js":1156,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/typeof":24}],1170:[function(require,module,exports){
"use strict"; "use strict";
   
var _valid = require("../../../source/constraints/valid.js"); var _valid = require("../../../source/constraints/valid.js");
...@@ -229889,7 +230758,7 @@ describe('AndOperator', function () { ...@@ -229889,7 +230758,7 @@ describe('AndOperator', function () {
}); });
}); });
   
},{"../../../source/constraints/andoperator.js":1128,"../../../source/constraints/invalid.js":1129,"../../../source/constraints/valid.js":1133}],1170:[function(require,module,exports){ },{"../../../source/constraints/andoperator.js":1128,"../../../source/constraints/invalid.js":1129,"../../../source/constraints/valid.js":1133}],1171:[function(require,module,exports){
"use strict"; "use strict";
   
var _invalid = require("../../../source/constraints/invalid.js"); var _invalid = require("../../../source/constraints/invalid.js");
...@@ -229908,7 +230777,7 @@ describe('Invalid', function () { ...@@ -229908,7 +230777,7 @@ describe('Invalid', function () {
}); });
}); });
   
},{"../../../source/constraints/invalid.js":1129,"chai":132}],1171:[function(require,module,exports){ },{"../../../source/constraints/invalid.js":1129,"chai":132}],1172:[function(require,module,exports){
"use strict"; "use strict";
   
var _isarray = require("../../../source/constraints/isarray.js"); var _isarray = require("../../../source/constraints/isarray.js");
...@@ -229929,7 +230798,7 @@ describe('IsArray', function () { ...@@ -229929,7 +230798,7 @@ describe('IsArray', function () {
}); });
}); });
   
},{"../../../source/constraints/isarray.js":1130,"chai":132}],1172:[function(require,module,exports){ },{"../../../source/constraints/isarray.js":1130,"chai":132}],1173:[function(require,module,exports){
"use strict"; "use strict";
   
var _isobject = require("../../../source/constraints/isobject.js"); var _isobject = require("../../../source/constraints/isobject.js");
...@@ -229950,7 +230819,7 @@ describe('IsObject', function () { ...@@ -229950,7 +230819,7 @@ describe('IsObject', function () {
}); });
}); });
   
},{"../../../source/constraints/isobject.js":1131,"chai":132}],1173:[function(require,module,exports){ },{"../../../source/constraints/isobject.js":1131,"chai":132}],1174:[function(require,module,exports){
"use strict"; "use strict";
   
var _valid = require("../../../source/constraints/valid.js"); var _valid = require("../../../source/constraints/valid.js");
...@@ -229977,7 +230846,7 @@ describe('OrOperator', function () { ...@@ -229977,7 +230846,7 @@ describe('OrOperator', function () {
}); });
}); });
   
},{"../../../source/constraints/invalid.js":1129,"../../../source/constraints/oroperator.js":1132,"../../../source/constraints/valid.js":1133}],1174:[function(require,module,exports){ },{"../../../source/constraints/invalid.js":1129,"../../../source/constraints/oroperator.js":1132,"../../../source/constraints/valid.js":1133}],1175:[function(require,module,exports){
"use strict"; "use strict";
   
var _valid = require("../../../source/constraints/valid.js"); var _valid = require("../../../source/constraints/valid.js");
...@@ -229997,7 +230866,7 @@ describe('Valid', function () { ...@@ -229997,7 +230866,7 @@ describe('Valid', function () {
}); });
}); });
   
},{"../../../source/constraints/valid.js":1133,"chai":132}],1175:[function(require,module,exports){ },{"../../../source/constraints/valid.js":1133,"chai":132}],1176:[function(require,module,exports){
"use strict"; "use strict";
   
var _buildmap = require("../../../source/data/buildmap.js"); var _buildmap = require("../../../source/data/buildmap.js");
...@@ -230087,7 +230956,7 @@ describe('buildMap', function () { ...@@ -230087,7 +230956,7 @@ describe('buildMap', function () {
}); });
}); });
   
},{"../../../source/data/buildmap.js":1134,"chai":132}],1176:[function(require,module,exports){ },{"../../../source/data/buildmap.js":1134,"chai":132}],1177:[function(require,module,exports){
"use strict"; "use strict";
   
var _diff = require("../../../source/data/diff.js"); var _diff = require("../../../source/data/diff.js");
...@@ -230168,7 +231037,7 @@ describe('Diff', function () { ...@@ -230168,7 +231037,7 @@ describe('Diff', function () {
}); });
}); });
   
},{"../../../source/data/diff.js":1135,"../../../source/types/queue.js":1159,"chai":132}],1177:[function(require,module,exports){ },{"../../../source/data/diff.js":1135,"../../../source/types/queue.js":1160,"chai":132}],1178:[function(require,module,exports){
"use strict"; "use strict";
   
var _pathfinder = require("../../../source/data/pathfinder.js"); var _pathfinder = require("../../../source/data/pathfinder.js");
...@@ -230389,7 +231258,7 @@ describe('Pathfinder', function () { ...@@ -230389,7 +231258,7 @@ describe('Pathfinder', function () {
}); });
}); });
   
},{"../../../source/data/pathfinder.js":1136,"chai":132}],1178:[function(require,module,exports){ },{"../../../source/data/pathfinder.js":1136,"chai":132}],1179:[function(require,module,exports){
(function (global){(function (){ (function (global){(function (){
"use strict"; "use strict";
   
...@@ -230450,7 +231319,7 @@ describe('Pipe', function () { ...@@ -230450,7 +231319,7 @@ describe('Pipe', function () {
}); });
   
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../../../source/data/pipe.js":1137,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1179:[function(require,module,exports){ },{"../../../source/data/pipe.js":1137,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1180:[function(require,module,exports){
(function (global){(function (){ (function (global){(function (){
"use strict"; "use strict";
   
...@@ -230560,7 +231429,7 @@ describe('Transformer', function () { ...@@ -230560,7 +231429,7 @@ describe('Transformer', function () {
}); });
   
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../../../source/data/transformer.js":1138,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132,"jsdom":337}],1180:[function(require,module,exports){ },{"../../../source/data/transformer.js":1138,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132,"jsdom":337}],1181:[function(require,module,exports){
'use strict'; 'use strict';
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -230626,7 +231495,110 @@ describe('Assembler', function () { ...@@ -230626,7 +231495,110 @@ describe('Assembler', function () {
}); });
}); });
   
},{"../../../source/dom/assembler.js":1139,"../../util/jsdom.js":1210,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/regenerator":28,"chai":132}],1181:[function(require,module,exports){ },{"../../../source/dom/assembler.js":1139,"../../util/jsdom.js":1212,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/regenerator":28,"chai":132}],1182:[function(require,module,exports){
'use strict';
var _chai = require("chai");
var _attributes = require("../../../source/dom/attributes.js");
var _jsdom = require("../../util/jsdom.js");
var html1 = "<div id=\"test1\"></div>";
describe('Attributes', function () {
before(function (done) {
(0, _jsdom.initJSDOM)().then(function () {
done();
});
});
describe('ObjectLink', function () {
var symbol = Symbol('mytest');
beforeEach(function () {
var mocks = document.getElementById('mocks');
mocks.innerHTML = html1;
});
afterEach(function () {
var mocks = document.getElementById('mocks');
mocks.innerHTML = "";
});
it('should handle object-links', function () {
var obj = {
a: 1
};
var element = document.getElementById('test1');
(0, _chai.expect)((0, _attributes.hasObjectLink)(element, symbol)).to.be["false"];
(0, _attributes.addToObjectLink)(element, symbol, obj);
(0, _chai.expect)((0, _attributes.hasObjectLink)(element, symbol)).to.be["true"];
var o = (0, _attributes.getLinkedObjects)(element, symbol).next();
(0, _chai.expect)(o.value).to.equal(obj);
(0, _attributes.removeObjectLink)(element, symbol);
(0, _chai.expect)((0, _attributes.hasObjectLink)(element, symbol)).to.be["false"];
(0, _chai.expect)(function () {
return (0, _attributes.getLinkedObjects)(element, symbol);
}).to["throw"](Error);
});
});
describe('Attributes', function () {
beforeEach(function () {
var mocks = document.getElementById('mocks');
mocks.innerHTML = html1;
});
afterEach(function () {
var mocks = document.getElementById('mocks');
mocks.innerHTML = "";
});
var atributeKey = 'data-test';
it('toggleAttributeToken(element, key, value)', function () {
var element = document.getElementById('test1');
(0, _chai.expect)(element.hasAttribute(atributeKey)).to.be["false"];
element.setAttribute(atributeKey, 'apple bananna');
(0, _attributes.toggleAttributeToken)(element, atributeKey, 'pinapple');
(0, _chai.expect)(element.getAttribute(atributeKey)).to.be.equal('apple bananna pinapple');
(0, _attributes.toggleAttributeToken)(element, atributeKey, 'pinapple');
(0, _chai.expect)(element.getAttribute(atributeKey)).to.be.equal('apple bananna');
});
it('addAttributeToken(element, key, value)', function () {
var element = document.getElementById('test1');
(0, _chai.expect)(element.hasAttribute(atributeKey)).to.be["false"];
(0, _attributes.addAttributeToken)(element, atributeKey, 'pinapple');
(0, _chai.expect)(element.getAttribute(atributeKey)).to.be.equal('pinapple');
(0, _attributes.addAttributeToken)(element, atributeKey, 'bananna');
(0, _chai.expect)(element.getAttribute(atributeKey)).to.be.equal('pinapple bananna');
});
it('removeAttributeToken(element, key, value)', function () {
var element = document.getElementById('test1');
element.setAttribute(atributeKey, 'apple bananna lemmon');
(0, _attributes.removeAttributeToken)(element, atributeKey, 'pinapple');
(0, _chai.expect)(element.getAttribute(atributeKey)).to.be.equal('apple bananna lemmon');
(0, _attributes.removeAttributeToken)(element, atributeKey, 'bananna');
(0, _chai.expect)(element.getAttribute(atributeKey)).to.be.equal('apple lemmon');
});
it('containsAttributeToken(element, key, value)', function () {
var element = document.getElementById('test1');
(0, _chai.expect)((0, _attributes.containsAttributeToken)(element, atributeKey, 'pinapple')).to.be["false"];
element.setAttribute(atributeKey, 'apple bananna');
(0, _chai.expect)((0, _attributes.containsAttributeToken)(element, atributeKey, 'pinapple')).to.be["false"];
(0, _chai.expect)((0, _attributes.containsAttributeToken)(element, atributeKey, 'bananna')).to.be["true"];
(0, _chai.expect)((0, _attributes.containsAttributeToken)(element, atributeKey, 'apple')).to.be["true"];
});
it(' replaceAttributeToken(element, key, value)', function () {
var element = document.getElementById('test1');
element.setAttribute(atributeKey, 'apple bananna tomato');
(0, _attributes.replaceAttributeToken)(element, atributeKey, 'tomato', 'lemmon');
(0, _chai.expect)(element.getAttribute(atributeKey)).to.be.equal('apple bananna lemmon');
(0, _attributes.replaceAttributeToken)(element, atributeKey, 'bananna', 'pear');
(0, _chai.expect)(element.getAttribute(atributeKey)).to.be.equal('apple pear lemmon');
});
it('clearAttributeTokens(element, key)', function () {
var element = document.getElementById('test1');
element.setAttribute(atributeKey, 'apple bananna');
(0, _attributes.clearAttributeTokens)(element, atributeKey);
(0, _chai.expect)(element.getAttribute(atributeKey)).to.be.equal('');
});
});
});
},{"../../../source/dom/attributes.js":1140,"../../util/jsdom.js":1212,"chai":132}],1183:[function(require,module,exports){
'use strict'; // 'use strict'; //
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -230702,7 +231674,7 @@ describe('DOM', function () { ...@@ -230702,7 +231674,7 @@ describe('DOM', function () {
}); });
}); });
   
},{"../../../source/dom/customelement.js":1141,"../../util/jsdom.js":1210,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/typeof":24,"chai":132}],1182:[function(require,module,exports){ },{"../../../source/dom/customelement.js":1142,"../../util/jsdom.js":1212,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"@babel/runtime/helpers/typeof":24,"chai":132}],1184:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -230785,7 +231757,7 @@ describe('Handle', function () { ...@@ -230785,7 +231757,7 @@ describe('Handle', function () {
}); });
}); });
   
},{"../../../source/dom/handle.js":1142,"../../../source/dom/util.js":1146,"../../../source/types/global.js":1153,"../../../source/types/proxyobserver.js":1158,"../../util/jsdom.js":1210,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/regenerator":28,"chai":132}],1183:[function(require,module,exports){ },{"../../../source/dom/handle.js":1143,"../../../source/dom/util.js":1147,"../../../source/types/global.js":1154,"../../../source/types/proxyobserver.js":1159,"../../util/jsdom.js":1212,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/regenerator":28,"chai":132}],1185:[function(require,module,exports){
'use strict'; 'use strict';
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -230842,7 +231814,7 @@ describe('Template', function () { ...@@ -230842,7 +231814,7 @@ describe('Template', function () {
}); });
}); });
   
},{"../../../source/dom/template.js":1143,"../../util/jsdom.js":1210,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/regenerator":28,"chai":132}],1184:[function(require,module,exports){ },{"../../../source/dom/template.js":1144,"../../util/jsdom.js":1212,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/regenerator":28,"chai":132}],1186:[function(require,module,exports){
'use strict'; 'use strict';
   
var _util = require("../../../source/dom/util.js"); var _util = require("../../../source/dom/util.js");
...@@ -230898,7 +231870,7 @@ describe('Theme', function () { ...@@ -230898,7 +231870,7 @@ describe('Theme', function () {
}); });
}); });
   
},{"../../../source/dom/theme.js":1144,"../../../source/dom/util.js":1146,"../../util/jsdom.js":1210,"chai":132}],1185:[function(require,module,exports){ },{"../../../source/dom/theme.js":1145,"../../../source/dom/util.js":1147,"../../util/jsdom.js":1212,"chai":132}],1187:[function(require,module,exports){
'use strict'; 'use strict';
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -230918,7 +231890,8 @@ var expect = _chai["default"].expect; ...@@ -230918,7 +231890,8 @@ var expect = _chai["default"].expect;
_chai["default"].use(_chaiDom.chaiDom); _chai["default"].use(_chaiDom.chaiDom);
   
var html1 = "\n <template id=\"current\">\n <li data-monster-replace=\"path:current | tojson\"></li>\n </template>\n <div id=\"test1\">\n <ul data-monster-insert=\"current path:a.b\">\n </ul>\n </div>\n"; var html1 = "\n <template id=\"current\">\n <li data-monster-replace=\"path:current | tojson\"></li>\n </template>\n <div id=\"test1\">\n <ul data-monster-insert=\"current path:a.b\">\n </ul>\n </div>\n";
var html2 = "\n <div id=\"test1\">\n <div data-monster-replace=\"path:text | tolower\"> </div>\n <div data-monster-replace=\"path:text | call:myformatter\"> </div>\n </div>\n"; var html2 = "\n <div id=\"test1\">\n <div data-monster-replace=\"path:text | tolower\"> </div>\n <div data-monster-replace=\"path:text | call:myformatter\"> </div>\n <div data-monster-replace=\"static:hello\"></div>\n </div>\n";
var html3 = "\n\n<template id=\"myinnerid\">\n <span data-monster-replace=\"path:myinnerid | tojson\"></span>\n</template>\n\n<template id=\"myid\">\n <p data-monster-insert=\"myinnerid path:a.b\"></p>\n</template>\n\n<div id=\"test1\">\n <div data-monster-insert=\"myid path:a.b\"></div>\n</div>\n\n";
describe('DOM', function () { describe('DOM', function () {
before(function (done) { before(function (done) {
(0, _jsdom.initJSDOM)().then(function () { (0, _jsdom.initJSDOM)().then(function () {
...@@ -230933,9 +231906,6 @@ describe('DOM', function () { ...@@ -230933,9 +231906,6 @@ describe('DOM', function () {
var mocks = document.getElementById('mocks'); var mocks = document.getElementById('mocks');
mocks.innerHTML = ""; mocks.innerHTML = "";
}); });
describe('Updater()', function () {
describe('Example code', function () {});
});
describe('Updater()', function () { describe('Updater()', function () {
describe('test Errors', function () { describe('test Errors', function () {
it('should throw value is not an instance of HTMLElement Error', function () { it('should throw value is not an instance of HTMLElement Error', function () {
...@@ -230943,10 +231913,10 @@ describe('DOM', function () { ...@@ -230943,10 +231913,10 @@ describe('DOM', function () {
return new _updater.Updater(); return new _updater.Updater();
}).to["throw"](TypeError); }).to["throw"](TypeError);
}); });
it('should throw value is not an instance of HTMLElement Error', function () { it('should throw value is wrong', function () {
var element = document.getElementById('test1'); var element = document.getElementById('test1');
expect(function () { expect(function () {
return new _updater.Updater(element); return new _updater.Updater(element, null);
}).to["throw"](TypeError); }).to["throw"](TypeError);
}); });
it('should throw Error: the value is not iterable', function (done) { it('should throw Error: the value is not iterable', function (done) {
...@@ -231028,6 +231998,34 @@ describe('DOM', function () { ...@@ -231028,6 +231998,34 @@ describe('DOM', function () {
expect((0, _typeof2["default"])(d)).is.equal('object'); expect((0, _typeof2["default"])(d)).is.equal('object');
expect(element).contain.html('<div data-monster-replace="path:text | tolower">hallo</div>'); expect(element).contain.html('<div data-monster-replace="path:text | tolower">hallo</div>');
expect(element).contain.html('<div data-monster-replace="path:text | call:myformatter">HALLOyes!</div>'); expect(element).contain.html('<div data-monster-replace="path:text | call:myformatter">HALLOyes!</div>');
expect(element).contain.html('<div data-monster-replace="static:hello">hello</div>');
done();
})["catch"](function (e) {
done(new Error(e));
});
});
});
});
describe('Updater()', function () {
beforeEach(function () {
var mocks = document.getElementById('mocks');
mocks.innerHTML = html3;
});
describe('Replace', function () {
it('should ', function (done) {
var element = document.getElementById('test1');
var d = new _updater.Updater(element, {
a: {
b: [{
i: '0'
}]
}
});
d.run().then(function () {
expect((0, _typeof2["default"])(d)).is.equal('object');
expect(element).contain.html('<div data-monster-insert="myid path:a.b">');
expect(element).contain.html('<p data-monster-insert="myinnerid path:a.b" data-monster-insert-reference="myid-0">');
expect(element).contain.html('<span data-monster-replace="path:a.b.0 | tojson" data-monster-insert-reference="myinnerid-0">{"i":"0"}</span>');
done(); done();
})["catch"](function (e) { })["catch"](function (e) {
done(new Error(e)); done(new Error(e));
...@@ -231037,7 +232035,7 @@ describe('DOM', function () { ...@@ -231037,7 +232035,7 @@ describe('DOM', function () {
}); });
}); });
   
},{"../../../source/dom/updater.js":1145,"../../util/chai-dom.js":1209,"../../util/jsdom.js":1210,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"chai":132}],1186:[function(require,module,exports){ },{"../../../source/dom/updater.js":1146,"../../util/chai-dom.js":1211,"../../util/jsdom.js":1212,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"chai":132}],1188:[function(require,module,exports){
'use strict'; 'use strict';
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -231098,7 +232096,7 @@ describe('DOM', function () { ...@@ -231098,7 +232096,7 @@ describe('DOM', function () {
}); });
}); });
   
},{"../../../source/dom/util.js":1146,"../../util/jsdom.js":1210,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"@babel/runtime/regenerator":28,"chai":132}],1187:[function(require,module,exports){ },{"../../../source/dom/util.js":1147,"../../util/jsdom.js":1212,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"@babel/runtime/regenerator":28,"chai":132}],1189:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -231269,7 +232267,7 @@ describe('Logging', function () { ...@@ -231269,7 +232267,7 @@ describe('Logging', function () {
}); });
}); });
   
},{"../../../source/logging/handler.js":1147,"../../../source/logging/logentry.js":1148,"../../../source/logging/logger.js":1149,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/get":9,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"chai":132}],1188:[function(require,module,exports){ },{"../../../source/logging/handler.js":1148,"../../../source/logging/logentry.js":1149,"../../../source/logging/logger.js":1150,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/get":9,"@babel/runtime/helpers/getPrototypeOf":10,"@babel/runtime/helpers/inherits":11,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/possibleConstructorReturn":19,"chai":132}],1190:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -231300,7 +232298,7 @@ describe('Log', function () { ...@@ -231300,7 +232298,7 @@ describe('Log', function () {
}); });
}); });
   
},{"../../../source/logging/logentry.js":1148,"chai":132}],1189:[function(require,module,exports){ },{"../../../source/logging/logentry.js":1149,"chai":132}],1191:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -231363,7 +232361,7 @@ describe('Logging', function () { ...@@ -231363,7 +232361,7 @@ describe('Logging', function () {
}); });
}); });
   
},{"../../../source/logging/logger.js":1149,"chai":132}],1190:[function(require,module,exports){ },{"../../../source/logging/logger.js":1150,"chai":132}],1192:[function(require,module,exports){
(function (global){(function (){ (function (global){(function (){
"use strict"; "use strict";
   
...@@ -231415,7 +232413,7 @@ describe('Math', function () { ...@@ -231415,7 +232413,7 @@ describe('Math', function () {
}); });
   
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../../../source/math/random.js":1150,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1191:[function(require,module,exports){ },{"../../../source/math/random.js":1151,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1193:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -231427,7 +232425,7 @@ describe('Monster', function () { ...@@ -231427,7 +232425,7 @@ describe('Monster', function () {
var monsterVersion; var monsterVersion;
/**#@+ dont touch, replaced by make with package.json version */ /**#@+ dont touch, replaced by make with package.json version */
   
monsterVersion = new _version.Version('1.8.0'); monsterVersion = new _version.Version('1.9.0');
/**#@-*/ /**#@-*/
   
var m = _version.Monster.getVersion(); var m = _version.Monster.getVersion();
...@@ -231438,7 +232436,7 @@ describe('Monster', function () { ...@@ -231438,7 +232436,7 @@ describe('Monster', function () {
}); });
}); });
   
},{"../../source/types/version.js":1166,"chai":132}],1192:[function(require,module,exports){ },{"../../source/types/version.js":1167,"chai":132}],1194:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -231456,7 +232454,7 @@ describe('Base', function () { ...@@ -231456,7 +232454,7 @@ describe('Base', function () {
}); });
}); });
   
},{"../../../source/types/base.js":1152,"chai":132}],1193:[function(require,module,exports){ },{"../../../source/types/base.js":1153,"chai":132}],1195:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -231488,7 +232486,7 @@ describe('Global', function () { ...@@ -231488,7 +232486,7 @@ describe('Global', function () {
}); });
}); });
   
},{"../../../source/types/global.js":1153,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"chai":132}],1194:[function(require,module,exports){ },{"../../../source/types/global.js":1154,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"chai":132}],1196:[function(require,module,exports){
(function (global){(function (){ (function (global){(function (){
"use strict"; "use strict";
   
...@@ -231524,7 +232522,7 @@ describe('ID', function () { ...@@ -231524,7 +232522,7 @@ describe('ID', function () {
}); });
   
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../../../source/types/id.js":1154,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1195:[function(require,module,exports){ },{"../../../source/types/id.js":1155,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1197:[function(require,module,exports){
(function (global){(function (){ (function (global){(function (){
"use strict"; "use strict";
   
...@@ -231560,6 +232558,15 @@ describe('Is', function () { ...@@ -231560,6 +232558,15 @@ describe('Is', function () {
}); });
}); });
}); });
describe('.isSymbol()', function () {
[['test1', false], [undefined, false], [null, false], [function () {}, false], [2, false], [parseInt("a"), false], [false, false], [true, false], [4.5, false], [{}, false], [[1, 2, 3], false], [Symbol("foo"), true]].forEach(function (data) {
var a = data.shift();
var b = data.shift();
it('is.isSymbol(' + (0, _typeof2["default"])(a) + ') should return ' + b, function () {
(0, _chai.expect)((0, _is.isSymbol)(a)).is.equal(b);
});
});
});
describe('.isInteger()', function () { describe('.isInteger()', function () {
[['test1', false], [undefined, false], [null, false], [function () {}, false], [2, true], [parseInt("a"), false], [false, false], [true, false], [4.5, false], [{}, false], [[1, 2, 3], false], [Symbol("foo"), false]].forEach(function (data) { [['test1', false], [undefined, false], [null, false], [function () {}, false], [2, true], [parseInt("a"), false], [false, false], [true, false], [4.5, false], [{}, false], [[1, 2, 3], false], [Symbol("foo"), false]].forEach(function (data) {
var a = data.shift(); var a = data.shift();
...@@ -231636,7 +232643,7 @@ describe('Is', function () { ...@@ -231636,7 +232643,7 @@ describe('Is', function () {
}); });
   
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../../../source/types/id.js":1154,"../../../source/types/is.js":1155,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1196:[function(require,module,exports){ },{"../../../source/types/id.js":1155,"../../../source/types/is.js":1156,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1198:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -231728,7 +232735,7 @@ describe('Observer', function () { ...@@ -231728,7 +232735,7 @@ describe('Observer', function () {
}); });
}); });
   
},{"../../../source/types/observer.js":1156,"chai":132}],1197:[function(require,module,exports){ },{"../../../source/types/observer.js":1157,"chai":132}],1199:[function(require,module,exports){
"use strict"; "use strict";
   
var _observerlist = require("../../../source/types/observerlist.js"); var _observerlist = require("../../../source/types/observerlist.js");
...@@ -231805,7 +232812,7 @@ describe('ObserverList', function () { ...@@ -231805,7 +232812,7 @@ describe('ObserverList', function () {
}); });
}); });
   
},{"../../../source/types/observer.js":1156,"../../../source/types/observerlist.js":1157,"chai":132}],1198:[function(require,module,exports){ },{"../../../source/types/observer.js":1157,"../../../source/types/observerlist.js":1158,"chai":132}],1200:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -231899,7 +232906,7 @@ describe('ProxyObserver', function () { ...@@ -231899,7 +232906,7 @@ describe('ProxyObserver', function () {
}); });
}); });
   
},{"../../../source/types/is.js":1155,"../../../source/types/observer.js":1156,"../../../source/types/proxyobserver.js":1158,"chai":132}],1199:[function(require,module,exports){ },{"../../../source/types/is.js":1156,"../../../source/types/observer.js":1157,"../../../source/types/proxyobserver.js":1159,"chai":132}],1201:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -231940,7 +232947,7 @@ describe('Queue', function () { ...@@ -231940,7 +232947,7 @@ describe('Queue', function () {
}); });
}); });
   
},{"../../../source/types/queue.js":1159,"chai":132}],1200:[function(require,module,exports){ },{"../../../source/types/queue.js":1160,"chai":132}],1202:[function(require,module,exports){
(function (global){(function (){ (function (global){(function (){
"use strict"; "use strict";
   
...@@ -231971,7 +232978,7 @@ describe('RandomID', function () { ...@@ -231971,7 +232978,7 @@ describe('RandomID', function () {
}); });
   
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../../../source/types/randomid.js":1160,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1201:[function(require,module,exports){ },{"../../../source/types/randomid.js":1161,"@babel/runtime/helpers/typeof":24,"@peculiar/webcrypto":46,"chai":132}],1203:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -232012,7 +233019,7 @@ describe('Stack', function () { ...@@ -232012,7 +233019,7 @@ describe('Stack', function () {
}); });
}); });
   
},{"../../../source/types/stack.js":1161,"chai":132}],1202:[function(require,module,exports){ },{"../../../source/types/stack.js":1162,"chai":132}],1204:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -232209,7 +233216,7 @@ describe('TokenList', function () { ...@@ -232209,7 +233216,7 @@ describe('TokenList', function () {
}); });
}); });
   
},{"../../../source/types/tokenlist.js":1162,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/toConsumableArray":23,"@babel/runtime/helpers/typeof":24,"chai":132}],1203:[function(require,module,exports){ },{"../../../source/types/tokenlist.js":1163,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/toConsumableArray":23,"@babel/runtime/helpers/typeof":24,"chai":132}],1205:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -232244,7 +233251,7 @@ describe('typeOf', function () { ...@@ -232244,7 +233251,7 @@ describe('typeOf', function () {
}); });
}); });
   
},{"../../../source/types/stack.js":1161,"../../../source/types/typeof.js":1163,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/regenerator":28,"chai":132}],1204:[function(require,module,exports){ },{"../../../source/types/stack.js":1162,"../../../source/types/typeof.js":1164,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/regenerator":28,"chai":132}],1206:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -232330,7 +233337,7 @@ describe('UniqueQueue', function () { ...@@ -232330,7 +233337,7 @@ describe('UniqueQueue', function () {
}); });
}); });
   
},{"../../../source/types/uniquequeue.js":1164,"chai":132}],1205:[function(require,module,exports){ },{"../../../source/types/uniquequeue.js":1165,"chai":132}],1207:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -232382,6 +233389,24 @@ describe('validate', function () { ...@@ -232382,6 +233389,24 @@ describe('validate', function () {
} }
}); });
}); });
describe('.validateSymbol()', function () {
[['test1', false], [undefined, false], [null, false], [function () {}, false], [2, false], [false, false], [true, false], [4.5, false], [{}, false], [[1, 2, 3], false], [Symbol("foo"), true]].forEach(function (data) {
var a = data.shift();
var b = data.shift();
if (b === false) {
it('.validateSymbol(' + (0, _typeof2["default"])(a) + ') should throw TypeException ' + b, function () {
(0, _chai.expect)(function () {
return (0, _validate.validateSymbol)(a);
}).to["throw"](TypeError);
});
} else {
it('.validateSymbol(' + (0, _typeof2["default"])(a) + ') should not throw TypeException ' + b, function () {
(0, _chai.expect)((0, _validate.validateSymbol)(a)).to.be.equal(a);
});
}
});
});
describe('.validateIterable()', function () { describe('.validateIterable()', function () {
[['test1', true], [undefined, false], [null, false], [function () {}, false], [2, false], [false, false], [true, false], [4.5, false], [{}, false], [[1, 2, 3], true], [Symbol("foo"), false]].forEach(function (data) { [['test1', true], [undefined, false], [null, false], [function () {}, false], [2, false], [false, false], [true, false], [4.5, false], [{}, false], [[1, 2, 3], true], [Symbol("foo"), false]].forEach(function (data) {
var a = data.shift(); var a = data.shift();
...@@ -232518,7 +233543,7 @@ describe('validate', function () { ...@@ -232518,7 +233543,7 @@ describe('validate', function () {
}); });
}); });
   
},{"../../../source/types/base.js":1152,"../../../source/types/id.js":1154,"../../../source/types/validate.js":1165,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"chai":132}],1206:[function(require,module,exports){ },{"../../../source/types/base.js":1153,"../../../source/types/id.js":1155,"../../../source/types/validate.js":1166,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"chai":132}],1208:[function(require,module,exports){
"use strict"; "use strict";
   
var _version = require("../../../source/types/version.js"); var _version = require("../../../source/types/version.js");
...@@ -232549,7 +233574,7 @@ describe('Version', function () { ...@@ -232549,7 +233574,7 @@ describe('Version', function () {
}); });
}); });
   
},{"../../../source/types/version.js":1166,"chai":132}],1207:[function(require,module,exports){ },{"../../../source/types/version.js":1167,"chai":132}],1209:[function(require,module,exports){
"use strict"; "use strict";
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -232661,7 +233686,7 @@ describe('Clone', function () { ...@@ -232661,7 +233686,7 @@ describe('Clone', function () {
}); });
}); });
   
},{"../../../source/util/clone.js":1167,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"chai":132}],1208:[function(require,module,exports){ },{"../../../source/util/clone.js":1168,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"chai":132}],1210:[function(require,module,exports){
"use strict"; "use strict";
   
var _chai = require("chai"); var _chai = require("chai");
...@@ -232778,7 +233803,7 @@ describe('Comparator', function () { ...@@ -232778,7 +233803,7 @@ describe('Comparator', function () {
}); });
}); });
   
},{"../../../source/util/comparator.js":1168,"chai":132}],1209:[function(require,module,exports){ },{"../../../source/util/comparator.js":1169,"chai":132}],1211:[function(require,module,exports){
"use strict"; "use strict";
   
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
...@@ -233026,7 +234051,7 @@ function chaiDom(chai, utils) { ...@@ -233026,7 +234051,7 @@ function chaiDom(chai, utils) {
}); });
} }
   
},{}],1210:[function(require,module,exports){ },{}],1212:[function(require,module,exports){
'use strict'; 'use strict';
   
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
...@@ -233079,7 +234104,7 @@ function initJSDOM() { ...@@ -233079,7 +234104,7 @@ function initJSDOM() {
}); });
} }
   
},{"../../source/types/global.js":1153,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"jsdom":337}],1211:[function(require,module,exports){ },{"../../source/types/global.js":1154,"@babel/runtime/helpers/interopRequireDefault":12,"@babel/runtime/helpers/typeof":24,"jsdom":337}],1213:[function(require,module,exports){
"use strict"; "use strict";
   
require("../cases/logging/logger.js"); require("../cases/logging/logger.js");
...@@ -233092,6 +234117,8 @@ require("../cases/dom/handle.js"); ...@@ -233092,6 +234117,8 @@ require("../cases/dom/handle.js");
   
require("../cases/dom/updater.js"); require("../cases/dom/updater.js");
   
require("../cases/dom/attributes.js");
require("../cases/dom/template.js"); require("../cases/dom/template.js");
   
require("../cases/dom/util.js"); require("../cases/dom/util.js");
...@@ -233165,6 +234192,6 @@ require("../cases/monster.js"); ...@@ -233165,6 +234192,6 @@ require("../cases/monster.js");
/** this file was created automatically by the make target test-browser-monster */ /** this file was created automatically by the make target test-browser-monster */
SharedArrayBuffer = ArrayBuffer; SharedArrayBuffer = ArrayBuffer;
   
},{"../cases/constraint/andoperator.js":1169,"../cases/constraint/invalid.js":1170,"../cases/constraint/isarray.js":1171,"../cases/constraint/isobject.js":1172,"../cases/constraint/oroperator.js":1173,"../cases/constraint/valid.js":1174,"../cases/data/buildmap.js":1175,"../cases/data/diff.js":1176,"../cases/data/pathfinder.js":1177,"../cases/data/pipe.js":1178,"../cases/data/transformer.js":1179,"../cases/dom/assembler.js":1180,"../cases/dom/customelement.js":1181,"../cases/dom/handle.js":1182,"../cases/dom/template.js":1183,"../cases/dom/theme.js":1184,"../cases/dom/updater.js":1185,"../cases/dom/util.js":1186,"../cases/logging/handler.js":1187,"../cases/logging/logentry.js":1188,"../cases/logging/logger.js":1189,"../cases/math/random.js":1190,"../cases/monster.js":1191,"../cases/types/base.js":1192,"../cases/types/global.js":1193,"../cases/types/id.js":1194,"../cases/types/is.js":1195,"../cases/types/observer.js":1196,"../cases/types/observerlist.js":1197,"../cases/types/proxyobserver.js":1198,"../cases/types/queue.js":1199,"../cases/types/randomid.js":1200,"../cases/types/stack.js":1201,"../cases/types/tokenlist.js":1202,"../cases/types/typeof.js":1203,"../cases/types/uniquequeue.js":1204,"../cases/types/validate.js":1205,"../cases/types/version.js":1206,"../cases/util/clone.js":1207,"../cases/util/comparator.js":1208}],1212:[function(require,module,exports){ },{"../cases/constraint/andoperator.js":1170,"../cases/constraint/invalid.js":1171,"../cases/constraint/isarray.js":1172,"../cases/constraint/isobject.js":1173,"../cases/constraint/oroperator.js":1174,"../cases/constraint/valid.js":1175,"../cases/data/buildmap.js":1176,"../cases/data/diff.js":1177,"../cases/data/pathfinder.js":1178,"../cases/data/pipe.js":1179,"../cases/data/transformer.js":1180,"../cases/dom/assembler.js":1181,"../cases/dom/attributes.js":1182,"../cases/dom/customelement.js":1183,"../cases/dom/handle.js":1184,"../cases/dom/template.js":1185,"../cases/dom/theme.js":1186,"../cases/dom/updater.js":1187,"../cases/dom/util.js":1188,"../cases/logging/handler.js":1189,"../cases/logging/logentry.js":1190,"../cases/logging/logger.js":1191,"../cases/math/random.js":1192,"../cases/monster.js":1193,"../cases/types/base.js":1194,"../cases/types/global.js":1195,"../cases/types/id.js":1196,"../cases/types/is.js":1197,"../cases/types/observer.js":1198,"../cases/types/observerlist.js":1199,"../cases/types/proxyobserver.js":1200,"../cases/types/queue.js":1201,"../cases/types/randomid.js":1202,"../cases/types/stack.js":1203,"../cases/types/tokenlist.js":1204,"../cases/types/typeof.js":1205,"../cases/types/uniquequeue.js":1206,"../cases/types/validate.js":1207,"../cases/types/version.js":1208,"../cases/util/clone.js":1209,"../cases/util/comparator.js":1210}],1214:[function(require,module,exports){
arguments[4][81][0].apply(exports,arguments) arguments[4][81][0].apply(exports,arguments)
},{"dup":81}]},{},[1211]); },{"dup":81}]},{},[1213]);
Monster uses a DOM-based template approach. All Monster templates are Monster's updater uses a DOM-based approach. The configuration and the template system are valid and parsable HTML.
valid, parsable HTML that has been extended with some special attributes.
## replace The configuration is done via some special attributes with a `data-monster` prefix.
The simplest manipulation is to replace the content of a tag. Code is always the most informative. So let's take a look at a complete example right away.
To do this, simply use the `data-monster-replace` attribute.
``` ```
<div data-monster-replace="static:hello"></div> // The first thing to do is to include the Updater class.
import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/updater.js';
// Now we prepare the html document.
// This is done here via script, but can also be inserted into the document as pure html.
// To do this, simply insert the tag <h1 data-monster-replace="path:headline"></h1>.
const body = document.querySelector('body');
const headline = document.createElement('h1');
headline.setAttribute('data-monster-replace','path:headline')
body.appendChild(headline);
// the data structure
let obj = {
headline: "Go!",
};
// Now comes the real magic. we pass the updater the parent HTMLElement
// and the desired data structure.
const updater = new Updater(body, obj);
// now we get the used data structure. why can't we take the original structure?
// the updater puts a proxy over the data structure and thus allows to monitor changes.
// We would not see changes to the original object.
const subject = updater.getSubject();
// now start the updater
updater.run();
// Now you can change the data structure and the HTML will follow these changes.
// to illustrate, let's put the change into a timer call.
setTimeout(function(){
console.log(obj);
subject['headline'] = "Hello!"
},1000);
```
We have seen how we can change the content of an htm element. now let's look at what options are available.
## Replace
The simplest manipulation is to replace the content of a HTMLElement.
To do this, simply use the `data-monster-replace` attribute (see example).
The syntax is quite simple. The result of the attribute pipe is inserted as content of the
HTMLElement. For the processing the [Pipe](Monster_Data.Pipe.html)<!-- @IGNORE PREVIOUS: link --> and [Transformer class](Monster_Data.Transformer.html)<!-- @IGNORE PREVIOUS: link -->
is used.
If, for example, you have an object `x` with the structure listed below and want to insert the value of the key b, you write: `path:a.b`.
The pipe can then be used to apply operators. For example, `tolower` can be used to convert everything to lowercase.
```
let x = {
a: {
b: "EXAMPLE"
}
}
```
this is how it looks as an attribute:
```
<div data-monster-replace="static:HELLO | tolower"></div>
``` ```
The result is then the following html: The result is then the following html:
...@@ -15,3 +78,121 @@ The result is then the following html: ...@@ -15,3 +78,121 @@ The result is then the following html:
``` ```
<div data-monster-replace="static:hello">hello</div> <div data-monster-replace="static:hello">hello</div>
``` ```
A full example looks like this:
```
import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/updater.js';
const body = document.querySelector('body');
const headline = document.createElement('h1');
headline.setAttribute('data-monster-replace','static:hello')
body.appendChild(headline);
// result in ↦ <div data-monster-replace="static:hello"></div>
new Updater(body).run();
```
## Attributes
Attributes can be added via the `data-monster-attributes` attribute. The syntax is attribute name followed by
a space and the desired pipe definition.
```
<div data-monster-attributes="id static:myid">hello</div>
```
The result is then the following html:
```
<div id="myid" data-monster-attributes="id static:myid">hello</div>
```
Multiple attributes can be separated by commas.
```
<div data-monster-attributes="id static:myid, class static:myclass">hello</div>
```
## Remove
The `data-monster-remove` attribute can be used to remove html elements. it is important to
note that this cannot be undone. Once removed, nodes will not be reinserted.
This tag is removed via the updater
```
<div data-monster-remove></div>
```
## Insert
The strongest feature is adding elements to a node. For this you need a
template and the `data-monster-instert` attribute.
The syntax of the attribute is first an id followed by a space. This is then followed by the pipe command.
the values for the corresponding data must be available as an array.
```
let obj = {
a: [
{"id": 1},
{"id": 2},
{"id": 3},
{"id": 4}
]
};
```
here is a full example:
```
const body = document.querySelector('body');
const li = document.createElement('li');
li.innerHTML="-/-";
li.setAttribute('data-monster-replace','path:myid | index:id | tostring | prefix:x');
const template = document.createElement('template');
template.setAttribute('id','myid');
template.content.appendChild(li);
body.appendChild(template);
const list = document.createElement('ul');
list.setAttribute('data-monster-insert', 'myid path:a')
body.appendChild(list);
let obj = {
a: [
{"id": 1},
{"id": 2},
{"id": 3},
{"id": 4}
]
};
const updater = new Updater(body, obj)
updater.run();
```
the result will be
```
<ul data-monster-insert="myid path:a">
<li data-monster-replace="path:a.0 | index:id | tostring | prefix:x" data-monster-insert-reference="myid-0">x1</li>
<li data-monster-replace="path:a.1 | index:id | tostring | prefix:x" data-monster-insert-reference="myid-1">x2</li>
<li data-monster-replace="path:a.2 | index:id | tostring | prefix:x" data-monster-insert-reference="myid-2">x3</li>
<li data-monster-replace="path:a.3 | index:id | tostring | prefix:x" data-monster-insert-reference="myid-3">x4</li>
</ul>
```
You can easily add and delete values to the array. The DOM will be adjusted accordingly.
The attribute `data-monster-insert-reference` identifies if the entry already exists.
<template id="example1">
<style>
[readonly] {
background-color: #e9e9e9;
border: 1px solid grey;
}
.tbl {
display: flex;
flex-direction: column;
}
.row {
display: flex;
min-height: 50px;
}
.cell {
flex: 1;
border-bottom: 1px solid #b0b0b0;
padding: 1em;
}
</style>
<div id="container" class="tbl">
<div class="row">
<div class="cell"><select type="input" data-monster-bind="path:value.multiple" multiple>
<option value="a" data-monster-attributes="selected path:value.multiple | call:checkstate">A</option>
<option value="b" data-monster-attributes="selected path:value.multiple | call:checkstate">B</option>
<option value="c" data-monster-attributes="selected path:value.multiple | call:checkstate">C</option>
</select></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.multiple"></div>
</div>
<div class="row">
<div class="cell"><select type="input" data-monster-bind="path:value.select"
data-monster-attributes="value path:value.select">
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
</select></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.select"></div>
</div>
<div class="row">
<div class="cell"><input type="checkbox" data-monster-bind="path:value.checkbox" value="YES"
data-monster-attributes="checked path:value.checkbox | call:checkstate"></div>
<div class="cell"><input id="my" readonly data-monster-attributes="value path:value.checkbox"></div>
</div>
<div class="row">
<div class="cell"><input type="search" name="search" data-monster-bind="path:value.search"
data-monster-attributes="value path:value.search"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.search"></div>
</div>
<div class="row">
<div class="cell"><input type="tel" name="tel" data-monster-bind="path:value.tel"
data-monster-attributes="value path:value.tel"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.tel"></div>
</div>
<div class="row">
<div class="cell"><input type="time" name="time" data-monster-bind="path:value.time"
data-monster-attributes="value path:value.time"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.time"></div>
</div>
<div class="row">
<div class="cell"><input type="url" name="url" data-monster-bind="path:value.url"
data-monster-attributes="value path:value.url"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.url"></div>
</div>
<div class="row">
<div class="cell"><input type="week" name="week" data-monster-bind="path:value.week"
data-monster-attributes="value path:value.week"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.week"></div>
</div>
<div class="row">
<div class="cell"><input type="color" name="color" data-monster-bind="path:value.color"
data-monster-attributes="value path:value.color"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.color"></div>
</div>
<div class="row">
<div class="cell"><input type="radio" name="doit" data-monster-bind="path:value.radio" value="2"
data-monster-attributes="checked path:value.radio | call:checkstate"><br>
<input type="radio" name="doit" data-monster-bind="path:value.radio" value="1"
data-monster-attributes="checked path:value.radio | call:checkstate"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.radio"></div>
</div>
<div class="row">
<div class="cell"><input type="range" name="range" data-monster-bind="path:value.range"
data-monster-attributes="value path:value.range"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.range"></div>
</div>
<div class="row">
<div class="cell"><input type="password" name="password" data-monster-bind="path:value.password"
data-monster-attributes="value path:value.password"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.password"></div>
</div>
<div class="row">
<div class="cell">
<input type="number" name="number" data-monster-bind="path:value.number"
data-monster-attributes="value path:value.number"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.number"></div>
</div>
<div class="row">
<div class="cell">
<input type="month" name="month" data-monster-bind="path:value.month"
data-monster-attributes="value path:value.month"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.month"></div>
</div>
<div class="row">
<div class="cell"><input type="email" name="email" data-monster-bind="path:value.email"
data-monster-attributes="value path:value.email"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.email"></div>
</div>
<div class="row">
<div class="cell"><input type="datetime-local" name="datetime-local"
data-monster-bind="path:value.datetime-local"
data-monster-attributes="value path:value.datetime-local"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.datetime-local"></div>
</div>
<div class="row">
<div class="cell">
<input type="date" name="date" data-monster-bind="path:value.date"
data-monster-attributes="value path:value.date"></div>
<div class="cell"><input readonly data-monster-attributes="value path:value.date"></div>
</div>
<div style="padding:20px; border:2px solid red; margin-top:20px"
data-monster-replace="path:value | tojson"></div>
</div>
</template>
<script type="module">
'use strict';
import {Updater} from "https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/dom/updater.js";
let example1 = document.getElementById('example1');
document.querySelector('article').appendChild(example1.content);
const container = document.getElementById('container');
const updater = new Updater(container, {
value: {
input: "Init Value - input",
textarea: "Init Value - textarea",
file: "Init Value - file",
checkbox: "Init Value - checkbox",
radio: "Init Value - radio",
multiple: ['a', 'c']
}
});
updater.run();
updater.enableEventProcessing();
console.log(updater);
</script>
\ No newline at end of file
...@@ -22,7 +22,7 @@ index.html. ...@@ -22,7 +22,7 @@ index.html.
</div> </div>
<script type="module"> <script type="module">
import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/types/version.js'; import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/modules/types/version.js';
document.getElementById('version').innerText = new Version('1.0.0').toString(); document.getElementById('version').innerText = new Version('1.0.0').toString();
</script> </script>
...@@ -47,7 +47,7 @@ the `Monster` namespace as a single javascript file. ...@@ -47,7 +47,7 @@ the `Monster` namespace as a single javascript file.
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>awaken the monster in you!</title> <title>awaken the monster in you!</title>
<script src="https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/monster.js"></script> <script src="https://cdn.jsdelivr.net/npm/@schukai/monster@1.9.0/dist/monster.js"></script>
</head> </head>
<body> <body>
......
...@@ -7,10 +7,13 @@ ...@@ -7,10 +7,13 @@
}, },
"getting-started": { "getting-started": {
"title": "Getting Started" "title": "Getting Started"
}
}, },
"dom-based-templating-implementation.md": { "dom-based-templating-implementation": {
"title": "DOM-based templating implementation" "title": "DOM-based templating implementation"
},
"form-example": {
"title": "Form examples"
}
} }
} }
} }
\ No newline at end of file