MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / hasDuplicatedMetaline

Function hasDuplicatedMetaline

src/pkg/utils/script.ts:173–179  ·  view source on GitHub ↗
(metadata: SCMetadata | undefined | null)

Source from the content-addressed store, hash-verified

171 const hasGrantConflict = (metadata: SCMetadata | undefined | null) =>
172 metadata?.grant?.includes("none") && metadata?.grant?.some((s: string) => s.startsWith("GM"));
173 const hasDuplicatedMetaline = (metadata: SCMetadata | undefined | null) => {
174 if (metadata) {
175 for (const list of Object.values(metadata)) {
176 if (list && new Set(list).size !== list.length) return true;
177 }
178 }
179 };
180 if (options?.byEditor && hasGrantConflict(script.metadata) && (!old || !hasGrantConflict(old.metadata))) {
181 throw new Error(i18n_t("error_grant_conflict"));
182 }

Callers 1

prepareScriptByCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected