shinkansen-transmission 2.2.1 → 2.2.3
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/.husky/post-commit +4 -0
- package/.husky/post-commit.cjs +8 -0
- package/.husky/post-commit.mjs +5 -0
- package/.husky/pre-commit +2 -1
- package/babel.config.cjs +66 -0
- package/nvm.sh +43 -0
- package/package.json +44 -32
- package/src/index.cjs +17 -0
- package/src/index.mjs +10 -0
- package/src/transmission/common/{index.js → index.mjs} +5 -5
- package/src/transmission/from-document-to-hash/{index.js → index.mjs} +34 -14
- package/src/transmission/from-hash-to-document/{index.js → index.mjs} +5 -4
- package/src/transmission/index.mjs +10 -0
- package/src/transmission/to-zashiki/index.mjs +1 -0
- package/src/transmission/to-zashiki/{transform-root-schema.js → transform-root-schema.mjs} +3 -3
- package/src/transmission/to-zashiki/{transform-schema.js → transform-schema.mjs} +2 -2
- package/babel.config.js +0 -61
- package/index.js +0 -7
- package/lib/index.js +0 -1
- package/lib/transmission/common/index.js +0 -1
- package/lib/transmission/from-document-to-hash/index.js +0 -1
- package/lib/transmission/from-hash-to-document/index.js +0 -1
- package/lib/transmission/index.js +0 -1
- package/lib/transmission/to-zashiki/index.js +0 -1
- package/lib/transmission/to-zashiki/transform-root-schema.js +0 -1
- package/lib/transmission/to-zashiki/transform-schema.js +0 -1
- package/src/index.js +0 -4
- package/src/transmission/index.js +0 -4
- package/src/transmission/to-zashiki/index.js +0 -1
package/.husky/pre-commit
CHANGED
package/babel.config.cjs
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
const debug = require('debug')
|
2
|
+
|
3
|
+
const log = debug('shinkansen-transmission')
|
4
|
+
|
5
|
+
const {
|
6
|
+
env: {
|
7
|
+
NODE_ENV = 'development'
|
8
|
+
}
|
9
|
+
} = process
|
10
|
+
|
11
|
+
log('`shinkansen` is awake')
|
12
|
+
|
13
|
+
function env () {
|
14
|
+
log({ NODE_ENV })
|
15
|
+
|
16
|
+
return (
|
17
|
+
NODE_ENV === 'production'
|
18
|
+
)
|
19
|
+
}
|
20
|
+
|
21
|
+
const presets = [
|
22
|
+
[
|
23
|
+
'@babel/env', {
|
24
|
+
targets: {
|
25
|
+
node: 'current',
|
26
|
+
browsers: [
|
27
|
+
'last 4 versions',
|
28
|
+
'safari >= 9',
|
29
|
+
'ios >= 8',
|
30
|
+
'ie >= 9',
|
31
|
+
'> 2%'
|
32
|
+
]
|
33
|
+
},
|
34
|
+
useBuiltIns: 'usage',
|
35
|
+
corejs: 3
|
36
|
+
}
|
37
|
+
]
|
38
|
+
]
|
39
|
+
|
40
|
+
const plugins = [
|
41
|
+
'@babel/proposal-export-default-from',
|
42
|
+
'@babel/proposal-export-namespace-from',
|
43
|
+
[
|
44
|
+
'module-resolver', {
|
45
|
+
alias: {
|
46
|
+
'shinkansen-transmission/transmission/common': './src/transmission/common/index.mjs',
|
47
|
+
'shinkansen-transmission/transmission/from-document-to-hash': './src/transmission/from-document-to-hash/index.mjs',
|
48
|
+
'shinkansen-transmission/transmission/from-hash-to-document': './src/transmission/from-hash-to-document/index.mjs',
|
49
|
+
'shinkansen-transmission/transmission/to-zashiki/transform-root-schema': './src/transmission/to-zashiki/transform-root-schema.mjs',
|
50
|
+
'shinkansen-transmission/transmission/to-zashiki/transform-schema': './src/transmission/to-zashiki/transform-schema.mjs',
|
51
|
+
'shinkansen-transmission/transmission/to-zashiki': './src/transmission/to-zashiki/index.mjs',
|
52
|
+
'shinkansen-transmission/transmission': './src/transmission/index.mjs',
|
53
|
+
'shinkansen-transmission': './src/index.cjs'
|
54
|
+
}
|
55
|
+
}
|
56
|
+
]
|
57
|
+
]
|
58
|
+
|
59
|
+
module.exports = (api) => {
|
60
|
+
if (api) api.cache.using(env)
|
61
|
+
|
62
|
+
return {
|
63
|
+
presets,
|
64
|
+
plugins
|
65
|
+
}
|
66
|
+
}
|
package/nvm.sh
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
NVM=~/.nvm
|
4
|
+
|
5
|
+
if [ -f "$NVM/nvm.sh" ];
|
6
|
+
then
|
7
|
+
unset npm_package_scripts_nvm
|
8
|
+
unset npm_config_prefix
|
9
|
+
unset npm_lifecycle_script
|
10
|
+
|
11
|
+
source $NVM/nvm.sh
|
12
|
+
else
|
13
|
+
NVM=$(brew --prefix nvm 2> /dev/null)
|
14
|
+
|
15
|
+
if [ -f "$NVM/nvm.sh" ];
|
16
|
+
then
|
17
|
+
unset npm_package_scripts_nvm
|
18
|
+
unset npm_config_prefix
|
19
|
+
unset npm_lifecycle_script
|
20
|
+
|
21
|
+
source $NVM/nvm.sh
|
22
|
+
fi
|
23
|
+
fi
|
24
|
+
|
25
|
+
VERSION=$(nvm --version 2> /dev/null)
|
26
|
+
|
27
|
+
if [ -z "$VERSION" ];
|
28
|
+
then
|
29
|
+
echo Environment does not have NVM installed
|
30
|
+
else
|
31
|
+
echo Environment has NVM version $VERSION installed
|
32
|
+
|
33
|
+
set -e
|
34
|
+
|
35
|
+
nvm use
|
36
|
+
|
37
|
+
if [[ $? != 0 ]];
|
38
|
+
then
|
39
|
+
echo Environment does not have NVM configured
|
40
|
+
else
|
41
|
+
echo Environment has NVM version $VERSION configured
|
42
|
+
fi
|
43
|
+
fi
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "shinkansen-transmission",
|
3
|
-
"version": "2.2.
|
3
|
+
"version": "2.2.3",
|
4
4
|
"description": "Shinkansen Transmission",
|
5
5
|
"keywords": [
|
6
6
|
"Shinkansen",
|
@@ -9,53 +9,65 @@
|
|
9
9
|
"Zashiki",
|
10
10
|
"Karakuri"
|
11
11
|
],
|
12
|
-
"main": "./index.
|
12
|
+
"main": "./src/index.cjs",
|
13
|
+
"type": "module",
|
13
14
|
"author": "Jonathan Perry for Modern Poacher Limited <modernpoacher@modernpoacher.com>",
|
14
15
|
"license": "MIT",
|
15
16
|
"engines": {
|
16
|
-
"node": ">=
|
17
|
+
"node": ">=18.5.0"
|
17
18
|
},
|
18
19
|
"repository": {
|
19
20
|
"type": "git",
|
20
21
|
"url": "git@github.com/modernpoacher/shinkansen-transmission.git"
|
21
22
|
},
|
22
23
|
"scripts": {
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"build": "npm run babel",
|
26
|
-
"build:watch": "npm run babel:watch",
|
27
|
-
"clean": "rimraf lib",
|
28
|
-
"babel": "babel src -d lib",
|
29
|
-
"babel:watch": "npm run babel -- -w",
|
30
|
-
"lint": "eslint .",
|
24
|
+
"prelint": "npm run nvm",
|
25
|
+
"lint": "eslint . --ext .mjs --ext .cjs",
|
31
26
|
"lint:fix": "npm run lint -- --fix",
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"
|
27
|
+
"pretest": "npm run nvm",
|
28
|
+
"test": "cross-env NODE_ENV=test mocha test --recursive --verbose",
|
29
|
+
"nvm": "bash nvm.sh",
|
30
|
+
"coverage": "nyc --reporter=lcov npm run test"
|
35
31
|
},
|
36
32
|
"dependencies": {
|
37
|
-
"debug": "^4.3.
|
33
|
+
"debug": "^4.3.4",
|
38
34
|
"fast-deep-equal": "^3.1.3"
|
39
35
|
},
|
40
36
|
"devDependencies": {
|
41
|
-
"@babel/
|
42
|
-
"@babel/
|
43
|
-
"@babel/
|
44
|
-
"@babel/plugin-proposal-export-
|
45
|
-
"@babel/
|
46
|
-
"@babel/
|
47
|
-
"@
|
48
|
-
"babel-loader": "^
|
49
|
-
"babel-plugin-module-resolver": "^
|
50
|
-
"chai": "^4.3.
|
51
|
-
"core-js": "^3.
|
37
|
+
"@babel/core": "^7.21.8",
|
38
|
+
"@babel/eslint-parser": "^7.21.8",
|
39
|
+
"@babel/plugin-proposal-export-default-from": "^7.18.10",
|
40
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
|
41
|
+
"@babel/preset-env": "^7.21.5",
|
42
|
+
"@babel/register": "^7.21.0",
|
43
|
+
"@modernpoacher/hooks": "^1.0.394",
|
44
|
+
"babel-loader": "^9.1.2",
|
45
|
+
"babel-plugin-module-resolver": "^5.0.0",
|
46
|
+
"chai": "^4.3.7",
|
47
|
+
"core-js": "^3.30.1",
|
52
48
|
"cross-env": "^7.0.3",
|
53
|
-
"eslint": "^
|
54
|
-
"eslint-
|
55
|
-
"
|
56
|
-
"
|
49
|
+
"eslint": "^8.39.0",
|
50
|
+
"eslint-config-standard": "^17.0.0",
|
51
|
+
"eslint-import-resolver-babel-module": "^5.3.2",
|
52
|
+
"eslint-plugin-import": "^2.27.5",
|
53
|
+
"eslint-plugin-node": "^11.1.0",
|
54
|
+
"eslint-plugin-promise": "^6.1.1",
|
55
|
+
"husky": "^8.0.3",
|
56
|
+
"mocha": "^10.2.0",
|
57
57
|
"nyc": "^15.1.0",
|
58
|
-
"rimraf": "^
|
59
|
-
|
58
|
+
"rimraf": "^5.0.0"
|
59
|
+
},
|
60
|
+
"exports": {
|
61
|
+
".": {
|
62
|
+
"require": "./src/index.cjs",
|
63
|
+
"import": "./src/index.mjs"
|
64
|
+
},
|
65
|
+
"./transmission/common": "./src/transmission/common/index.mjs",
|
66
|
+
"./transmission/from-document-to-hash": "./src/transmission/from-document-to-hash/index.mjs",
|
67
|
+
"./transmission/from-hash-to-document": "./src/transmission/from-hash-to-document/index.mjs",
|
68
|
+
"./transmission/to-zashiki/transform-root-schema": "./src/transmission/to-zashiki/transform-root-schema.mjs",
|
69
|
+
"./transmission/to-zashiki/transform-schema": "./src/transmission/to-zashiki/transform-schema.mjs",
|
70
|
+
"./transmission/to-zashiki": "./src/transmission/to-zashiki/index.mjs",
|
71
|
+
"./transmission": "./src/transmission/index.mjs"
|
60
72
|
}
|
61
73
|
}
|
package/src/index.cjs
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require('@babel/register')({ ignore: [/node_modules/], configFile: require.resolve('../babel.config.cjs') })
|
2
|
+
|
3
|
+
const debug = require('debug')
|
4
|
+
|
5
|
+
const log = debug('shinkansen-transmission')
|
6
|
+
|
7
|
+
log('`shinkansen` is awake')
|
8
|
+
|
9
|
+
const common = require('./transmission/common/index.mjs')
|
10
|
+
const { default: fromDocumentToHash } = require('./transmission/from-document-to-hash/index.mjs')
|
11
|
+
const { default: fromHashToDocument } = require('./transmission/from-hash-to-document/index.mjs')
|
12
|
+
const { default: toZashiki } = require('./transmission/to-zashiki/index.mjs')
|
13
|
+
|
14
|
+
module.exports.common = common
|
15
|
+
module.exports.fromDocumentToHash = fromDocumentToHash
|
16
|
+
module.exports.fromHashToDocument = fromHashToDocument
|
17
|
+
module.exports.toZashiki = toZashiki
|
package/src/index.mjs
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
import debug from 'debug'
|
2
|
+
|
3
|
+
const log = debug('shinkansen-transmission')
|
4
|
+
|
5
|
+
log('`shinkansen` is awake')
|
6
|
+
|
7
|
+
export * as common from './transmission/common/index.mjs'
|
8
|
+
export { default as fromDocumentToHash } from './transmission/from-document-to-hash/index.mjs'
|
9
|
+
export { default as fromHashToDocument } from './transmission/from-hash-to-document/index.mjs'
|
10
|
+
export { default as toZashiki } from './transmission/to-zashiki/index.mjs'
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
import debug from 'debug'
|
2
|
+
|
3
|
+
const log = debug('shinkansen-transmission/transmission/common')
|
4
|
+
|
5
|
+
log('`shinkansen` is awake')
|
6
6
|
|
7
7
|
export const isObject = (v) => (v || false) instanceof Object && !isArray(v)
|
8
8
|
|
@@ -18,24 +18,32 @@ import {
|
|
18
18
|
getUri
|
19
19
|
} from 'shinkansen-transmission/transmission/common'
|
20
20
|
|
21
|
-
const log = debug('shinkansen-transmission
|
21
|
+
const log = debug('shinkansen-transmission/from-document-to-hash')
|
22
|
+
|
23
|
+
log('`shinkansen` is awake')
|
22
24
|
|
23
25
|
function findByKey (parentUri, uri) {
|
26
|
+
/*
|
27
|
+
* log('findByKey')
|
28
|
+
*/
|
24
29
|
return function find (key) {
|
25
|
-
|
30
|
+
/*
|
31
|
+
* log('find')
|
32
|
+
*/
|
33
|
+
return getUri(parentUri, key) === uri
|
26
34
|
}
|
27
35
|
}
|
28
36
|
|
29
37
|
function findByIndex (parentUri, uri) {
|
38
|
+
/*
|
39
|
+
* log('findByIndex')
|
40
|
+
*/
|
30
41
|
return function find (schema, index) {
|
31
42
|
/*
|
32
|
-
* log('
|
43
|
+
* log('find')
|
33
44
|
*/
|
34
|
-
|
35
45
|
if (hasEnum(schema)) {
|
36
|
-
|
37
|
-
|
38
|
-
// return array.find(findByIndex(parentUri, uri))
|
46
|
+
return getUri(parentUri, index) === uri
|
39
47
|
} else {
|
40
48
|
if (hasAnyOf(schema)) {
|
41
49
|
const array = getAnyOf(schema)
|
@@ -55,22 +63,33 @@ function findByIndex (parentUri, uri) {
|
|
55
63
|
}
|
56
64
|
|
57
65
|
function findByValue (value) {
|
66
|
+
/*
|
67
|
+
* log('findByValue')
|
68
|
+
*/
|
58
69
|
return function find (schema) {
|
59
70
|
/*
|
60
|
-
* log('
|
71
|
+
* log('find')
|
61
72
|
*/
|
62
|
-
|
63
73
|
return value === transformValue(schema)
|
64
74
|
}
|
65
75
|
}
|
66
76
|
|
67
77
|
function findByEqual (value) {
|
78
|
+
/*
|
79
|
+
* log('findByEqual')
|
80
|
+
*/
|
68
81
|
return function find (schema) {
|
82
|
+
/*
|
83
|
+
* log('find')
|
84
|
+
*/
|
69
85
|
return equal(value, transformValue(schema))
|
70
86
|
}
|
71
87
|
}
|
72
88
|
|
73
89
|
function toString (value) {
|
90
|
+
/*
|
91
|
+
* log('toString')
|
92
|
+
*/
|
74
93
|
return (value !== undefined) ? String(value) : ''
|
75
94
|
}
|
76
95
|
|
@@ -78,7 +97,6 @@ export function getObject ({ properties = {} /* object */ } = {}, parentUri = ''
|
|
78
97
|
/*
|
79
98
|
* log('getObject')
|
80
99
|
*/
|
81
|
-
|
82
100
|
return (
|
83
101
|
Reflect.get(properties, (
|
84
102
|
Object.keys(properties)
|
@@ -91,7 +109,6 @@ export function getArray ({ items = {} /* array or object */ } = {}, parentUri =
|
|
91
109
|
/*
|
92
110
|
* log('getArray')
|
93
111
|
*/
|
94
|
-
|
95
112
|
return (isArray(items))
|
96
113
|
? items.find(findByIndex(parentUri, uri))
|
97
114
|
: items
|
@@ -101,7 +118,6 @@ export function getSchema (schema = {}, parentUri = '', uri = '') {
|
|
101
118
|
/*
|
102
119
|
* log('getSchema')
|
103
120
|
*/
|
104
|
-
|
105
121
|
const { type } = schema
|
106
122
|
|
107
123
|
switch (type) {
|
@@ -127,6 +143,9 @@ export const transformValue = (schema) => (
|
|
127
143
|
)
|
128
144
|
|
129
145
|
export function transformValueIndexFor (array, value) {
|
146
|
+
/*
|
147
|
+
* log('transformValueIndexFor')
|
148
|
+
*/
|
130
149
|
const find = findByValue(value)
|
131
150
|
|
132
151
|
if (array.some(find)) {
|
@@ -145,6 +164,9 @@ export function transformValueIndexFor (array, value) {
|
|
145
164
|
}
|
146
165
|
|
147
166
|
export function transformEqualIndexFor (array, value) {
|
167
|
+
/*
|
168
|
+
* log('transformEqualIndexFor')
|
169
|
+
*/
|
148
170
|
const find = findByEqual(value)
|
149
171
|
|
150
172
|
if (array.some(find)) {
|
@@ -166,7 +188,6 @@ export function transformArrayFor (document, schema, values, params, parentUri,
|
|
166
188
|
/*
|
167
189
|
* log('transformArrayFor')
|
168
190
|
*/
|
169
|
-
|
170
191
|
return (
|
171
192
|
document
|
172
193
|
.reduce((values, value, index) => {
|
@@ -181,7 +202,6 @@ export function transformObjectFor (document, schema, values, params, parentUri,
|
|
181
202
|
/*
|
182
203
|
* log('transformObjectFor')
|
183
204
|
*/
|
184
|
-
|
185
205
|
return (
|
186
206
|
Object.entries(document)
|
187
207
|
.reduce((values, [key, value]) => {
|
@@ -16,8 +16,9 @@ import {
|
|
16
16
|
getUri
|
17
17
|
} from 'shinkansen-transmission/transmission/common'
|
18
18
|
|
19
|
-
const log = debug('shinkansen-transmission
|
20
|
-
|
19
|
+
const log = debug('shinkansen-transmission/from-hash-to-document')
|
20
|
+
|
21
|
+
log('`shinkansen` is awake')
|
21
22
|
|
22
23
|
export function toNull (v) {
|
23
24
|
if (v === null || v === 'null') return null
|
@@ -78,7 +79,7 @@ export function transformValueFor (value, array) {
|
|
78
79
|
return transformValue(v)
|
79
80
|
}
|
80
81
|
} catch ({ message = 'No error message defined' }) {
|
81
|
-
|
82
|
+
log(message)
|
82
83
|
}
|
83
84
|
|
84
85
|
/*
|
@@ -204,7 +205,7 @@ export function transformItemsObjectFor (values, items = {}, parentUri = '#', ur
|
|
204
205
|
)
|
205
206
|
}
|
206
207
|
|
207
|
-
const handleError = ({ message = 'No error message defined' }) =>
|
208
|
+
const handleError = ({ message = 'No error message defined' }) => log(message)
|
208
209
|
|
209
210
|
// https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6
|
210
211
|
export function transformObjectSchemaNull (values, schema, { uri: parentUri, key: fieldKey }, uri = getUri(parentUri, fieldKey)) {
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import debug from 'debug'
|
2
|
+
|
3
|
+
const log = debug('shinkansen-transmission')
|
4
|
+
|
5
|
+
log('`shinkansen` is awake')
|
6
|
+
|
7
|
+
export * as common from './common/index.mjs'
|
8
|
+
export { default as fromDocumentToHash } from './from-document-to-hash/index.mjs'
|
9
|
+
export { default as fromHashToDocument } from './from-hash-to-document/index.mjs'
|
10
|
+
export { default as toZashiki } from './to-zashiki/index.mjs'
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './transform-root-schema.mjs'
|
@@ -71,11 +71,11 @@ import {
|
|
71
71
|
renderStringForOneOf,
|
72
72
|
renderStringForAllOf,
|
73
73
|
renderString
|
74
|
-
} from './transform-schema'
|
74
|
+
} from './transform-schema.mjs'
|
75
75
|
|
76
|
-
const log = debug('shinkansen-transmission
|
76
|
+
const log = debug('shinkansen-transmission/to-zashiki:root-schema')
|
77
77
|
|
78
|
-
log('`shinkansen
|
78
|
+
log('`shinkansen` is awake')
|
79
79
|
|
80
80
|
export function getRenderParamsForEnum (rootSchema, values, params) {
|
81
81
|
/*
|
@@ -54,9 +54,9 @@ import {
|
|
54
54
|
getElementsFieldValue
|
55
55
|
} from 'shinkansen-transmission/transmission/common'
|
56
56
|
|
57
|
-
const log = debug('shinkansen-transmission
|
57
|
+
const log = debug('shinkansen-transmission/to-zashiki/schema')
|
58
58
|
|
59
|
-
log('`shinkansen
|
59
|
+
log('`shinkansen` is awake')
|
60
60
|
|
61
61
|
export function mapTransformNullByIndex (rootSchema, values, params) {
|
62
62
|
/*
|
package/babel.config.js
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
const debug = require('debug')
|
2
|
-
|
3
|
-
const log = debug('shinkansen:transmission')
|
4
|
-
|
5
|
-
const {
|
6
|
-
env: {
|
7
|
-
NODE_ENV = 'development'
|
8
|
-
}
|
9
|
-
} = process
|
10
|
-
|
11
|
-
log('`shinkansen` is awake')
|
12
|
-
|
13
|
-
function env () {
|
14
|
-
log({ NODE_ENV })
|
15
|
-
|
16
|
-
return (
|
17
|
-
NODE_ENV === 'production'
|
18
|
-
)
|
19
|
-
}
|
20
|
-
|
21
|
-
const presets = [
|
22
|
-
[
|
23
|
-
'@babel/env', {
|
24
|
-
targets: {
|
25
|
-
node: '12.19.0',
|
26
|
-
browsers: [
|
27
|
-
'last 4 versions',
|
28
|
-
'safari >= 9',
|
29
|
-
'ios >= 8',
|
30
|
-
'ie >= 9',
|
31
|
-
'> 2%'
|
32
|
-
]
|
33
|
-
},
|
34
|
-
useBuiltIns: 'usage',
|
35
|
-
corejs: 3
|
36
|
-
}
|
37
|
-
]
|
38
|
-
]
|
39
|
-
|
40
|
-
const plugins = [
|
41
|
-
'@babel/proposal-export-default-from',
|
42
|
-
'@babel/proposal-export-namespace-from',
|
43
|
-
[
|
44
|
-
'module-resolver', {
|
45
|
-
alias: {
|
46
|
-
'shinkansen-transmission': './src'
|
47
|
-
}
|
48
|
-
}
|
49
|
-
]
|
50
|
-
]
|
51
|
-
|
52
|
-
module.exports = (api) => {
|
53
|
-
if (api) api.cache.using(env)
|
54
|
-
|
55
|
-
return {
|
56
|
-
compact: true,
|
57
|
-
comments: false,
|
58
|
-
presets,
|
59
|
-
plugins
|
60
|
-
}
|
61
|
-
}
|
package/index.js
DELETED
package/lib/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}require("core-js/modules/es.array.iterator.js");require("core-js/modules/es.object.to-string.js");require("core-js/modules/es.string.iterator.js");require("core-js/modules/es.weak-map.js");require("core-js/modules/web.dom-collections.iterator.js");require("core-js/modules/es.object.define-property.js");require("core-js/modules/es.object.get-own-property-descriptor.js");require("core-js/modules/es.symbol.js");require("core-js/modules/es.symbol.description.js");require("core-js/modules/es.symbol.iterator.js");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"fromDocumentToHash",{enumerable:true,get:function get(){return _fromDocumentToHash2["default"];}});Object.defineProperty(exports,"fromHashToDocument",{enumerable:true,get:function get(){return _fromHashToDocument2["default"];}});Object.defineProperty(exports,"toZashiki",{enumerable:true,get:function get(){return _toZashiki2["default"];}});exports.common=void 0;var _common=_interopRequireWildcard(require("./transmission/common"));exports.common=_common;var _fromDocumentToHash2=_interopRequireDefault(require("./transmission/from-document-to-hash"));var _fromHashToDocument2=_interopRequireDefault(require("./transmission/from-hash-to-document"));var _toZashiki2=_interopRequireDefault(require("./transmission/to-zashiki"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj};}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof(obj)!=="object"&&typeof obj!=="function"){return{"default":obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj["default"]=obj;if(cache){cache.set(obj,newObj);}return newObj;}
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";require("core-js/modules/es.object.to-string.js");require("core-js/modules/es.symbol.iterator.js");require("core-js/modules/es.array.iterator.js");require("core-js/modules/es.string.iterator.js");require("core-js/modules/web.dom-collections.iterator.js");require("core-js/modules/es.function.name.js");require("core-js/modules/es.array.from.js");require("core-js/modules/es.object.define-property.js");Object.defineProperty(exports,"__esModule",{value:true});exports.getSelectedItems=getSelectedItems;exports.isParentUri=isParentUri;exports.getMetaProps=getMetaProps;exports.getMetaDefaultValue=getMetaDefaultValue;exports.hasMetaValue=hasMetaValue;exports.getMetaValue=getMetaValue;exports.hasValue=hasValue;exports.getValue=getValue;exports.getValueForEnum=getValueForEnum;exports.getIndexForEnum=getIndexForEnum;exports.getValueForAnyOf=getValueForAnyOf;exports.getIndexForAnyOf=getIndexForAnyOf;exports.getValueForOneOf=getValueForOneOf;exports.getIndexForOneOf=getIndexForOneOf;exports.getElementsProps=getElementsProps;exports.getElementsTitleProps=getElementsTitleProps;exports.getElementsDescriptionProps=getElementsDescriptionProps;exports.getElementsFieldPropsForEnum=getElementsFieldPropsForEnum;exports.getElementsFieldPropsForOneOf=getElementsFieldPropsForOneOf;exports.getElementsFieldPropsForAnyOf=getElementsFieldPropsForAnyOf;exports.getElementsFieldPropsForAllOf=getElementsFieldPropsForAllOf;exports.getElementsFieldProps=getElementsFieldProps;exports.getElementsFieldValue=getElementsFieldValue;exports.getMin=getMin;exports.getMax=getMax;exports.getMinLength=getMinLength;exports.getMaxLength=getMaxLength;exports.getMinItems=getMinItems;exports.getMaxItems=getMaxItems;exports.getHasUniqueItems=getHasUniqueItems;exports.getMinContains=getMinContains;exports.getMaxContains=getMaxContains;exports.getMinProperties=getMinProperties;exports.getMaxProperties=getMaxProperties;exports.getIsExclusiveMin=getIsExclusiveMin;exports.getIsExclusiveMax=getIsExclusiveMax;exports.getStep=getStep;exports.getPattern=exports.normaliseUri=exports.getUri=exports.getAllOf=exports.hasAllOf=exports.getOneOf=exports.hasOneOf=exports.getAnyOf=exports.hasAnyOf=exports.getDefault=exports.hasDefault=exports.getConst=exports.hasConst=exports.getEnum=exports.hasEnum=exports.transformValue=exports.getIsWriteOnly=exports.getIsReadOnly=exports.getDescription=exports.getTitle=exports.isDefaultValue=exports.toDefaultValue=exports.isConstValue=exports.toConstValue=exports.isPrimitive=exports.isNullSchema=exports.isBooleanSchema=exports.isObjectSchema=exports.isArraySchema=exports.isNumberSchema=exports.isStringSchema=exports.isSchema=exports.isArray=exports.isObject=void 0;require("core-js/modules/es.array.is-array.js");require("core-js/modules/es.reflect.has.js");require("core-js/modules/es.reflect.get.js");require("core-js/modules/es.symbol.js");require("core-js/modules/es.symbol.description.js");require("core-js/modules/es.string.ends-with.js");require("core-js/modules/es.array.concat.js");require("core-js/modules/es.number.constructor.js");require("core-js/modules/es.array.map.js");require("core-js/modules/es.regexp.constructor.js");require("core-js/modules/es.regexp.exec.js");require("core-js/modules/es.regexp.to-string.js");require("core-js/modules/es.array.filter.js");require("core-js/modules/es.object.entries.js");require("core-js/modules/es.array.slice.js");require("core-js/modules/es.array.last-index-of.js");function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}var isObject=function isObject(v){return(v||false)instanceof Object&&!isArray(v);};exports.isObject=isObject;var isArray=function isArray(v){return Array.isArray(v);};exports.isArray=isArray;var isSchema=function isSchema(){var v=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.has(v,'type');};exports.isSchema=isSchema;var isStringSchema=function isStringSchema(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},type=_ref.type;return type==='string';};exports.isStringSchema=isStringSchema;var isNumberSchema=function isNumberSchema(){var _ref2=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},type=_ref2.type;return type==='number';};exports.isNumberSchema=isNumberSchema;var isArraySchema=function isArraySchema(){var _ref3=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},type=_ref3.type;return type==='array';};exports.isArraySchema=isArraySchema;var isObjectSchema=function isObjectSchema(){var _ref4=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},type=_ref4.type;return type==='object';};exports.isObjectSchema=isObjectSchema;var isBooleanSchema=function isBooleanSchema(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},type=_ref5.type;return type==='boolean';};exports.isBooleanSchema=isBooleanSchema;var isNullSchema=function isNullSchema(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},type=_ref6.type;return type==='null';};exports.isNullSchema=isNullSchema;var isPrimitive=function isPrimitive(v){return!isObject(v)&&!isArray(v);};exports.isPrimitive=isPrimitive;var toConstValue=function toConstValue(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.get(schema,'const');};exports.toConstValue=toConstValue;var isConstValue=function isConstValue(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.has(schema,'const');};exports.isConstValue=isConstValue;var toDefaultValue=function toDefaultValue(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.get(schema,'default');};exports.toDefaultValue=toDefaultValue;var isDefaultValue=function isDefaultValue(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.has(schema,'default');};exports.isDefaultValue=isDefaultValue;var getTitle=function getTitle(){var _ref7=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},title=_ref7.title;return title?{title:title}:{};};exports.getTitle=getTitle;var getDescription=function getDescription(){var _ref8=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},description=_ref8.description;return description?{description:description}:{};};exports.getDescription=getDescription;var getIsReadOnly=function getIsReadOnly(){var _ref9=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref9$readOnly=_ref9.readOnly,readOnly=_ref9$readOnly===void 0?false:_ref9$readOnly;return readOnly?{readOnly:readOnly}:{};};exports.getIsReadOnly=getIsReadOnly;var getIsWriteOnly=function getIsWriteOnly(){var _ref10=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref10$writeOnly=_ref10.writeOnly,writeOnly=_ref10$writeOnly===void 0?false:_ref10$writeOnly;return writeOnly?{writeOnly:writeOnly}:{};};exports.getIsWriteOnly=getIsWriteOnly;var getUriForRegExp=function getUriForRegExp(uri){return uri.endsWith('/')?uri:uri.concat('/');};function getSelectedItems(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var u=normaliseUri(uri);if(Reflect.has(values,u)){var v=Reflect.get(values,u);if(isPrimitive(v)){var n=Number(v);return isNaN(n)?[v]:[n];}else{return v.map(function(v){var n=Number(v);return isNaN(n)?v:n;});}}var pattern=new RegExp("^".concat(getUriForRegExp(u),"\\d+$"));return Object.entries(values).filter(function(_ref11){var _ref12=_slicedToArray(_ref11,1),key=_ref12[0];return pattern.test(key);}).map(function(_ref13){var _ref14=_slicedToArray(_ref13,2),key=_ref14[0],value=_ref14[1];var i=Number(key.slice(key.lastIndexOf('/')+1));var v=isArray(value)?value[i]:value;var n=Number(v);if(!isNaN(n))return n;return v;});}function isParentUri(){var parentUri=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'#';var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';return parentUri!=='#'&&parentUri!==uri;}function getMetaProps(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var meta;if(Reflect.has(params,uri)){var _Reflect$get=Reflect.get(params,uri);meta=_Reflect$get.meta;}return meta||{};}function getMetaDefaultValue(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(Reflect.has(schema,'default')){var defaultValue=Reflect.get(schema,'default');return{defaultValue:String(defaultValue)};}return{};}function hasMetaValue(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var schema=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(Reflect.has(values,uri)){var value=Reflect.get(values,uri);return isPrimitive(value);}else{if(Reflect.has(schema,'const')){var constValue=Reflect.get(schema,'const');return isPrimitive(constValue);}}return false;}function getMetaValue(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var schema=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(Reflect.has(values,uri)){var value=Reflect.get(values,uri);if(isPrimitive(value)){return{value:String(value)};}}else{if(Reflect.has(schema,'const')){var constValue=Reflect.get(schema,'const');if(isPrimitive(constValue)){return{value:String(constValue)};}}}return{};}var transformValue=function transformValue(schema){return isObject(schema)?isConstValue(schema)?toConstValue(schema):isDefaultValue(schema)?toDefaultValue(schema):schema:schema;};exports.transformValue=transformValue;function hasValue(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var schema=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(Reflect.has(values,uri)){var value=Reflect.get(values,uri);return isPrimitive(value);}else{if(Reflect.has(schema,'const')){var constValue=Reflect.get(schema,'const');return isPrimitive(constValue);}}return false;}function getValue(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var schema=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(Reflect.has(values,uri)){var value=Reflect.get(values,uri);if(isPrimitive(value)){return String(value);}}else{if(Reflect.has(schema,'const')){var constValue=Reflect.get(schema,'const');if(isPrimitive(constValue)){return String(constValue);}}}}function getValueForEnum(v){var _ref15=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref15$enum=_ref15["enum"],items=_ref15$enum===void 0?[]:_ref15$enum;if(Reflect.has(items,v)){var enumValue=Reflect.get(items,v);return String(enumValue);}}function getIndexForEnum(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var parentUri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var uri=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'#';var schema=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};if(/\/\d+$/.test(uri)){return Number(uri.slice(uri.lastIndexOf('/')+1));}return NaN;}function getValueForAnyOf(v){var _ref16=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref16$anyOf=_ref16.anyOf,items=_ref16$anyOf===void 0?[]:_ref16$anyOf;if(Reflect.has(items,v)){var anyOf=Reflect.get(items,v);var anyOfValue=transformValue(anyOf);if(isPrimitive(anyOfValue)){return String(anyOfValue);}}}function getIndexForAnyOf(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var parentUri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var uri=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'#';var schema=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};if(/\/\d+$/.test(uri)){return Number(uri.slice(uri.lastIndexOf('/')+1));}return NaN;}function getValueForOneOf(v){var _ref17=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref17$oneOf=_ref17.oneOf,items=_ref17$oneOf===void 0?[]:_ref17$oneOf;if(Reflect.has(items,v)){var oneOf=Reflect.get(items,v);var oneOfValue=transformValue(oneOf);if(isPrimitive(oneOfValue)){return String(oneOfValue);}}}function getIndexForOneOf(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var parentUri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var uri=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'#';var schema=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};if(/\/\d+$/.test(uri)){return Number(uri.slice(uri.lastIndexOf('/')+1));}return NaN;}function getElementsProps(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var elements;if(Reflect.has(params,uri)){var _Reflect$get2=Reflect.get(params,uri);var _Reflect$get2$element=_Reflect$get2.elements;elements=_Reflect$get2$element===void 0?{}:_Reflect$get2$element;}return elements||{};}function getElementsTitleProps(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var title;if(Reflect.has(params,uri)){var _Reflect$get3=Reflect.get(params,uri);var _Reflect$get3$element=_Reflect$get3.elements;_Reflect$get3$element=_Reflect$get3$element===void 0?{}:_Reflect$get3$element;title=_Reflect$get3$element.title;}return title||{};}function getElementsDescriptionProps(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var description;if(Reflect.has(params,uri)){var _Reflect$get4=Reflect.get(params,uri);var _Reflect$get4$element=_Reflect$get4.elements;_Reflect$get4$element=_Reflect$get4$element===void 0?{}:_Reflect$get4$element;description=_Reflect$get4$element.description;}return description||{};}function getElementsFieldPropsForEnum(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var field;if(Reflect.has(params,uri)){var _Reflect$get5=Reflect.get(params,uri);var _Reflect$get5$element=_Reflect$get5.elements;_Reflect$get5$element=_Reflect$get5$element===void 0?{}:_Reflect$get5$element;field=_Reflect$get5$element["enum"];}return field||{};}function getElementsFieldPropsForOneOf(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var field;if(Reflect.has(params,uri)){var _Reflect$get6=Reflect.get(params,uri);var _Reflect$get6$element=_Reflect$get6.elements;_Reflect$get6$element=_Reflect$get6$element===void 0?{}:_Reflect$get6$element;field=_Reflect$get6$element.oneOf;}return field||{};}function getElementsFieldPropsForAnyOf(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var field;if(Reflect.has(params,uri)){var _Reflect$get7=Reflect.get(params,uri);var _Reflect$get7$element=_Reflect$get7.elements;_Reflect$get7$element=_Reflect$get7$element===void 0?{}:_Reflect$get7$element;field=_Reflect$get7$element.anyOf;}return field||{};}function getElementsFieldPropsForAllOf(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var field;if(Reflect.has(params,uri)){var _Reflect$get8=Reflect.get(params,uri);var _Reflect$get8$element=_Reflect$get8.elements;_Reflect$get8$element=_Reflect$get8$element===void 0?{}:_Reflect$get8$element;field=_Reflect$get8$element.field;}return field||{};}function getElementsFieldProps(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var field;if(Reflect.has(params,uri)){var _Reflect$get9=Reflect.get(params,uri);var _Reflect$get9$element=_Reflect$get9.elements;_Reflect$get9$element=_Reflect$get9$element===void 0?{}:_Reflect$get9$element;field=_Reflect$get9$element.field;}return field||{};}function getElementsFieldValue(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var uri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'#';var schema=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(Reflect.has(values,uri)){var value=Reflect.get(values,uri);if(isPrimitive(value)){return{value:String(value)};}}else{if(Reflect.has(schema,'const')){var constValue=Reflect.get(schema,'const');if(isPrimitive(constValue)){return{value:String(constValue)};}}else{if(Reflect.has(schema,'default')){var defaultValue=Reflect.get(schema,'default');if(isPrimitive(defaultValue)){return{value:String(defaultValue)};}}}}return{};}var hasEnum=function hasEnum(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.has(schema,'enum');};exports.hasEnum=hasEnum;var getEnum=function getEnum(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.get(schema,'enum');};exports.getEnum=getEnum;var hasConst=function hasConst(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.has(schema,'const');};exports.hasConst=hasConst;var getConst=function getConst(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.get(schema,'const');};exports.getConst=getConst;var hasDefault=function hasDefault(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.has(schema,'default');};exports.hasDefault=hasDefault;var getDefault=function getDefault(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.get(schema,'default');};exports.getDefault=getDefault;var hasAnyOf=function hasAnyOf(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.has(schema,'anyOf');};exports.hasAnyOf=hasAnyOf;var getAnyOf=function getAnyOf(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.get(schema,'anyOf');};exports.getAnyOf=getAnyOf;var hasOneOf=function hasOneOf(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.has(schema,'oneOf');};exports.hasOneOf=hasOneOf;var getOneOf=function getOneOf(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.get(schema,'oneOf');};exports.getOneOf=getOneOf;var hasAllOf=function hasAllOf(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.has(schema,'allOf');};exports.hasAllOf=hasAllOf;var getAllOf=function getAllOf(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Reflect.get(schema,'allOf');};exports.getAllOf=getAllOf;var getUri=function getUri(){var uri=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'#';var resource=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';return(uri.endsWith('/')?uri:uri.concat('/')).concat(resource);};exports.getUri=getUri;var normaliseUri=function normaliseUri(){var uri=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'#';return uri==='#'?'#/':uri;};exports.normaliseUri=normaliseUri;function getMin(){var _ref18=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},minimum=_ref18.minimum;var value=Number(minimum);return isNaN(value)?{}:{min:value};}function getMax(){var _ref19=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},maximum=_ref19.maximum;var value=Number(maximum);return isNaN(value)?{}:{max:value};}function getMinLength(){var _ref20=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},minLength=_ref20.minLength;var value=Number(minLength);return isNaN(value)?{}:{minLength:value};}function getMaxLength(){var _ref21=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},maxLength=_ref21.maxLength;var value=Number(maxLength);return isNaN(value)?{}:{maxLength:value};}function getMinItems(){var _ref22=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},minItems=_ref22.minItems;var value=Number(minItems);return isNaN(value)?{}:{minItems:value};}function getMaxItems(){var _ref23=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},maxItems=_ref23.maxItems;var value=Number(maxItems);return isNaN(value)?{}:{maxItems:value};}function getHasUniqueItems(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(Reflect.has(schema,'uniqueItems')){var value=Reflect.get(schema,'uniqueItems');return typeof value==='boolean'?{hasUniqueItems:value}:{};}return{};}function getMinContains(){var _ref24=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},minContains=_ref24.minContains;var value=Number(minContains);return isNaN(value)?{}:{minContains:value};}function getMaxContains(){var _ref25=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},maxContains=_ref25.maxContains;var value=Number(maxContains);return isNaN(value)?{}:{maxContains:value};}function getMinProperties(){var _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},minProperties=_ref26.minProperties;var value=Number(minProperties);return isNaN(value)?{}:{minProperties:value};}function getMaxProperties(){var _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},maxProperties=_ref27.maxProperties;var value=Number(maxProperties);return isNaN(value)?{}:{maxProperties:value};}function getIsExclusiveMin(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(Reflect.has(schema,'exclusiveMinimum')){var value=Reflect.get(schema,'exclusiveMinimum');return typeof value==='boolean'?{isExclusiveMin:value}:{};}return{};}function getIsExclusiveMax(){var schema=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(Reflect.has(schema,'exclusiveMaximum')){var value=Reflect.get(schema,'exclusiveMaximum');return typeof value==='boolean'?{isExclusiveMax:value}:{};}return{};}var getPattern=function getPattern(){var _ref28=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},pattern=_ref28.pattern;return pattern?{pattern:pattern}:{};};exports.getPattern=getPattern;function getStep(){var _ref29=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},multipleOf=_ref29.multipleOf;var value=Number(multipleOf);return isNaN(value)?{}:{step:value};}
|