@diplodoc/cli 4.12.1 → 4.13.1

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.
package/build/index.js CHANGED
@@ -1046,7 +1046,7 @@ function getContentWithUpdatedStaticMetadata({
1046
1046
  if (!Array.isArray(parsed.metadata)) {
1047
1047
  parsed.metadata = [parsed.metadata];
1048
1048
  }
1049
- parsed.metadata = parsed.metadata.concat(metadataVars);
1049
+ parsed.metadata = parsed.metadata.concat(metadataVars).filter(Boolean);
1050
1050
  const patchedMetada = (0, import_js_yaml2.dump)(parsed);
1051
1051
  return `${getUpdatedMetadataString(newMetadatas, patchedMetada)}${fileMainContent}`;
1052
1052
  }
@@ -2197,7 +2197,7 @@ var fixRelativePath = (relativeTo) => (path) => {
2197
2197
  };
2198
2198
  function resolveMd2HTML(options) {
2199
2199
  return __async(this, null, function* () {
2200
- var _a;
2200
+ var _a, _b;
2201
2201
  const { inputPath, fileExtension, outputPath, outputBundlePath, metadata } = options;
2202
2202
  const pathToDir = (0, import_path20.dirname)(inputPath);
2203
2203
  const toc = tocs_default.getForPath(inputPath) || null;
@@ -2212,11 +2212,10 @@ function resolveMd2HTML(options) {
2212
2212
  const { result } = transformFn(content, { path: inputPath });
2213
2213
  const updatedMetadata = (metadata == null ? void 0 : metadata.isContributorsEnabled) ? yield getVCSMetadata(metadata, content, result == null ? void 0 : result.meta) : result.meta;
2214
2214
  const fileMeta = fileExtension === ".yaml" ? (_a = result.data.meta) != null ? _a : {} : updatedMetadata;
2215
- if (Array.isArray(fileMeta == null ? void 0 : fileMeta.metadata)) {
2216
- fileMeta.metadata.push(...vars.__metadata || []);
2217
- } else {
2218
- fileMeta.metadata = vars.__metadata || [];
2215
+ if (!Array.isArray(fileMeta == null ? void 0 : fileMeta.metadata)) {
2216
+ fileMeta.metadata = [fileMeta == null ? void 0 : fileMeta.metadata].filter(Boolean);
2219
2217
  }
2218
+ fileMeta.metadata = fileMeta.metadata.concat(((_b = vars.__metadata) == null ? void 0 : _b.filter(Boolean)) || []);
2220
2219
  if (allowCustomResources) {
2221
2220
  const { script, style } = (metadata == null ? void 0 : metadata.resources) || {};
2222
2221
  fileMeta.style = (fileMeta.style || []).concat(style || []).map(fixRelativePath(inputPath));
@@ -4247,7 +4246,7 @@ import_yargs.default.command(build).command(publish).command(xliff).command(tran
4247
4246
  default: false,
4248
4247
  describe: "Run in quiet mode. Don't write logs to stdout",
4249
4248
  type: "boolean"
4250
- }).group(["config", "strict", "quiet", "help", "version"], "Common options:").version(true ? "4.12.1" : "").help().parse((0, import_helpers.hideBin)(process.argv), {}, (err, { strict }, output) => {
4249
+ }).group(["config", "strict", "quiet", "help", "version"], "Common options:").version(true ? "4.13.1" : "").help().parse((0, import_helpers.hideBin)(process.argv), {}, (err, { strict }, output) => {
4251
4250
  console.timeEnd(MAIN_TIMER_ID);
4252
4251
  if (err) {
4253
4252
  console.error(err);