@es-joy/jsoe 0.1.0 → 0.3.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.
Files changed (39) hide show
  1. package/.eslintrc.cjs +2 -1
  2. package/CHANGES.md +13 -0
  3. package/README.md +4 -4
  4. package/demo/index.html +1 -0
  5. package/demo/index.js +147 -14
  6. package/index.html +10 -0
  7. package/package.json +9 -9
  8. package/src/formatAndTypeChoices.js +245 -0
  9. package/src/formats/indexedDBKey.js +5 -4
  10. package/src/formats/json.js +1 -1
  11. package/src/formats/schemaAndArbitrary.js +1 -1
  12. package/src/formats/schemaOnly.js +1 -1
  13. package/src/formats/structuredCloning.js +4 -22
  14. package/src/formats.js +17 -206
  15. package/src/fundamentalTypes/BooleanObjectType.js +1 -1
  16. package/src/fundamentalTypes/NumberObjectType.js +1 -1
  17. package/src/fundamentalTypes/StringObjectType.js +1 -1
  18. package/src/fundamentalTypes/arrayReferenceType.js +1 -1
  19. package/src/fundamentalTypes/arrayType.js +3 -3
  20. package/src/fundamentalTypes/bigintType.js +1 -1
  21. package/src/fundamentalTypes/dateType.js +1 -1
  22. package/src/fundamentalTypes/nullType.js +1 -1
  23. package/src/fundamentalTypes/numberType.js +1 -1
  24. package/src/fundamentalTypes/objectReferenceType.js +1 -1
  25. package/src/fundamentalTypes/objectType.js +1 -1
  26. package/src/fundamentalTypes/regexpType.js +1 -1
  27. package/src/fundamentalTypes/sparseUndefinedType.js +1 -1
  28. package/src/fundamentalTypes/stringType.js +1 -1
  29. package/src/fundamentalTypes/undefinedType.js +1 -1
  30. package/src/index.js +7 -2
  31. package/src/jsoe.css +58 -0
  32. package/src/subTypes/falseType.js +1 -1
  33. package/src/subTypes/trueType.js +1 -1
  34. package/src/superTypes/SpecialNumberSuperType.js +17 -10
  35. package/src/superTypes/SpecialRealNumberSuperType.js +56 -0
  36. package/src/typeChoices.js +229 -117
  37. package/src/types.js +56 -37
  38. package/vendor/typeson-registry/dist/index.js +19 -3
  39. package/src/superTypes/InfinitiesSuperType.js +0 -49
@@ -1,49 +0,0 @@
1
- import {$e} from '../utils/templateUtils.js';
2
-
3
- /**
4
- * @type {SuperTypeObject}
5
- */
6
- const InfinitiesSuperType = {
7
- option: ['Infinities', {title: '`Infinity`, `-Infinity`'}],
8
- childTypes: ['infinity', 'negativeInfinity'],
9
- stringRegex: /^-?Infinity$/u,
10
- toValue (s) {
11
- return {
12
- value: s === 'Infinity'
13
- ? Number.POSITIVE_INFINITY
14
- : Number.NEGATIVE_INFINITY
15
- };
16
- },
17
- getSelect ({root}) {
18
- return $e(root, 'select');
19
- },
20
- getValue ({root}) {
21
- return this.toValue(this.getSelect({root}).value).value;
22
- },
23
- setValue ({root, value}) {
24
- this.getSelect({root}).value = String(value);
25
- },
26
- viewUI ({value}) {
27
- return ['i', {dataset: {type: 'Infinities'}}, [String(value)]];
28
- },
29
- getInput ({root}) {
30
- return $e(root, 'select');
31
- },
32
- editUI ({typeNamespace, value = Number.POSITIVE_INFINITY}) {
33
- return ['div', {dataset: {type: 'Infinities'}}, [
34
- ['label', [
35
- 'Infinities: ',
36
- ['select', {name: `${typeNamespace}-Infinities`}, [
37
- ['option', {
38
- value: 'Infinity', selected: value === Number.POSITIVE_INFINITY
39
- }, ['Infinity']],
40
- ['option', {
41
- value: '-Infinity', selected: value === Number.NEGATIVE_INFINITY
42
- }, ['-Infinity']]
43
- ]]
44
- ]]
45
- ]];
46
- }
47
- };
48
-
49
- export default InfinitiesSuperType;