step-node-agent 3.27.1 → 3.27.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.
@@ -24,6 +24,8 @@ To install:
24
24
 
25
25
  ```sh
26
26
  npm install yaml
27
+ # or
28
+ deno add jsr:@eemeli/yaml
27
29
  ```
28
30
 
29
31
  **Note:** These docs are for `yaml@2`. For v1, see the [v1.10.0 tag](https://github.com/eemeli/yaml/tree/v1.10.0) for the source and [eemeli.org/yaml/v1](https://eemeli.org/yaml/v1/) for the documentation.
@@ -64,8 +64,8 @@ function composeCollection(CN, ctx, token, props, onError) {
64
64
  tag = kt;
65
65
  }
66
66
  else {
67
- if (kt?.collection) {
68
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
67
+ if (kt) {
68
+ onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
69
69
  }
70
70
  else {
71
71
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
@@ -668,7 +668,20 @@ class Parser {
668
668
  default: {
669
669
  const bv = this.startBlockValue(map);
670
670
  if (bv) {
671
- if (atMapIndent && bv.type !== 'block-seq') {
671
+ if (bv.type === 'block-seq') {
672
+ if (!it.explicitKey &&
673
+ it.sep &&
674
+ !includesToken(it.sep, 'newline')) {
675
+ yield* this.pop({
676
+ type: 'error',
677
+ offset: this.offset,
678
+ message: 'Unexpected block-seq-ind on same line with key',
679
+ source: this.source
680
+ });
681
+ return;
682
+ }
683
+ }
684
+ else if (atMapIndent) {
672
685
  map.items.push({ start });
673
686
  }
674
687
  this.stack.push(bv);
@@ -28,6 +28,8 @@ const binary = {
28
28
  }
29
29
  },
30
30
  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
31
+ if (!value)
32
+ return '';
31
33
  const buf = value; // checked earlier by binary.identify()
32
34
  let str;
33
35
  if (typeof btoa === 'function') {
@@ -95,7 +95,7 @@ const timestamp = {
95
95
  }
96
96
  return new Date(date);
97
97
  },
98
- stringify: ({ value }) => value.toISOString().replace(/(T00:00:00)?\.000Z$/, '')
98
+ stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
99
99
  };
100
100
 
101
101
  export { floatTime, intTime, timestamp };
@@ -66,8 +66,8 @@ function composeCollection(CN, ctx, token, props, onError) {
66
66
  tag = kt;
67
67
  }
68
68
  else {
69
- if (kt?.collection) {
70
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
69
+ if (kt) {
70
+ onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
71
71
  }
72
72
  else {
73
73
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
@@ -673,7 +673,20 @@ class Parser {
673
673
  default: {
674
674
  const bv = this.startBlockValue(map);
675
675
  if (bv) {
676
- if (atMapIndent && bv.type !== 'block-seq') {
676
+ if (bv.type === 'block-seq') {
677
+ if (!it.explicitKey &&
678
+ it.sep &&
679
+ !includesToken(it.sep, 'newline')) {
680
+ yield* this.pop({
681
+ type: 'error',
682
+ offset: this.offset,
683
+ message: 'Unexpected block-seq-ind on same line with key',
684
+ source: this.source
685
+ });
686
+ return;
687
+ }
688
+ }
689
+ else if (atMapIndent) {
677
690
  map.items.push({ start });
678
691
  }
679
692
  this.stack.push(bv);
@@ -34,6 +34,8 @@ const binary = {
34
34
  }
35
35
  },
36
36
  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
37
+ if (!value)
38
+ return '';
37
39
  const buf = value; // checked earlier by binary.identify()
38
40
  let str;
39
41
  if (typeof node_buffer.Buffer === 'function') {
@@ -97,7 +97,7 @@ const timestamp = {
97
97
  }
98
98
  return new Date(date);
99
99
  },
100
- stringify: ({ value }) => value.toISOString().replace(/(T00:00:00)?\.000Z$/, '')
100
+ stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
101
101
  };
102
102
 
103
103
  exports.floatTime = floatTime;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "license": "ISC",
5
5
  "author": "Eemeli Aro <eemeli@gmail.com>",
6
6
  "repository": "github:eemeli/yaml",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "step-node-agent",
3
- "version": "3.27.1",
3
+ "version": "3.27.3",
4
4
  "description": "The official STEP Agent implementation for Node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {