yaml 2.3.2 → 2.3.4

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.
@@ -116,12 +116,19 @@ class Directives {
116
116
  onError('Verbatim tags must end with a >');
117
117
  return verbatim;
118
118
  }
119
- const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/);
119
+ const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
120
120
  if (!suffix)
121
121
  onError(`The ${source} tag has no suffix`);
122
122
  const prefix = this.tags[handle];
123
- if (prefix)
124
- return prefix + decodeURIComponent(suffix);
123
+ if (prefix) {
124
+ try {
125
+ return prefix + decodeURIComponent(suffix);
126
+ }
127
+ catch (error) {
128
+ onError(String(error));
129
+ return null;
130
+ }
131
+ }
125
132
  if (handle === '!')
126
133
  return source; // local tag
127
134
  onError(`Could not resolve tag: ${source}`);
@@ -118,12 +118,19 @@ class Directives {
118
118
  onError('Verbatim tags must end with a >');
119
119
  return verbatim;
120
120
  }
121
- const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/);
121
+ const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
122
122
  if (!suffix)
123
123
  onError(`The ${source} tag has no suffix`);
124
124
  const prefix = this.tags[handle];
125
- if (prefix)
126
- return prefix + decodeURIComponent(suffix);
125
+ if (prefix) {
126
+ try {
127
+ return prefix + decodeURIComponent(suffix);
128
+ }
129
+ catch (error) {
130
+ onError(String(error));
131
+ return null;
132
+ }
133
+ }
127
134
  if (handle === '!')
128
135
  return source; // local tag
129
136
  onError(`Could not resolve tag: ${source}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "license": "ISC",
5
5
  "author": "Eemeli Aro <eemeli@gmail.com>",
6
6
  "repository": "github:eemeli/yaml",