Leon4gr45 commited on
Commit
61e6bb9
·
verified ·
1 Parent(s): a1dd98b

Re-add Swagger dependencies (part 7)

Browse files
node_modules/js-yaml/README.md CHANGED
@@ -88,9 +88,11 @@ options:
88
  https://www.yaml.org/spec/1.2/spec.html#id2804923
89
  - `DEFAULT_SCHEMA` - all supported YAML types.
90
  - `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error.
91
- - `maxDepth` _(default: 100)_ - limits nesting depth for collections.
92
- - `maxMergeSeqLength` _(default: 20)_ - limits the number of elements in merge
93
- (`<<`) sequences.
 
 
94
 
95
  NOTE: This function **does not** understand multi-document sources, it throws
96
  exception on those.
 
88
  https://www.yaml.org/spec/1.2/spec.html#id2804923
89
  - `DEFAULT_SCHEMA` - all supported YAML types.
90
  - `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error.
91
+ - `maxDepth` _(default: 100)_ - limits nesting depth for collections (does not
92
+ take aliasees into account).
93
+ - `maxTotalMergeKeys` _(default: 10000)_ - limits the total number of keys
94
+ processed by merge (`<<`) across one `load()` / `loadAll()` call. Set to `-1`
95
+ to disable.
96
 
97
  NOTE: This function **does not** understand multi-document sources, it throws
98
  exception on those.
node_modules/js-yaml/lib/loader.js CHANGED
@@ -152,7 +152,7 @@ function State (input, options) {
152
  this.json = options['json'] || false
153
  this.listener = options['listener'] || null
154
  this.maxDepth = typeof options['maxDepth'] === 'number' ? options['maxDepth'] : 100
155
- this.maxMergeSeqLength = typeof options['maxMergeSeqLength'] === 'number' ? options['maxMergeSeqLength'] : 20
156
 
157
  this.implicitTypes = this.schema.compiledImplicit
158
  this.typeMap = this.schema.compiledTypeMap
@@ -163,6 +163,7 @@ function State (input, options) {
163
  this.lineStart = 0
164
  this.lineIndent = 0
165
  this.depth = 0
 
166
 
167
  // position of first leading tab in the current line,
168
  // used to make sure there are no tabs in the indentation
@@ -380,6 +381,10 @@ function mergeMappings (state, destination, source, overridableKeys) {
380
  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
381
  const key = sourceKeys[index]
382
 
 
 
 
 
383
  if (!_hasOwnProperty.call(destination, key)) {
384
  setProperty(destination, key, source[key])
385
  overridableKeys[key] = true
@@ -421,17 +426,8 @@ function storeMappingPair (state, _result, overridableKeys, keyTag, keyNode, val
421
 
422
  if (keyTag === 'tag:yaml.org,2002:merge') {
423
  if (Array.isArray(valueNode)) {
424
- if (valueNode.length > state.maxMergeSeqLength) {
425
- throwError(state, 'merge sequence length exceeded maxMergeSeqLength (' + state.maxMergeSeqLength + ')')
426
- }
427
- const seen = new Set()
428
  for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
429
- const src = valueNode[index]
430
- // Existing keys are not overridden on merge, so dedupe sources to
431
- // avoid redundant work on repeated aliases.
432
- if (seen.has(src)) continue
433
- seen.add(src)
434
- mergeMappings(state, _result, src, overridableKeys)
435
  }
436
  } else {
437
  mergeMappings(state, _result, valueNode, overridableKeys)
 
152
  this.json = options['json'] || false
153
  this.listener = options['listener'] || null
154
  this.maxDepth = typeof options['maxDepth'] === 'number' ? options['maxDepth'] : 100
155
+ this.maxTotalMergeKeys = typeof options['maxTotalMergeKeys'] === 'number' ? options['maxTotalMergeKeys'] : 10000
156
 
157
  this.implicitTypes = this.schema.compiledImplicit
158
  this.typeMap = this.schema.compiledTypeMap
 
163
  this.lineStart = 0
164
  this.lineIndent = 0
165
  this.depth = 0
166
+ this.totalMergeKeys = 0
167
 
168
  // position of first leading tab in the current line,
169
  // used to make sure there are no tabs in the indentation
 
381
  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
382
  const key = sourceKeys[index]
383
 
384
+ if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
385
+ throwError(state, 'merge keys exceeded maxTotalMergeKeys (' + state.maxTotalMergeKeys + ')')
386
+ }
387
+
388
  if (!_hasOwnProperty.call(destination, key)) {
389
  setProperty(destination, key, source[key])
390
  overridableKeys[key] = true
 
426
 
427
  if (keyTag === 'tag:yaml.org,2002:merge') {
428
  if (Array.isArray(valueNode)) {
 
 
 
 
429
  for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
430
+ mergeMappings(state, _result, valueNode[index], overridableKeys)
 
 
 
 
 
431
  }
432
  } else {
433
  mergeMappings(state, _result, valueNode, overridableKeys)
node_modules/js-yaml/lib/type/float.js CHANGED
@@ -28,7 +28,7 @@ function resolveYamlFloat (data) {
28
  return false
29
  }
30
 
31
- if (Number.isFinite(parseFloat(data, 10))) {
32
  return true
33
  }
34
 
 
28
  return false
29
  }
30
 
31
+ if (isFinite(parseFloat(data, 10))) {
32
  return true
33
  }
34
 
node_modules/js-yaml/lib/type/int.js CHANGED
@@ -49,7 +49,7 @@ function resolveYamlInteger (data) {
49
  if (ch !== '0' && ch !== '1') return false
50
  hasDigits = true
51
  }
52
- return hasDigits && Number.isFinite(parseYamlInteger(data))
53
  }
54
 
55
  if (ch === 'x') {
@@ -60,7 +60,7 @@ function resolveYamlInteger (data) {
60
  if (!isHexCode(data.charCodeAt(index))) return false
61
  hasDigits = true
62
  }
63
- return hasDigits && Number.isFinite(parseYamlInteger(data))
64
  }
65
 
66
  if (ch === 'o') {
@@ -71,7 +71,7 @@ function resolveYamlInteger (data) {
71
  if (!isOctCode(data.charCodeAt(index))) return false
72
  hasDigits = true
73
  }
74
- return hasDigits && Number.isFinite(parseYamlInteger(data))
75
  }
76
  }
77
 
@@ -86,7 +86,7 @@ function resolveYamlInteger (data) {
86
 
87
  if (!hasDigits) return false
88
 
89
- return Number.isFinite(parseYamlInteger(data))
90
  }
91
 
92
  function parseYamlInteger (data) {
 
49
  if (ch !== '0' && ch !== '1') return false
50
  hasDigits = true
51
  }
52
+ return hasDigits && isFinite(parseYamlInteger(data))
53
  }
54
 
55
  if (ch === 'x') {
 
60
  if (!isHexCode(data.charCodeAt(index))) return false
61
  hasDigits = true
62
  }
63
+ return hasDigits && isFinite(parseYamlInteger(data))
64
  }
65
 
66
  if (ch === 'o') {
 
71
  if (!isOctCode(data.charCodeAt(index))) return false
72
  hasDigits = true
73
  }
74
+ return hasDigits && isFinite(parseYamlInteger(data))
75
  }
76
  }
