json-schema-describes-subset
Version:
Tools for static JSON schema analysis, including functions to determine if one schema describes a subset of another or if a schema describes the empty set or to convert a schema to its disjunctive normal form (DNF).
15 lines • 505 B
JavaScript
export function splitToLines(text) {
return text.replace(/\r\n/g, '\n').replaceAll('\r', '\n').split('\n');
}
export function mapLines(text, mapFunction) {
return splitToLines(text).map(mapFunction).join('\n');
}
export function makeWhitespacesPlain(text) {
return text.replace(/\s+/g, ' ');
}
export function removePrefix(string, prefix, offset = 0) {
return string.startsWith(prefix)
? string.substring(prefix.length + offset)
: null;
}
//# sourceMappingURL=string.js.map