diff options
Diffstat (limited to 'node_modules/yaml/dist')
| -rw-r--r-- | node_modules/yaml/dist/doc/directives.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/node_modules/yaml/dist/doc/directives.js b/node_modules/yaml/dist/doc/directives.js index 854c7e56..2eb9d3c5 100644 --- a/node_modules/yaml/dist/doc/directives.js +++ b/node_modules/yaml/dist/doc/directives.js @@ -122,8 +122,15 @@ class Directives { if (!suffix) onError(`The ${source} tag has no suffix`); const prefix = this.tags[handle]; - if (prefix) - return prefix + decodeURIComponent(suffix); + if (prefix) { + try { + return prefix + decodeURIComponent(suffix); + } + catch (error) { + onError(String(error)); + return null; + } + } if (handle === '!') return source; // local tag onError(`Could not resolve tag: ${source}`); |
