run npm install to generate a package lock

This commit is contained in:
sashinexists
2024-12-07 13:18:31 +11:00
parent e7d08a91b5
commit 23437d228e
2501 changed files with 290663 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import { toString } from "../utilities.js";
import deepValuesIterator from "./deepValuesIterator.js";
/**
* Concatenate the deep text values in a tree.
*
* @typedef {import("@weborigami/types").AsyncTree} AsyncTree
*
* @this {AsyncTree|null}
* @param {import("../../index.ts").Treelike} treelike
*/
export default async function concatTreeValues(treelike) {
if (!treelike) {
const error = new TypeError(`concat: The tree isn't defined.`);
/** @type {any} */ (error).position = 0;
throw error;
}
const strings = [];
for await (const value of deepValuesIterator(treelike, { expand: true })) {
let string;
if (value === null) {
console.warn("Warning: Origami template encountered a null value");
string = "null";
} else if (value === undefined) {
console.warn("Warning: Origami template encountered an undefined value");
string = "undefined";
} else {
string = toString(value);
}
strings.push(string);
}
return strings.join("");
}