@@ -67,4 +67,4 @@ import { isNode } from '../nodes/identity.js'; | ||
| else { | ||
| if (kt?.collection) { | ||
| onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true); | ||
| if (kt) { | ||
| onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true); | ||
| } | ||
@@ -71,0 +71,0 @@ else { |
@@ -671,3 +671,16 @@ import { tokenType } from './cst.js'; | ||
| if (bv) { | ||
| if (atMapIndent && bv.type !== 'block-seq') { | ||
| if (bv.type === 'block-seq') { | ||
| if (!it.explicitKey && | ||
| it.sep && | ||
| !includesToken(it.sep, 'newline')) { | ||
| yield* this.pop({ | ||
| type: 'error', | ||
| offset: this.offset, | ||
| message: 'Unexpected block-seq-ind on same line with key', | ||
| source: this.source | ||
| }); | ||
| return; | ||
| } | ||
| } | ||
| else if (atMapIndent) { | ||
| map.items.push({ start }); | ||
@@ -674,0 +687,0 @@ } |
@@ -31,2 +31,4 @@ import { Scalar } from '../../nodes/Scalar.js'; | ||
| stringify({ comment, type, value }, ctx, onComment, onChompKeep) { | ||
| if (!value) | ||
| return ''; | ||
| const buf = value; // checked earlier by binary.identify() | ||
@@ -33,0 +35,0 @@ let str; |
@@ -98,5 +98,5 @@ import { stringifyNumber } from '../../stringify/stringifyNumber.js'; | ||
| }, | ||
| stringify: ({ value }) => value.toISOString().replace(/(T00:00:00)?\.000Z$/, '') | ||
| stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? '' | ||
| }; | ||
| export { floatTime, intTime, timestamp }; |
@@ -69,4 +69,4 @@ 'use strict'; | ||
| else { | ||
| if (kt?.collection) { | ||
| onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true); | ||
| if (kt) { | ||
| onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true); | ||
| } | ||
@@ -73,0 +73,0 @@ else { |
+14
-1
@@ -676,3 +676,16 @@ 'use strict'; | ||
| if (bv) { | ||
| if (atMapIndent && bv.type !== 'block-seq') { | ||
| if (bv.type === 'block-seq') { | ||
| if (!it.explicitKey && | ||
| it.sep && | ||
| !includesToken(it.sep, 'newline')) { | ||
| yield* this.pop({ | ||
| type: 'error', | ||
| offset: this.offset, | ||
| message: 'Unexpected block-seq-ind on same line with key', | ||
| source: this.source | ||
| }); | ||
| return; | ||
| } | ||
| } | ||
| else if (atMapIndent) { | ||
| map.items.push({ start }); | ||
@@ -679,0 +692,0 @@ } |
@@ -37,2 +37,4 @@ 'use strict'; | ||
| stringify({ comment, type, value }, ctx, onComment, onChompKeep) { | ||
| if (!value) | ||
| return ''; | ||
| const buf = value; // checked earlier by binary.identify() | ||
@@ -39,0 +41,0 @@ let str; |
@@ -100,3 +100,3 @@ 'use strict'; | ||
| }, | ||
| stringify: ({ value }) => value.toISOString().replace(/(T00:00:00)?\.000Z$/, '') | ||
| stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? '' | ||
| }; | ||
@@ -103,0 +103,0 @@ |
+1
-1
| { | ||
| "name": "yaml", | ||
| "version": "2.7.0", | ||
| "version": "2.7.1", | ||
| "license": "ISC", | ||
@@ -5,0 +5,0 @@ "author": "Eemeli Aro <eemeli@gmail.com>", |
+2
-0
@@ -27,2 +27,4 @@ # YAML <a href="https://www.npmjs.com/package/yaml"><img align="right" src="https://badge.fury.io/js/yaml.svg" title="npm package" /></a> | ||
| npm install yaml | ||
| # or | ||
| deno add jsr:@eemeli/yaml | ||
| ``` | ||
@@ -29,0 +31,0 @@ |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
682531
0.21%18038
0.17%191
1.06%15
-53.12%