@es-joy/jsoe 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.eslintrc.cjs +2 -0
- package/.nyc_output/out.json +121296 -0
- package/CHANGES.md +6 -0
- package/README.md +47 -21
- package/cypress.config.ts +13 -0
- package/demo/index-instrumented.html +29 -0
- package/demo/index.html +10 -1
- package/demo/index.js +482 -126
- package/dist/formatAndTypeChoices.d.ts +2 -2
- package/dist/formatAndTypeChoices.d.ts.map +1 -1
- package/dist/formats/json.d.ts.map +1 -1
- package/dist/formats/structuredCloning.d.ts +2 -1
- package/dist/formats/structuredCloning.d.ts.map +1 -1
- package/dist/fundamentalTypes/arrayType.d.ts +6 -37
- package/dist/fundamentalTypes/arrayType.d.ts.map +1 -1
- package/dist/fundamentalTypes/dateType.d.ts.map +1 -1
- package/dist/fundamentalTypes/errorType.d.ts +6 -0
- package/dist/fundamentalTypes/errorType.d.ts.map +1 -0
- package/dist/fundamentalTypes/mapType.d.ts +6 -0
- package/dist/fundamentalTypes/mapType.d.ts.map +1 -0
- package/dist/fundamentalTypes/nullType.d.ts.map +1 -1
- package/dist/fundamentalTypes/objectReferenceType.d.ts.map +1 -1
- package/dist/fundamentalTypes/setType.d.ts +6 -0
- package/dist/fundamentalTypes/setType.d.ts.map +1 -0
- package/dist/fundamentalTypes/sparseUndefinedType.d.ts.map +1 -1
- package/dist/fundamentalTypes/undefinedType.d.ts.map +1 -1
- package/dist/subTypes/blobHTMLType.d.ts +12 -6
- package/dist/subTypes/blobHTMLType.d.ts.map +1 -1
- package/dist/superTypes/SpecialNumberType.d.ts +14 -0
- package/dist/superTypes/SpecialNumberType.d.ts.map +1 -0
- package/dist/superTypes/SpecialRealNumberType.d.ts +6 -0
- package/dist/superTypes/SpecialRealNumberType.d.ts.map +1 -0
- package/dist/superTypes/errorsSpecialType.d.ts +8 -0
- package/dist/superTypes/errorsSpecialType.d.ts.map +1 -0
- package/dist/typeChoices.d.ts +4 -2
- package/dist/typeChoices.d.ts.map +1 -1
- package/dist/types.d.ts +83 -231
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/dialogs.d.ts +22 -22
- package/dist/utils/dialogs.d.ts.map +1 -1
- package/dist/utils/templateUtils.d.ts +6 -6
- package/dist/utils/templateUtils.d.ts.map +1 -1
- package/dist/vendor-imports.d.ts +1 -1
- package/package.json +39 -34
- package/rollup.config.js +14 -2
- package/server.js +1 -1
- package/src/formatAndTypeChoices.js +9 -9
- package/src/formats/indexedDBKey.js +2 -2
- package/src/formats/json.js +1 -2
- package/src/formats/structuredCloning.js +104 -29
- package/src/formats.js +2 -2
- package/src/fundamentalTypes/arrayReferenceType.js +3 -3
- package/src/fundamentalTypes/arrayType.js +384 -79
- package/src/fundamentalTypes/dateType.js +4 -6
- package/src/fundamentalTypes/errorType.js +416 -0
- package/src/fundamentalTypes/mapType.js +34 -0
- package/src/fundamentalTypes/nullType.js +1 -2
- package/src/fundamentalTypes/objectReferenceType.js +2 -1
- package/src/fundamentalTypes/regexpType.js +2 -2
- package/src/fundamentalTypes/setType.js +34 -0
- package/src/fundamentalTypes/sparseUndefinedType.js +2 -3
- package/src/fundamentalTypes/undefinedType.js +2 -3
- package/src/jsoe.css +3 -0
- package/src/subTypes/blobHTMLType.js +37 -33
- package/src/subTypes/falseType.js +2 -2
- package/src/subTypes/trueType.js +2 -2
- package/src/superTypes/{SpecialNumberSuperType.js → SpecialNumberType.js} +1 -1
- package/src/superTypes/{SpecialRealNumberSuperType.js → SpecialRealNumberType.js} +3 -2
- package/src/superTypes/errorsSpecialType.js +768 -0
- package/src/typeChoices.js +27 -20
- package/src/types.js +71 -39
- package/src/utils/dialogs.js +11 -12
- package/src/utils/jsonPointer.js +3 -3
- package/src/utils/templateUtils.js +4 -4
- package/src/vendor-imports.js +2 -2
- package/tsconfig.json +1 -1
- package/typings/CypressPlugins.d.ts +10 -0
- package/vendor/jamilih/dist/jml-es.js +126 -106
- package/vendor/typeson-registry/dist/index.js +188 -44
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.js"],"names":[],"mappings":"AA0CO,mDAHI,iBAAiB,GACf,MAAM,CAmBlB;;;;;oCAKW,WAAW,YACV,MAAM;;;;;qCAOR,WAAW,2EAGT,oBAAoB;;;;2CAMtB,WAAW,KACT,IAAI,GAChB,gBAAoB,GAAC,mBAAmB,GAAC,iBAAiB,GAAC,iBAAiB;;;;iDAMlE,MAAM,GAAC,WAAW,yCAEhB,oBAAoB;uDAKtB,MAAM,GAAC,WAAW,KAChB,IAAI,GAAC,gBAAgB,GAAC,mBAAmB,GAAC,iBAAiB,GACvE,iBAAqB;iDAKX,MAAM,iCAEJ,aAAa,EAAE,GAAC,SAAS;sCAK3B,aAAa,KACX,CAAC,MAAM,EAAE;IAAC,KAAK,EAAE,aAAa,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;uDAKlD,MAAM,uCAEJ,CAAC,MAAM,EAAE;IAAC,KAAK,EAAE,aAAa,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,EAAE;wCAK5C;IAClB,QAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAc,CAAC,EAAE,MAAM,GAAC,MAAM,GAAC,QAAQ,CAAC;IACxC,aAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAQ,EAAE,aAAa,CAAC;IACxB,OAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAkB,CAAC,EAAE,OAAO,GAAC,SAAS,CAAC;IACvC,gBAAoB,CAAC,EAAE,OAAO,kBAAkB,EAAE,gBAAgB,CAAC;IACnE,MAAU,EAAE,OAAO,cAAc,EAAE,eAAe,CAAC;IACnD,aAAiB,C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AAkB,GAAC,WAAW,GACvD,mBAAuB,GAAC,OAAO,GAAC,QAAQ;yDAuC1B,MAAM,cACH,MAAM,6BACS,MAAM,aACtB,MAAM,KACd,WAAW;;;;;;;;;;;;0BAcE,MAAM;iCACC,OAAO;;;;;;;;0BAmKtB,cAAc;AAznB3B;;;;;GAKG;AAEH;;;;;;;;GAQG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;GAKG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAGH;;;;;;;;;;;;;;;;GAgBG;AAGH;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;EAoBE;AAEF;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAtBqB,cAAc;qBACb,eAAe;2BACT,qBAAqB;8BAClB,wBAAwB;oCAClB,8BAA8B;+BACnC,yBAAyB;sBAClC,gBAAgB;qCACD,+BAA+B;yBAC3C,mBAAmB;;;;sBAGd,aAAa;uBAAS,aAAa;;;;oBAG7C,cAAc;2BACP,qBAAqB;cAClC,QAAQ;cACR,QAAQ;uBACC,iBAAiB;;EAIxB"}
|
package/dist/utils/dialogs.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type Locale = {
|
|
|
5
5
|
declare namespace dialogs {
|
|
6
6
|
let localeStrings: Locale;
|
|
7
7
|
/**
|
|
8
|
-
* @param {Locale} [locale
|
|
8
|
+
* @param {Locale} [locale]
|
|
9
9
|
* @returns {void}
|
|
10
10
|
*/
|
|
11
11
|
function setLocale(locale?: Locale | undefined): void;
|
|
@@ -13,7 +13,7 @@ declare namespace dialogs {
|
|
|
13
13
|
* @typedef {object} MakeDialogArgs
|
|
14
14
|
* @property {import('jamilih').JamilihAttributes} [atts={}]
|
|
15
15
|
* @property {import('jamilih').JamilihChildren} [children=[]]
|
|
16
|
-
* @property {import('jamilih').EventHandler} [close]
|
|
16
|
+
* @property {import('jamilih').EventHandler|boolean} [close]
|
|
17
17
|
* @property {boolean} [remove=true]
|
|
18
18
|
*/
|
|
19
19
|
/**
|
|
@@ -23,40 +23,40 @@ declare namespace dialogs {
|
|
|
23
23
|
function makeDialog({ atts, children, close, remove }?: {
|
|
24
24
|
atts?: import("jamilih").JamilihAttributes | undefined;
|
|
25
25
|
children?: import("jamilih").JamilihChildren | undefined;
|
|
26
|
-
close?: import("jamilih").EventHandler | undefined;
|
|
26
|
+
close?: boolean | import("jamilih").EventHandler | undefined;
|
|
27
27
|
remove?: boolean | undefined;
|
|
28
28
|
}): HTMLDialogElement;
|
|
29
29
|
/**
|
|
30
30
|
* @typedef {object} MakeCancelArgs
|
|
31
31
|
* @property {(
|
|
32
32
|
* info: {e: Event, dialog: HTMLDialogElement}
|
|
33
|
-
* ) => boolean} cancel
|
|
34
|
-
* @property {string} cancelClass
|
|
35
|
-
* @property {string} submitClass
|
|
36
|
-
* @property {...MakeDialogArgs} args
|
|
33
|
+
* ) => boolean} [cancel]
|
|
34
|
+
* @property {string} [cancelClass]
|
|
35
|
+
* @property {string} [submitClass]
|
|
36
|
+
* @property {...MakeDialogArgs} [args]
|
|
37
37
|
*/
|
|
38
38
|
/**
|
|
39
39
|
* @param {MakeCancelArgs} cfg
|
|
40
40
|
* @returns {HTMLDialogElement}
|
|
41
41
|
*/
|
|
42
42
|
function makeCancelDialog({ cancel, cancelClass, submitClass, ...args }: {
|
|
43
|
-
cancel
|
|
43
|
+
cancel?: ((info: {
|
|
44
44
|
e: Event;
|
|
45
45
|
dialog: HTMLDialogElement;
|
|
46
|
-
}) => boolean;
|
|
47
|
-
cancelClass
|
|
48
|
-
submitClass
|
|
49
|
-
args
|
|
46
|
+
}) => boolean) | undefined;
|
|
47
|
+
cancelClass?: string | undefined;
|
|
48
|
+
submitClass?: string | undefined;
|
|
49
|
+
args?: {
|
|
50
50
|
atts?: import("jamilih").JamilihAttributes | undefined;
|
|
51
51
|
children?: import("jamilih").JamilihChildren | undefined;
|
|
52
|
-
close?: import("jamilih").EventHandler | undefined;
|
|
52
|
+
close?: boolean | import("jamilih").EventHandler | undefined;
|
|
53
53
|
remove?: boolean | undefined;
|
|
54
54
|
} | undefined;
|
|
55
55
|
}): HTMLDialogElement;
|
|
56
56
|
/**
|
|
57
57
|
* @param {object} cfg
|
|
58
58
|
* @param {(info: {e: Event, dialog: HTMLDialogElement}) => void} cfg.submit
|
|
59
|
-
* @param {string} [cfg.submitClass
|
|
59
|
+
* @param {string} [cfg.submitClass]
|
|
60
60
|
* @param {MakeCancelArgs} [cfg.args]
|
|
61
61
|
* @returns {HTMLDialogElement}
|
|
62
62
|
*/
|
|
@@ -67,16 +67,16 @@ declare namespace dialogs {
|
|
|
67
67
|
}) => void;
|
|
68
68
|
submitClass?: string | undefined;
|
|
69
69
|
args?: {
|
|
70
|
-
cancel
|
|
70
|
+
cancel?: ((info: {
|
|
71
71
|
e: Event;
|
|
72
72
|
dialog: HTMLDialogElement;
|
|
73
|
-
}) => boolean;
|
|
74
|
-
cancelClass
|
|
75
|
-
submitClass
|
|
76
|
-
args
|
|
73
|
+
}) => boolean) | undefined;
|
|
74
|
+
cancelClass?: string | undefined;
|
|
75
|
+
submitClass?: string | undefined;
|
|
76
|
+
args?: {
|
|
77
77
|
atts?: import("jamilih").JamilihAttributes | undefined;
|
|
78
78
|
children?: import("jamilih").JamilihChildren | undefined;
|
|
79
|
-
close?: import("jamilih").EventHandler | undefined;
|
|
79
|
+
close?: boolean | import("jamilih").EventHandler | undefined;
|
|
80
80
|
remove?: boolean | undefined;
|
|
81
81
|
} | undefined;
|
|
82
82
|
} | undefined;
|
|
@@ -94,9 +94,9 @@ declare namespace dialogs {
|
|
|
94
94
|
}): Promise<void>;
|
|
95
95
|
/**
|
|
96
96
|
* @param {object} cfg
|
|
97
|
-
* @param {import('jamilih').JamilihAttributes} [cfg.atts
|
|
97
|
+
* @param {import('jamilih').JamilihAttributes} [cfg.atts]
|
|
98
98
|
* @param {string|{message: string}} cfg.message
|
|
99
|
-
* @param {string} [cfg.submitClass
|
|
99
|
+
* @param {string} [cfg.submitClass]
|
|
100
100
|
*/
|
|
101
101
|
function confirm({ atts, message, submitClass }: {
|
|
102
102
|
atts?: import("jamilih").JamilihAttributes | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialogs.d.ts","sourceRoot":"","sources":["../../src/utils/dialogs.js"],"names":[],"mappings":";;;;;uBAiBa,MAAM;IAEjB;;;OAGG;IACH,sDAEC;IAED;;;;;;OAMG;IACH;;;OAGG;IACH;;;;;0BAmBC;IACD;;;;;;;;OAQG;IACH;;;OAGG;IACH;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dialogs.d.ts","sourceRoot":"","sources":["../../src/utils/dialogs.js"],"names":[],"mappings":";;;;;uBAiBa,MAAM;IAEjB;;;OAGG;IACH,sDAEC;IAED;;;;;;OAMG;IACH;;;OAGG;IACH;;;;;0BAmBC;IACD;;;;;;;;OAQG;IACH;;;OAGG;IACH;;;;;;;;;;;;;0BA0BC;IACD;;;;;;OAMG;IACH;;;;;;;;;;;;;;;;;;;;0BAiBC;IACD;;;;;;OAMG;IACH;;;sBAiBC;IACD;;;;;OAKG;IACH;;;;;;qBAwBC"}
|
|
@@ -14,11 +14,11 @@ export function $(sel: string): HTMLElement | null;
|
|
|
14
14
|
*/
|
|
15
15
|
export function $$(sel: string): HTMLElement[];
|
|
16
16
|
/**
|
|
17
|
-
* @param {HTMLElement|string} el
|
|
17
|
+
* @param {Element|HTMLElement|string} el
|
|
18
18
|
* @param {string} descendentsSel
|
|
19
19
|
* @returns {HTMLElement|null}
|
|
20
20
|
*/
|
|
21
|
-
export function $e(el: HTMLElement | string, descendentsSel: string): HTMLElement | null;
|
|
21
|
+
export function $e(el: Element | HTMLElement | string, descendentsSel: string): HTMLElement | null;
|
|
22
22
|
/**
|
|
23
23
|
* @param {HTMLElement|string} el
|
|
24
24
|
* @param {string} descendentsSel
|
|
@@ -35,21 +35,21 @@ declare const nbsp: " ";
|
|
|
35
35
|
declare const upArrow: "↑";
|
|
36
36
|
declare const downArrow: "↓";
|
|
37
37
|
/**
|
|
38
|
-
* @param {Node} node
|
|
38
|
+
* @param {Node|string} node
|
|
39
39
|
* @returns {void}
|
|
40
40
|
*/
|
|
41
|
-
declare function removeChildren(node: Node): void;
|
|
41
|
+
declare function removeChildren(node: Node | string): void;
|
|
42
42
|
/**
|
|
43
43
|
* @param {HTMLElement|string} sel
|
|
44
44
|
* @returns {void}
|
|
45
45
|
*/
|
|
46
46
|
declare function removeIfExists(sel: HTMLElement | string): void;
|
|
47
47
|
/**
|
|
48
|
-
* @param {HTMLElement} el
|
|
48
|
+
* @param {HTMLElement|string} el
|
|
49
49
|
* @param {string|string[]} selectors
|
|
50
50
|
* @returns {HTMLElement[]}
|
|
51
51
|
*/
|
|
52
|
-
declare function filterChildElements(el: HTMLElement, selectors: string | string[]): HTMLElement[];
|
|
52
|
+
declare function filterChildElements(el: HTMLElement | string, selectors: string | string[]): HTMLElement[];
|
|
53
53
|
/**
|
|
54
54
|
* @param {string} s
|
|
55
55
|
* @returns {string}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateUtils.d.ts","sourceRoot":"","sources":["../../src/utils/templateUtils.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"templateUtils.d.ts","sourceRoot":"","sources":["../../src/utils/templateUtils.js"],"names":[],"mappings":";;;;;AAKA;;;GAGG;AACH,uBAHW,MAAM,GACJ,WAAW,GAAC,IAAI,CAEiB;AAE9C;;;GAGG;AACH,wBAHW,MAAM,GACJ,WAAW,EAAE,CAIvB;AAEH;;;;GAIG;AACH,uBAJW,OAAO,GAAC,WAAW,GAAC,MAAM,kBAC1B,MAAM,GACJ,WAAW,GAAC,IAAI,CAQ5B;AAED;;;;GAIG;AACH,wBAJW,WAAW,GAAC,MAAM,kBAClB,MAAM,GACJ,WAAW,EAAE,CAUzB;;;;;;;AA7CD,wBAAsB;AACtB,2BAAyB;AACzB,6BAA2B;AA6C3B;;;GAGG;AACH,sCAHW,IAAI,GAAC,MAAM,GACT,IAAI,CAUhB;AAED;;;GAGG;AACH,qCAHW,WAAW,GAAC,MAAM,GAChB,IAAI,CAOhB;AAED;;;;GAIG;AACH,yCAJW,WAAW,GAAC,MAAM,aAClB,MAAM,GAAC,MAAM,EAAE,GACb,WAAW,EAAE,CAgCzB;AAED;;;GAGG;AACH,gCAHW,MAAM,GACJ,MAAM,CAIlB"}
|
package/dist/vendor-imports.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@es-joy/jsoe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"description": "Editing of arbitrary JavaScript objects",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"tsc": "tsc",
|
|
16
|
-
"
|
|
16
|
+
"tsc-cypress": "tsc -p cypress/tsconfig.json",
|
|
17
|
+
"eslint": "eslint .",
|
|
17
18
|
"lint": "npm run eslint --",
|
|
18
19
|
"coverage": "open-cli http://localhost:8087/coverage/lcov-report/",
|
|
19
20
|
"open": "open-cli http://localhost:8087/demo/",
|
|
@@ -26,11 +27,11 @@
|
|
|
26
27
|
"instrument-remove-instrumented": "rimraf instrumented",
|
|
27
28
|
"instrument-remove": "run-p -c instrument-remove-cache instrument-remove-instrumented",
|
|
28
29
|
"copy-pages": "cp node_modules/sceditor/minified/themes/default.min.css vendor/sceditor/minified/themes/default.min.css && cp node_modules/sceditor/minified/sceditor.min.js vendor/sceditor/minified/sceditor.min.js && cp node_modules/sceditor/minified/formats/bbcode.js vendor/sceditor/minified/formats/bbcode.js && cp node_modules/sceditor/minified/formats/xhtml.js vendor/sceditor/minified/formats/xhtml.js",
|
|
29
|
-
"copy-index": "
|
|
30
|
+
"copy-index": "echo \"Copy our index.html file too? \"",
|
|
30
31
|
"copy-jamilih": "cp node_modules/jamilih/dist/jml-es.js vendor/jamilih/dist/jml-es.js",
|
|
31
32
|
"copy-typeson-registry": "cp node_modules/typeson-registry/dist/index.js vendor/typeson-registry/dist/index.js",
|
|
32
33
|
"copy": "run-p copy-jamilih copy-typeson-registry",
|
|
33
|
-
"instrument": "run-s -c instrument-remove instrument-add copy-index",
|
|
34
|
+
"instrument": "run-s -c instrument-remove instrument-add copy-index rollup",
|
|
34
35
|
"cypress:log": "ELECTRON_ENABLE_LOGGING=1 cypress run; nyc report",
|
|
35
36
|
"cypress": "cypress run; nyc report",
|
|
36
37
|
"test": "npm run eslint && npm run rollup && npm run cypress"
|
|
@@ -39,58 +40,62 @@
|
|
|
39
40
|
"cover 100%"
|
|
40
41
|
],
|
|
41
42
|
"nyc": {
|
|
43
|
+
"excludeAfterRemap": true,
|
|
42
44
|
"exclude": [
|
|
43
|
-
"node_modules/**"
|
|
45
|
+
"node_modules/**",
|
|
46
|
+
"src/fundamentalTypes/sparseUndefinedType.js"
|
|
44
47
|
]
|
|
45
48
|
},
|
|
46
49
|
"dependencies": {
|
|
47
50
|
"@brettz9/node-static": "^0.1.1",
|
|
48
|
-
"jamilih": "0.58.
|
|
51
|
+
"jamilih": "0.58.2",
|
|
49
52
|
"sceditor": "3.2.0",
|
|
50
|
-
"typeson-registry": "
|
|
53
|
+
"typeson-registry": "9.1.1"
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
|
53
|
-
"@babel/core": "^7.
|
|
54
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
55
|
-
"@babel/preset-env": "^7.
|
|
56
|
-
"@babel/register": "^7.22.
|
|
56
|
+
"@babel/core": "^7.23.3",
|
|
57
|
+
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
|
|
58
|
+
"@babel/preset-env": "^7.23.3",
|
|
59
|
+
"@babel/register": "^7.22.15",
|
|
57
60
|
"@brettz9/eslint-plugin": "^1.0.4",
|
|
58
|
-
"@cypress/code-coverage": "^3.10
|
|
59
|
-
"@rollup/plugin-babel": "^6.0.
|
|
60
|
-
"@rollup/plugin-commonjs": "^25.0.
|
|
61
|
-
"@rollup/plugin-node-resolve": "^15.
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
61
|
+
"@cypress/code-coverage": "^3.12.10",
|
|
62
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
63
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
64
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
65
|
+
"@stylistic/eslint-plugin": "^1.4.0",
|
|
66
|
+
"@types/jsdom": "^21.1.5",
|
|
67
|
+
"@types/node": "^20.9.2",
|
|
68
|
+
"axe-core": "^4.8.2",
|
|
69
|
+
"cypress": "^13.5.1",
|
|
70
|
+
"cypress-axe": "^1.5.0",
|
|
71
|
+
"eslint": "^8.54.0",
|
|
72
|
+
"eslint-config-ash-nazg": "^35.1.0",
|
|
68
73
|
"eslint-config-standard": "^17.1.0",
|
|
69
|
-
"eslint-plugin-array-func": "^
|
|
70
|
-
"eslint-plugin-compat": "^4.
|
|
71
|
-
"eslint-plugin-cypress": "^2.
|
|
74
|
+
"eslint-plugin-array-func": "^4.0.0",
|
|
75
|
+
"eslint-plugin-compat": "^4.2.0",
|
|
76
|
+
"eslint-plugin-cypress": "^2.15.1",
|
|
72
77
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
73
78
|
"eslint-plugin-html": "^7.1.0",
|
|
74
|
-
"eslint-plugin-import": "^2.
|
|
75
|
-
"eslint-plugin-jsdoc": "^46.
|
|
76
|
-
"eslint-plugin-markdown": "^3.0.
|
|
77
|
-
"eslint-plugin-n": "^16.
|
|
79
|
+
"eslint-plugin-import": "^2.29.0",
|
|
80
|
+
"eslint-plugin-jsdoc": "^46.9.0",
|
|
81
|
+
"eslint-plugin-markdown": "^3.0.1",
|
|
82
|
+
"eslint-plugin-n": "^16.3.1",
|
|
78
83
|
"eslint-plugin-no-unsanitized": "^4.0.2",
|
|
79
84
|
"eslint-plugin-no-use-extend-native": "^0.5.0",
|
|
80
85
|
"eslint-plugin-promise": "^6.1.1",
|
|
81
|
-
"eslint-plugin-sonarjs": "^0.
|
|
86
|
+
"eslint-plugin-sonarjs": "^0.23.0",
|
|
82
87
|
"eslint-plugin-standard": "^4.1.0",
|
|
83
|
-
"eslint-plugin-unicorn": "^
|
|
88
|
+
"eslint-plugin-unicorn": "^49.0.0",
|
|
84
89
|
"fast-deep-equal": "^3.1.3",
|
|
85
90
|
"jsdom": "^21.1.1",
|
|
86
91
|
"npm-run-all": "^4.1.5",
|
|
87
92
|
"nyc": "^15.1.0",
|
|
88
93
|
"open-cli": "^7.2.0",
|
|
89
|
-
"rimraf": "^5.0.
|
|
90
|
-
"rollup": "
|
|
91
|
-
"rollup-plugin-istanbul": "^
|
|
94
|
+
"rimraf": "^5.0.5",
|
|
95
|
+
"rollup": "4.5.0",
|
|
96
|
+
"rollup-plugin-istanbul": "^5.0.0",
|
|
92
97
|
"rollup-plugin-node-builtins": "^2.1.2",
|
|
93
|
-
"typescript": "^5.
|
|
98
|
+
"typescript": "^5.2.2"
|
|
94
99
|
},
|
|
95
100
|
"repository": {
|
|
96
101
|
"type": "git",
|
package/rollup.config.js
CHANGED
|
@@ -3,8 +3,20 @@ import {nodeResolve} from '@rollup/plugin-node-resolve';
|
|
|
3
3
|
import commonjs from '@rollup/plugin-commonjs';
|
|
4
4
|
// import babel from 'rollup-plugin-babel';
|
|
5
5
|
// import {terser} from 'rollup-plugin-terser';
|
|
6
|
+
import istanbul from 'rollup-plugin-istanbul';
|
|
6
7
|
|
|
7
|
-
export default {
|
|
8
|
+
export default [{
|
|
9
|
+
input: 'demo/index.js',
|
|
10
|
+
output: {
|
|
11
|
+
file: 'instrumented/demo/index.js',
|
|
12
|
+
format: 'es'
|
|
13
|
+
},
|
|
14
|
+
plugins: [
|
|
15
|
+
istanbul(),
|
|
16
|
+
nodeResolve(),
|
|
17
|
+
commonjs()
|
|
18
|
+
]
|
|
19
|
+
}, {
|
|
8
20
|
input: 'node_modules/fast-deep-equal/es6/index.js',
|
|
9
21
|
output: {
|
|
10
22
|
file: 'src/deepEqual.js',
|
|
@@ -26,4 +38,4 @@ export default {
|
|
|
26
38
|
include: 'node_modules/**'
|
|
27
39
|
})
|
|
28
40
|
]
|
|
29
|
-
};
|
|
41
|
+
}];
|
package/server.js
CHANGED
|
@@ -9,7 +9,7 @@ const fileServer = new statik.Server();
|
|
|
9
9
|
|
|
10
10
|
http.createServer(function (request, response) {
|
|
11
11
|
request.addListener('end', function () {
|
|
12
|
-
fileServer.serve(request, response, function (e, res) {
|
|
12
|
+
fileServer.serve(request, response, function (e /* , res */) {
|
|
13
13
|
if (e && (e.status === 404)) { // If the file wasn't found
|
|
14
14
|
fileServer.serveFile(
|
|
15
15
|
instrumented === 'instrumented'
|
|
@@ -21,7 +21,7 @@ import {$e, DOM} from './utils/templateUtils.js';
|
|
|
21
21
|
*/
|
|
22
22
|
export const getFormatAndSchemaChoices = ({schema, hasKeyPath} = {}) => {
|
|
23
23
|
const hasSchema = typeof schema === 'string';
|
|
24
|
-
// eslint-disable-next-line max-len -- Long
|
|
24
|
+
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
25
25
|
return /** @type {[optText: string, opts: {value: string, selected?: boolean}][]} */ ([
|
|
26
26
|
['JSON only', {value: 'json'}],
|
|
27
27
|
...(hasKeyPath
|
|
@@ -96,7 +96,7 @@ export const getFormatAndSchemaChoices = ({schema, hasKeyPath} = {}) => {
|
|
|
96
96
|
* domArray: [formatChoices: FormatChoices, typesHolder: TypesHolder],
|
|
97
97
|
* getValue: (stateObj: import('./types.js').StateObject,
|
|
98
98
|
* currentPath: string) => import('./formats.js').StructuredCloneValue,
|
|
99
|
-
* getType: () => string
|
|
99
|
+
* getType: () => string,
|
|
100
100
|
* validValuesSet: () => boolean,
|
|
101
101
|
* setValue: SetValue
|
|
102
102
|
* }} The selector for types and the container for them. Both should be
|
|
@@ -228,7 +228,7 @@ export function formatAndTypeChoices ({
|
|
|
228
228
|
* @returns {import('./formats.js').StructuredCloneValue}
|
|
229
229
|
*/
|
|
230
230
|
getValue (stateObj, currentPath) {
|
|
231
|
-
// eslint-disable-next-line max-len -- Long
|
|
231
|
+
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
232
232
|
const root = /** @type {HTMLDivElement & {$getTypeRoot: TypeRootGetter}} */ (
|
|
233
233
|
typesHolder
|
|
234
234
|
).$getTypeRoot();
|
|
@@ -242,10 +242,10 @@ export function formatAndTypeChoices ({
|
|
|
242
242
|
},
|
|
243
243
|
|
|
244
244
|
/**
|
|
245
|
-
* @returns {string
|
|
245
|
+
* @returns {string}
|
|
246
246
|
*/
|
|
247
247
|
getType () {
|
|
248
|
-
// eslint-disable-next-line max-len -- Long
|
|
248
|
+
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
249
249
|
const root = /** @type {HTMLDivElement & {$getTypeRoot: TypeRootGetter}} */ (
|
|
250
250
|
typesHolder
|
|
251
251
|
).$getTypeRoot();
|
|
@@ -256,7 +256,7 @@ export function formatAndTypeChoices ({
|
|
|
256
256
|
* @returns {boolean}
|
|
257
257
|
*/
|
|
258
258
|
validValuesSet () {
|
|
259
|
-
// eslint-disable-next-line max-len -- Long
|
|
259
|
+
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
260
260
|
const root = /** @type {HTMLDivElement & {$getTypeRoot: TypeRootGetter}} */ (
|
|
261
261
|
typesHolder
|
|
262
262
|
).$getTypeRoot();
|
|
@@ -277,12 +277,12 @@ export function formatAndTypeChoices ({
|
|
|
277
277
|
stateObj
|
|
278
278
|
)
|
|
279
279
|
);
|
|
280
|
-
const type =
|
|
281
|
-
// eslint-disable-next-line max-len -- Long
|
|
280
|
+
const type = Types.getTypeForRoot(rootEditUI);
|
|
281
|
+
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
282
282
|
const sel = /** @type {HTMLDivElement & {$getTypeSelect: TypeSelectGetter}} */ (
|
|
283
283
|
typesHolder
|
|
284
284
|
).$getTypeSelect();
|
|
285
|
-
// eslint-disable-next-line max-len -- Long
|
|
285
|
+
// eslint-disable-next-line @stylistic/max-len -- Long
|
|
286
286
|
/** @type {HTMLSelectElement & {$addTypeAndEditUI: import('./typeChoices.js').AddTypeAndEditUI}} */ (
|
|
287
287
|
sel
|
|
288
288
|
).$addTypeAndEditUI({type, editUI: rootEditUI});
|
|
@@ -36,8 +36,8 @@ const indexedDBKey = {
|
|
|
36
36
|
if (!state || ['array'].includes(state)) {
|
|
37
37
|
return this.types();
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
return undefined;
|
|
39
|
+
// Can't be object, so shouldn't normally reach here
|
|
40
|
+
return undefined;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
package/src/formats/json.js
CHANGED
|
@@ -46,8 +46,7 @@ const json = {
|
|
|
46
46
|
if (!state || ['array', 'object'].includes(state)) {
|
|
47
47
|
return this.types();
|
|
48
48
|
}
|
|
49
|
-
//
|
|
50
|
-
/* istanbul ignore next -- No other states apparently */
|
|
49
|
+
// Shouldn't normally reach here
|
|
51
50
|
return undefined;
|
|
52
51
|
}
|
|
53
52
|
};
|