77
 
 
86
 
87
  if (!hasDigits) return false
88
 
89
+ return isFinite(parseYamlInteger(data))
90
  }
91
 
92
  function parseYamlInteger (data) {
node_modules/js-yaml/package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "js-yaml",
3
- "version": "4.2.0",
4
  "description": "YAML 1.2 parser and serializer",
5
  "keywords": [
6
  "yaml",
@@ -32,6 +32,9 @@
32
  "bin/",
33
  "dist/"
34
  ],
 
 
 
35
  "bin": {
36
  "js-yaml": "bin/js-yaml.js"
37
  },
@@ -53,8 +56,7 @@
53
  "build": "node support/build-dist.mjs",
54
  "build:demo": "npm run lint && node support/build_demo.mjs",
55
  "gh-demo": "npm run build:demo && gh-pages -d demo -f",
56
- "prepack": "npm test && npm run build && npm run build:demo",
57
- "postpublish": "npm run gh-demo"
58
  },
59
  "unpkg": "dist/js-yaml.min.js",
60
  "jsdelivr": "dist/js-yaml.min.js",
@@ -62,6 +64,10 @@
62
  "argparse": "^2.0.1"
63
  },
64
  "devDependencies": {
 
 
 
 
65
  "c8": "^11.0.0",
66
  "codemirror": "^5.65.21",
67
  "eslint": "^9.39.4",
@@ -69,7 +75,7 @@
69
  "gh-pages": "^6.3.0",
70
  "neostandard": "^0.13.0",
71
  "tinybench": "^6.0.2",
72
- "vite": "^8.0.14",
73
  "vite-plugin-node-polyfills": "^0.28.0",
74
  "vite-plugin-singlefile": "^2.3.3",
75
  "workerpool": "^10.0.2"
 
1
  {
2
  "name": "js-yaml",
3
+ "version": "4.3.0",
4
  "description": "YAML 1.2 parser and serializer",
5
  "keywords": [
6
  "yaml",
 
32
  "bin/",
33
  "dist/"
34
  ],
35
+ "publishConfig": {
36
+ "tag": "v4-legacy"
37
+ },
38
  "bin": {
39
  "js-yaml": "bin/js-yaml.js"
40
  },
 
56
  "build": "node support/build-dist.mjs",
57
  "build:demo": "npm run lint && node support/build_demo.mjs",
58
  "gh-demo": "npm run build:demo && gh-pages -d demo -f",
59
+ "prepack": "npm test && npm run build"
 
60
  },
61
  "unpkg": "dist/js-yaml.min.js",
62
  "jsdelivr": "dist/js-yaml.min.js",
 
64
  "argparse": "^2.0.1"
65
  },
66
  "devDependencies": {
67
+ "@babel/core": "8.0.1",
68
+ "@babel/preset-env": "8.0.1",
69
+ "@rollup/plugin-commonjs": "29.0.3",
70
+ "@rollup/plugin-terser": "0.4.4",
71
  "c8": "^11.0.0",
72
  "codemirror": "^5.65.21",
73
  "eslint": "^9.39.4",
 
75
  "gh-pages": "^6.3.0",
76
  "neostandard": "^0.13.0",
77
  "tinybench": "^6.0.2",
78
+ "vite": "7.3.6",
79
  "vite-plugin-node-polyfills": "^0.28.0",
80
  "vite-plugin-singlefile": "^2.3.3",
81
  "workerpool": "^10.0.2"