@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
12 lines (10 loc) • 611 B
JavaScript
// src/schemas/common/property-schemas/generics.ts
import { z } from "zod";
var nonEmptyRequiredString = z.string().trim().min(1, { error: "At least one character is required. Whitespace is not permissible." });
var emptyStixListErrorMessage = "Empty lists are prohibited in STIX and MUST NOT be used as a substitute for omitting the property if it is optional. The list MUST be present and MUST have at least one value.";
var stixListOfString = z.array(nonEmptyRequiredString).min(1, { error: emptyStixListErrorMessage });
export {
nonEmptyRequiredString,
emptyStixListErrorMessage,
stixListOfString
};