diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-01-03 20:31:13 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-01-03 20:35:09 -0400 |
commit | cf70ea90286a6de7c9d4dad2aa33a0b8bec4a9ae (patch) | |
tree | ea31f9fc3bb0be72eab03715b889ffa80b6c7a1f /src/util | |
parent | d83f4834af5ac18759c2e2c3ad4bb2c7e4900bee (diff) |
validators: oneOf -> anyOf
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/external-links.js | 4 | ||||
-rw-r--r-- | src/util/html.js | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/util/external-links.js b/src/util/external-links.js index e95dfef3..0b8b4ab6 100644 --- a/src/util/external-links.js +++ b/src/util/external-links.js @@ -1,10 +1,10 @@ import {empty, stitchArrays} from '#sugar'; import { + anyOf, is, isObject, isStringNonEmpty, - oneOf, optional, validateArrayItems, validateInstanceOf, @@ -62,7 +62,7 @@ export const isExternalLinkSpec = queries: optional(validateArrayItems(isRegExp)), context: - optional(oneOf( + optional(anyOf( isExternalLinkContext, validateArrayItems(isExternalLinkContext))), }), diff --git a/src/util/html.js b/src/util/html.js index 9dfd03eb..1a5d1a00 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -7,6 +7,7 @@ import {empty, typeAppearance, unique, withAggregate} from '#sugar'; import * as commonValidators from '#validators'; const { + anyOf, is, isArray, isBoolean, @@ -14,7 +15,6 @@ const { isString, isSymbol, looseArrayOf, - oneOf, validateAllPropertyValues, validateArrayItems, validateInstanceOf, @@ -1382,7 +1382,7 @@ export const isArrayOfHTML = validateArrayItems(value => isHTML(value)); export const isHTML = - oneOf( + anyOf( is(null, undefined, false), isString, isTag, @@ -1396,10 +1396,10 @@ export const isHTML = isArrayOfHTML); export const isAttributeKey = - oneOf(isString, isSymbol); + anyOf(isString, isSymbol); export const isAttributeValue = - oneOf( + anyOf( isString, isNumber, isBoolean, isArray, isTag, isTemplate, validateArrayItems(item => isAttributeValue(item))); @@ -1429,7 +1429,7 @@ export const isAttributesAdditionPair = pair => { }; export const isAttributesAdditionSinglet = - oneOf( + anyOf( validateInstanceOf(Template), validateInstanceOf(Attributes), validateAllPropertyValues(isAttributeValue), |