(metadata: SCMetadata | undefined | null)
| 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 | } |
no outgoing calls
no test coverage detected