@schukai/monster 2.0.14 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/package.json +1 -1
- package/source/constants.mjs +15 -3
- package/source/constraints/abstract.mjs +11 -0
- package/source/constraints/abstractoperator.mjs +11 -1
- package/source/constraints/andoperator.mjs +11 -1
- package/source/constraints/invalid.mjs +11 -1
- package/source/constraints/isarray.mjs +11 -1
- package/source/constraints/isobject.mjs +11 -1
- package/source/constraints/namespace.mjs +5 -0
- package/source/constraints/oroperator.mjs +11 -1
- package/source/constraints/valid.mjs +11 -1
- package/source/data/datasource/namespace.mjs +5 -0
- package/source/data/datasource/restapi/namespace.mjs +5 -0
- package/source/data/datasource/restapi/writeerror.mjs +10 -1
- package/source/data/datasource/restapi.mjs +10 -1
- package/source/data/datasource/storage/localstorage.mjs +10 -1
- package/source/data/datasource/storage/namespace.mjs +5 -0
- package/source/data/datasource/storage/sessionstorage.mjs +10 -1
- package/source/data/datasource/storage.mjs +10 -1
- package/source/data/datasource.mjs +12 -2
- package/source/data/namespace.mjs +5 -0
- package/source/dom/customcontrol.mjs +11 -1
- package/source/dom/customelement.mjs +11 -1
- package/source/dom/focusmanager.mjs +11 -1
- package/source/dom/namespace.mjs +5 -0
- package/source/dom/resource/data.mjs +11 -1
- package/source/dom/resource/link/namespace.mjs +5 -0
- package/source/dom/resource/link/stylesheet.mjs +11 -1
- package/source/dom/resource/link.mjs +11 -1
- package/source/dom/resource/namespace.mjs +5 -0
- package/source/dom/resource/script.mjs +10 -1
- package/source/dom/resource.mjs +8 -0
- package/source/dom/template.mjs +11 -1
- package/source/dom/theme.mjs +11 -1
- package/source/dom/worker/namespace.mjs +5 -0
- package/source/i18n/namespace.mjs +5 -0
- package/source/i18n/providers/namespace.mjs +5 -0
- package/source/logging/handler/namespace.mjs +5 -0
- package/source/logging/namespace.mjs +5 -0
- package/source/math/namespace.mjs +5 -0
- package/source/text/namespace.mjs +5 -0
- package/source/types/base.mjs +100 -0
- package/source/types/dataurl.mjs +11 -1
- package/source/types/mediatype.mjs +11 -1
- package/source/types/namespace.mjs +5 -0
- package/source/types/node.mjs +11 -1
- package/source/types/nodelist.mjs +11 -1
- package/source/types/observer.mjs +11 -1
- package/source/types/proxyobserver.mjs +11 -1
- package/source/types/queue.mjs +11 -1
- package/source/types/stack.mjs +10 -1
- package/source/types/version.mjs +14 -2
- package/source/util/namespace.mjs +5 -0
- package/test/cases/constraint/abstractoperator.mjs +38 -0
- package/test/cases/dom/resource.mjs +48 -0
- package/test/cases/monster.mjs +1 -1
- package/test/cases/types/base.mjs +42 -0
- package/test/web/mocha.js +10976 -20806
- package/test/web/test.html +3 -3
- package/test/web/tests.js +68 -12
@@ -2,8 +2,29 @@
|
|
2
2
|
|
3
3
|
import {expect} from "chai"
|
4
4
|
import {Base} from "../../../../application/source/types/base.mjs";
|
5
|
+
import {instanceSymbol} from "../../../../application/source/constants.mjs";
|
5
6
|
|
6
7
|
|
8
|
+
|
9
|
+
class BaseDifferentRealm extends Object {
|
10
|
+
|
11
|
+
|
12
|
+
static get [instanceSymbol]() {
|
13
|
+
return Symbol.for("@schukai/monster/types/base");
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
}
|
18
|
+
|
19
|
+
class Subclass extends BaseDifferentRealm {
|
20
|
+
constructor() {
|
21
|
+
super();
|
22
|
+
}
|
23
|
+
static get [instanceSymbol]() {
|
24
|
+
return Symbol.for("@schukai/monster/types/subclass");
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
7
28
|
describe('Base', function () {
|
8
29
|
|
9
30
|
describe('new Base', function () {
|
@@ -17,5 +38,26 @@ describe('Base', function () {
|
|
17
38
|
});
|
18
39
|
|
19
40
|
})
|
41
|
+
|
42
|
+
describe('instancof', function () {
|
43
|
+
|
44
|
+
it('is instance of Base', function () {
|
45
|
+
expect(new Base).to.be.instanceOf(Base);
|
46
|
+
});
|
47
|
+
|
48
|
+
it('subclass instanceof', function () {
|
49
|
+
|
50
|
+
if (new Subclass instanceof Base) {
|
51
|
+
expect(true).to.be.true;
|
52
|
+
} else {
|
53
|
+
expect(false).to.be.true;
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
});
|
59
|
+
|
60
|
+
|
61
|
+
})
|
20
62
|
|
21
63
|
})
|