UNPKG

mlld

Version:

mlld: llm scripting language

41 lines (39 loc) 1.76 kB
import { __name } from './chunk-NJQWMXLH.mjs'; // core/types/load-content.ts function isLoadContentResult(value) { return typeof value === "object" && value !== null && "content" in value && "filename" in value && "relative" in value && "absolute" in value; } __name(isLoadContentResult, "isLoadContentResult"); function isLoadContentResultArray(value) { const variable = value?.__variable; if (variable && variable.type === "array" && variable.metadata?.arrayType === "load-content-result") { return true; } return Array.isArray(value) && value.length > 0 && value.every(isLoadContentResult); } __name(isLoadContentResultArray, "isLoadContentResultArray"); function isRenamedContentArray(value) { const variable = value?.__variable; if (variable && variable.type === "array" && variable.metadata?.arrayType === "renamed-content") { return true; } if (Array.isArray(value) && value.every((item) => typeof item === "string")) { const hasCustomToString = value.toString !== Array.prototype.toString; if (hasCustomToString && value.toString() === value.join("\n\n")) { return true; } } return false; } __name(isRenamedContentArray, "isRenamedContentArray"); function isLoadContentResultURL(value) { return isLoadContentResult(value) && "url" in value && "domain" in value; } __name(isLoadContentResultURL, "isLoadContentResultURL"); function isLoadContentResultHTML(value) { return isLoadContentResult(value) && "html" in value; } __name(isLoadContentResultHTML, "isLoadContentResultHTML"); export { isLoadContentResult, isLoadContentResultArray, isLoadContentResultHTML, isLoadContentResultURL, isRenamedContentArray }; //# sourceMappingURL=chunk-MNK7EBJ3.mjs.map //# sourceMappingURL=chunk-MNK7EBJ3.mjs.map