Skip to content

Commit 8122e20

Browse files
author
GitHub Actions
committed
(chore) updating dist
1 parent 1f79105 commit 8122e20

1 file changed

Lines changed: 15 additions & 19 deletions

File tree

dist/index.js

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42140,7 +42140,7 @@ function State (input, options) {
4214042140
this.json = options['json'] || false
4214142141
this.listener = options['listener'] || null
4214242142
this.maxDepth = typeof options['maxDepth'] === 'number' ? options['maxDepth'] : 100
42143-
this.maxMergeSeqLength = typeof options['maxMergeSeqLength'] === 'number' ? options['maxMergeSeqLength'] : 20
42143+
this.maxTotalMergeKeys = typeof options['maxTotalMergeKeys'] === 'number' ? options['maxTotalMergeKeys'] : 10000
4214442144

4214542145
this.implicitTypes = this.schema.compiledImplicit
4214642146
this.typeMap = this.schema.compiledTypeMap
@@ -42151,6 +42151,7 @@ function State (input, options) {
4215142151
this.lineStart = 0
4215242152
this.lineIndent = 0
4215342153
this.depth = 0
42154+
this.totalMergeKeys = 0
4215442155

4215542156
// position of first leading tab in the current line,
4215642157
// used to make sure there are no tabs in the indentation
@@ -42368,6 +42369,10 @@ function mergeMappings (state, destination, source, overridableKeys) {
4236842369
for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
4236942370
const key = sourceKeys[index]
4237042371

42372+
if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
42373+
throwError(state, 'merge keys exceeded maxTotalMergeKeys (' + state.maxTotalMergeKeys + ')')
42374+
}
42375+
4237142376
if (!_hasOwnProperty.call(destination, key)) {
4237242377
setProperty(destination, key, source[key])
4237342378
overridableKeys[key] = true
@@ -42409,17 +42414,8 @@ function storeMappingPair (state, _result, overridableKeys, keyTag, keyNode, val
4240942414

4241042415
if (keyTag === 'tag:yaml.org,2002:merge') {
4241142416
if (Array.isArray(valueNode)) {
42412-
if (valueNode.length > state.maxMergeSeqLength) {
42413-
throwError(state, 'merge sequence length exceeded maxMergeSeqLength (' + state.maxMergeSeqLength + ')')
42414-
}
42415-
const seen = new Set()
4241642417
for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
42417-
const src = valueNode[index]
42418-
// Existing keys are not overridden on merge, so dedupe sources to
42419-
// avoid redundant work on repeated aliases.
42420-
if (seen.has(src)) continue
42421-
seen.add(src)
42422-
mergeMappings(state, _result, src, overridableKeys)
42418+
mergeMappings(state, _result, valueNode[index], overridableKeys)
4242342419
}
4242442420
} else {
4242542421
mergeMappings(state, _result, valueNode, overridableKeys)
@@ -44378,7 +44374,7 @@ function resolveYamlFloat (data) {
4437844374
return false
4437944375
}
4438044376

44381-
if (Number.isFinite(parseFloat(data, 10))) {
44377+
if (isFinite(parseFloat(data, 10))) {
4438244378
return true
4438344379
}
4438444380

@@ -44506,7 +44502,7 @@ function resolveYamlInteger (data) {
4450644502
if (ch !== '0' && ch !== '1') return false
4450744503
hasDigits = true
4450844504
}
44509-
return hasDigits && Number.isFinite(parseYamlInteger(data))
44505+
return hasDigits && isFinite(parseYamlInteger(data))
4451044506
}
4451144507

4451244508
if (ch === 'x') {
@@ -44517,7 +44513,7 @@ function resolveYamlInteger (data) {
4451744513
if (!isHexCode(data.charCodeAt(index))) return false
4451844514
hasDigits = true
4451944515
}
44520-
return hasDigits && Number.isFinite(parseYamlInteger(data))
44516+
return hasDigits && isFinite(parseYamlInteger(data))
4452144517
}
4452244518

4452344519
if (ch === 'o') {
@@ -44528,7 +44524,7 @@ function resolveYamlInteger (data) {
4452844524
if (!isOctCode(data.charCodeAt(index))) return false
4452944525
hasDigits = true
4453044526
}
44531-
return hasDigits && Number.isFinite(parseYamlInteger(data))
44527+
return hasDigits && isFinite(parseYamlInteger(data))
4453244528
}
4453344529
}
4453444530

@@ -44543,7 +44539,7 @@ function resolveYamlInteger (data) {
4454344539

4454444540
if (!hasDigits) return false
4454544541

44546-
return Number.isFinite(parseYamlInteger(data))
44542+
return isFinite(parseYamlInteger(data))
4454744543
}
4454844544

4454944545
function parseYamlInteger (data) {
@@ -44694,7 +44690,7 @@ const _toString = Object.prototype.toString
4469444690
function resolveYamlOmap (data) {
4469544691
if (data === null) return true
4469644692

44697-
const objectKeys = []
44693+
const objectKeys = {}
4469844694
const object = data
4469944695

4470044696
for (let index = 0, length = object.length; index < length; index += 1) {
@@ -44713,8 +44709,8 @@ function resolveYamlOmap (data) {
4471344709

4471444710
if (!pairHasKey) return false
4471544711

44716-
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey)
44717-
else return false
44712+
if (_hasOwnProperty.call(objectKeys, pairKey)) return false
44713+
Object.defineProperty(objectKeys, pairKey, { value: true })
4471844714
}
4471944715

4472044716
return true

0 commit comments

Comments
 (0)