@sap-ux/yaml
Advanced tools
Comparing version 0.10.1 to 0.10.2
# @sap-ux/yaml | ||
## 0.10.2 | ||
### Patch Changes | ||
- 8de261b: Update npm dep and devDeps | ||
## 0.10.1 | ||
@@ -4,0 +10,0 @@ |
@@ -51,3 +51,3 @@ "use strict"; | ||
if (((_a = this.document.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) { | ||
throw new Error(i18n_1.t('error.yamlParsing') + '\n' + this.document.errors.map((e) => e.message).join('')); | ||
throw new Error((0, i18n_1.t)('error.yamlParsing') + '\n' + this.document.errors.map((e) => e.message).join('')); | ||
} | ||
@@ -65,3 +65,3 @@ } | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield i18n_1.initI18n(); | ||
yield (0, i18n_1.initI18n)(); | ||
return new YamlDocument(serializedYaml); | ||
@@ -131,3 +131,3 @@ }); | ||
// Not at root and we're not asked to create the intermediate keys | ||
throw new Error(i18n_1.t('error.pathDoesNotExist', { path: parentPath })); | ||
throw new Error((0, i18n_1.t)('error.pathDoesNotExist', { path: parentPath })); | ||
} | ||
@@ -159,3 +159,3 @@ } | ||
if (!createIntermediateKeys) { | ||
throw new Error(i18n_1.t('error.seqDoesNotExist', { path })); | ||
throw new Error((0, i18n_1.t)('error.seqDoesNotExist', { path })); | ||
} | ||
@@ -165,4 +165,4 @@ seq = new yaml_1.YAMLSeq(); | ||
} | ||
else if (!yaml_1.isSeq(seq)) { | ||
throw new Error(i18n_1.t('error.tryingToAppendToNonSequence', { path })); | ||
else if (!(0, yaml_1.isSeq)(seq)) { | ||
throw new Error((0, i18n_1.t)('error.tryingToAppendToNonSequence', { path })); | ||
} | ||
@@ -176,3 +176,3 @@ const newNode = this.document.createNode(value); | ||
if (typeof value !== 'object') { | ||
throw new Error(i18n_1.t('error.scalarValuesDoNotHaveProperties')); | ||
throw new Error((0, i18n_1.t)('error.scalarValuesDoNotHaveProperties')); | ||
} | ||
@@ -184,3 +184,3 @@ const index = seq.items.length - 1; | ||
if (!n) { | ||
throw new Error(i18n_1.t('error.propertyNotFound', { path: c.path })); | ||
throw new Error((0, i18n_1.t)('error.propertyNotFound', { path: c.path })); | ||
} | ||
@@ -208,3 +208,3 @@ n.comment = c.comment; | ||
if (!seq) { | ||
throw new Error(i18n_1.t('error.seqDoesNotExist', { path })); | ||
throw new Error((0, i18n_1.t)('error.seqDoesNotExist', { path })); | ||
} | ||
@@ -224,4 +224,4 @@ const node = seq.items.find((node) => node.toJSON()[matcher.key] === matcher.value); | ||
if (start) { | ||
if (!(yaml_1.isSeq(start) || yaml_1.isMap(start))) { | ||
throw new Error(i18n_1.t('error.startNodeMustBeCollection')); | ||
if (!((0, yaml_1.isSeq)(start) || (0, yaml_1.isMap)(start))) { | ||
throw new Error((0, i18n_1.t)('error.startNodeMustBeCollection')); | ||
} | ||
@@ -233,3 +233,3 @@ } | ||
if (!targetNode) { | ||
throw new Error(i18n_1.t('error.nodeNotFound', { path })); | ||
throw new Error((0, i18n_1.t)('error.nodeNotFound', { path })); | ||
} | ||
@@ -248,4 +248,4 @@ else { | ||
const a = this.getNode({ start, path }); | ||
if (!yaml_1.isSeq(a)) { | ||
throw new Error(i18n_1.t('error.seqDoesNotExist', { path })); | ||
if (!(0, yaml_1.isSeq)(a)) { | ||
throw new Error((0, i18n_1.t)('error.seqDoesNotExist', { path })); | ||
} | ||
@@ -264,4 +264,4 @@ else { | ||
const a = this.getNode({ start, path }); | ||
if (!yaml_1.isMap(a)) { | ||
throw new Error(i18n_1.t('error.nodeNotAMap', { path })); | ||
if (!(0, yaml_1.isMap)(a)) { | ||
throw new Error((0, i18n_1.t)('error.nodeNotAMap', { path })); | ||
} | ||
@@ -294,3 +294,3 @@ else { | ||
if (!result || result.length === 0) { | ||
throw new Error(i18n_1.t('error.pathCannotBeEmpty')); | ||
throw new Error((0, i18n_1.t)('error.pathCannotBeEmpty')); | ||
} | ||
@@ -297,0 +297,0 @@ return result; |
{ | ||
"name": "@sap-ux/yaml", | ||
"description": "Library to manipulate YAML file contents", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"main": "dist/index.js", | ||
@@ -29,4 +29,3 @@ "scripts": { | ||
"@types/i18next-fs-backend": "1.0.0", | ||
"@types/lodash.merge": "4.6.6", | ||
"typescript": "4.2.4" | ||
"@types/lodash.merge": "4.6.6" | ||
}, | ||
@@ -33,0 +32,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41982
2