@webdeveric/utils 0.83.1 → 0.83.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/asArray.js +9 -0
- package/dist/cjs/asError.js +9 -0
- package/dist/cjs/assertion/assertExhaustive.js +19 -0
- package/dist/cjs/assertion/assertIsAsyncIterable.js +13 -0
- package/dist/cjs/assertion/assertIsBigInt.js +9 -0
- package/dist/cjs/assertion/assertIsBigIntArray.js +9 -0
- package/dist/cjs/assertion/assertIsBoolean.js +9 -0
- package/dist/cjs/assertion/assertIsBooleanArray.js +9 -0
- package/dist/cjs/assertion/assertIsDigitsString.js +9 -0
- package/dist/cjs/assertion/assertIsFiniteNumber.js +9 -0
- package/dist/cjs/assertion/assertIsFunction.js +9 -0
- package/dist/cjs/assertion/assertIsInt32.js +9 -0
- package/dist/cjs/assertion/assertIsIntString.js +9 -0
- package/dist/cjs/assertion/assertIsInteger.js +9 -0
- package/dist/cjs/assertion/assertIsIterable.js +9 -0
- package/dist/cjs/assertion/assertIsLengthAware.js +9 -0
- package/dist/cjs/assertion/assertIsNull.js +9 -0
- package/dist/cjs/assertion/assertIsNullArray.js +9 -0
- package/dist/cjs/assertion/assertIsNumber.js +9 -0
- package/dist/cjs/assertion/assertIsNumberArray.js +9 -0
- package/dist/cjs/assertion/assertIsNumberGTEOne.js +9 -0
- package/dist/cjs/assertion/assertIsNumericString.js +9 -0
- package/dist/cjs/assertion/assertIsNumericValue.js +11 -0
- package/dist/cjs/assertion/assertIsNumericValueArray.js +9 -0
- package/dist/cjs/assertion/assertIsObject.js +10 -0
- package/dist/cjs/assertion/assertIsOptionalBigInt.js +10 -0
- package/dist/cjs/assertion/assertIsOptionalBoolean.js +10 -0
- package/dist/cjs/assertion/assertIsOptionalNull.js +10 -0
- package/dist/cjs/assertion/assertIsOptionalNumber.js +10 -0
- package/dist/cjs/assertion/assertIsOptionalString.js +10 -0
- package/dist/cjs/assertion/assertIsOptionalSymbol.js +10 -0
- package/dist/cjs/assertion/assertIsPositiveFiniteNumber.js +9 -0
- package/dist/cjs/assertion/assertIsPositiveInteger.js +9 -0
- package/dist/cjs/assertion/assertIsPrimitive.js +9 -0
- package/dist/cjs/assertion/assertIsPromiseFulfilledResult.js +11 -0
- package/dist/cjs/assertion/assertIsPromiseRejectedResult.js +11 -0
- package/dist/cjs/assertion/assertIsPropertyKey.js +11 -0
- package/dist/cjs/assertion/assertIsSafeInteger.js +9 -0
- package/dist/cjs/assertion/assertIsSizeAware.js +9 -0
- package/dist/cjs/assertion/assertIsString.js +9 -0
- package/dist/cjs/assertion/assertIsStringArray.js +9 -0
- package/dist/cjs/assertion/assertIsStringMatching.js +9 -0
- package/dist/cjs/assertion/assertIsStringRecord.js +9 -0
- package/dist/cjs/assertion/assertIsStringWithLength.js +9 -0
- package/dist/cjs/assertion/assertIsSymbol.js +9 -0
- package/dist/cjs/assertion/assertIsSymbolArray.js +9 -0
- package/dist/cjs/assertion/assertIsUndefined.js +9 -0
- package/dist/cjs/assertion/assertIsUndefinedArray.js +9 -0
- package/dist/cjs/assertion/assertPathExists.js +12 -0
- package/dist/cjs/assertion/assertPredicate.js +11 -0
- package/dist/cjs/assertion/getError.js +9 -0
- package/dist/cjs/capitalize.js +8 -0
- package/dist/cjs/cartesian.js +10 -0
- package/dist/cjs/chunk.js +8 -0
- package/dist/cjs/clamp.js +9 -0
- package/dist/cjs/combinations.js +8 -0
- package/dist/cjs/comment.js +11 -0
- package/dist/cjs/compose.js +11 -0
- package/dist/cjs/constants.js +2 -0
- package/dist/cjs/convert.js +8 -0
- package/dist/cjs/countCharCode.js +8 -0
- package/dist/cjs/countCharacter.js +8 -0
- package/dist/cjs/counter.js +8 -0
- package/dist/cjs/dedent.js +14 -0
- package/dist/cjs/deepDecodeURI.js +8 -0
- package/dist/cjs/deepFreeze.js +13 -0
- package/dist/cjs/delay.js +14 -0
- package/dist/cjs/delayAnimationFrame.js +9 -0
- package/dist/cjs/delayAnimationFrames.js +9 -0
- package/dist/cjs/describeInput.js +12 -0
- package/dist/cjs/escapeRegExp.js +8 -0
- package/dist/cjs/findIndentation.js +8 -0
- package/dist/cjs/get.js +9 -0
- package/dist/cjs/getDateString.js +8 -0
- package/dist/cjs/getISODateString.js +8 -0
- package/dist/cjs/getMaxValue.js +8 -0
- package/dist/cjs/getMilliseconds.js +9 -0
- package/dist/cjs/getMinValue.js +8 -0
- package/dist/cjs/getOwnKeys.js +8 -0
- package/dist/cjs/getOwnPaths.js +8 -0
- package/dist/cjs/getOwnProperties.js +8 -0
- package/dist/cjs/getPackageName.js +9 -0
- package/dist/cjs/getPaths.js +8 -0
- package/dist/cjs/getRandomItem.js +8 -0
- package/dist/cjs/getSortedObject.js +8 -0
- package/dist/cjs/getType.js +9 -0
- package/dist/cjs/has.js +9 -0
- package/dist/cjs/hasAdditionalProperties.js +9 -0
- package/dist/cjs/inRange.js +9 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/isEmpty.js +9 -0
- package/dist/cjs/iterateForever.js +13 -0
- package/dist/cjs/joinStrings.js +8 -0
- package/dist/cjs/jsonParse.js +8 -0
- package/dist/cjs/looksLikeURL.js +10 -0
- package/dist/cjs/normalize.js +17 -0
- package/dist/cjs/numbers.js +3 -3
- package/dist/cjs/parseNumber.js +9 -0
- package/dist/cjs/pathParts.js +8 -0
- package/dist/cjs/predicate/assume.js +14 -0
- package/dist/cjs/predicate/factory/allOf.js +11 -0
- package/dist/cjs/predicate/factory/anyOf.js +11 -0
- package/dist/cjs/predicate/factory/everyItem.js +11 -0
- package/dist/cjs/predicate/factory/fromEnum.js +20 -0
- package/dist/cjs/predicate/factory/instanceOf.js +10 -0
- package/dist/cjs/predicate/factory/is.js +10 -0
- package/dist/cjs/predicate/factory/literal.js +10 -0
- package/dist/cjs/predicate/factory/matching.js +10 -0
- package/dist/cjs/predicate/factory/maybeArray.js +11 -0
- package/dist/cjs/predicate/factory/nonNullable.js +13 -0
- package/dist/cjs/predicate/factory/nullable.js +11 -0
- package/dist/cjs/predicate/factory/nullish.js +12 -0
- package/dist/cjs/predicate/factory/optional.js +11 -0
- package/dist/cjs/predicate/factory/range.js +10 -0
- package/dist/cjs/predicate/factory/shape.js +13 -0
- package/dist/cjs/predicate/factory/simple.js +10 -0
- package/dist/cjs/predicate/factory/stringLength.js +11 -0
- package/dist/cjs/predicate/factory/tuple.js +11 -0
- package/dist/cjs/predicate/factory/typeOf.js +11 -0
- package/dist/cjs/predicate/factory/withLength.js +15 -0
- package/dist/cjs/predicate/factory/withSize.js +14 -0
- package/dist/cjs/predicate/index.js +0 -1
- package/dist/cjs/predicate/isAny.js +10 -0
- package/dist/cjs/predicate/isAnyObject.js +9 -0
- package/dist/cjs/predicate/isAnyObjectWith.js +9 -0
- package/dist/cjs/predicate/isAnyObjectWithOwn.js +9 -0
- package/dist/cjs/predicate/isArray.js +9 -0
- package/dist/cjs/predicate/isAsyncIterable.js +12 -0
- package/dist/cjs/predicate/isBigInt.js +9 -0
- package/dist/cjs/predicate/isBigIntArray.js +9 -0
- package/dist/cjs/predicate/isBinaryNumberString.js +11 -0
- package/dist/cjs/predicate/isBoolean.js +9 -0
- package/dist/cjs/predicate/isBooleanArray.js +9 -0
- package/dist/cjs/predicate/isDateInputString.js +9 -0
- package/dist/cjs/predicate/isDigitsString.js +9 -0
- package/dist/cjs/predicate/isFiniteNumber.js +9 -0
- package/dist/cjs/predicate/isFunction.js +9 -0
- package/dist/cjs/predicate/isHexNumberString.js +11 -0
- package/dist/cjs/predicate/isISODateString.js +12 -0
- package/dist/cjs/predicate/isInt32.js +9 -0
- package/dist/cjs/predicate/isIntString.js +9 -0
- package/dist/cjs/predicate/isInteger.js +9 -0
- package/dist/cjs/predicate/isIterable.js +9 -0
- package/dist/cjs/predicate/isJSONable.js +11 -1
- package/dist/cjs/predicate/isLengthAware.js +9 -0
- package/dist/cjs/predicate/isNonNullable.js +9 -0
- package/dist/cjs/predicate/isNull.js +9 -0
- package/dist/cjs/predicate/isNullArray.js +9 -0
- package/dist/cjs/predicate/isNullish.js +9 -0
- package/dist/cjs/predicate/isNumber.js +9 -0
- package/dist/cjs/predicate/isNumberArray.js +9 -0
- package/dist/cjs/predicate/isNumericString.js +9 -0
- package/dist/cjs/predicate/isNumericValue.js +9 -0
- package/dist/cjs/predicate/isNumericValueArray.js +9 -0
- package/dist/cjs/predicate/isObject.js +9 -0
- package/dist/cjs/predicate/isObjectLiteral.js +9 -0
- package/dist/cjs/predicate/isObjectWith.js +9 -0
- package/dist/cjs/predicate/isOctalNumberString.js +11 -0
- package/dist/cjs/predicate/isOptionalArray.js +9 -0
- package/dist/cjs/predicate/isOptionalBigInt.js +9 -0
- package/dist/cjs/predicate/isOptionalBoolean.js +9 -0
- package/dist/cjs/predicate/isOptionalISODateString.js +9 -0
- package/dist/cjs/predicate/isOptionalNull.js +9 -0
- package/dist/cjs/predicate/isOptionalNumber.js +9 -0
- package/dist/cjs/predicate/isOptionalObject.js +9 -0
- package/dist/cjs/predicate/isOptionalString.js +9 -0
- package/dist/cjs/predicate/isOptionalSymbol.js +9 -0
- package/dist/cjs/predicate/isPositiveFiniteNumber.js +9 -0
- package/dist/cjs/predicate/isPositiveInteger.js +9 -0
- package/dist/cjs/predicate/isPrimitive.js +9 -0
- package/dist/cjs/predicate/isPromiseFulfilledResult.js +9 -0
- package/dist/cjs/predicate/isPromiseLike.js +9 -0
- package/dist/cjs/predicate/isPromiseRejectedResult.js +9 -0
- package/dist/cjs/predicate/isPropertyKey.js +9 -0
- package/dist/cjs/predicate/isSafeInteger.js +9 -0
- package/dist/cjs/predicate/isSizeAware.js +9 -0
- package/dist/cjs/predicate/isString.js +9 -0
- package/dist/cjs/predicate/isStringArray.js +9 -0
- package/dist/cjs/predicate/isStringRecord.js +9 -0
- package/dist/cjs/predicate/isStringWithLength.js +9 -0
- package/dist/cjs/predicate/isSymbol.js +9 -0
- package/dist/cjs/predicate/isSymbolArray.js +9 -0
- package/dist/cjs/predicate/isTimeoutError.js +13 -0
- package/dist/cjs/predicate/isUInt32.js +9 -0
- package/dist/cjs/predicate/isUndefined.js +9 -0
- package/dist/cjs/predicate/isUndefinedArray.js +9 -0
- package/dist/cjs/predicate/isUnknown.js +9 -0
- package/dist/cjs/predicate/isUrlString.js +9 -0
- package/dist/cjs/prefix.js +9 -0
- package/dist/cjs/randomInt.js +9 -0
- package/dist/cjs/redactCredentialsInURL.js +8 -0
- package/dist/cjs/resultify.js +25 -0
- package/dist/cjs/secToString.js +9 -0
- package/dist/cjs/set.js +13 -0
- package/dist/cjs/sort/byLocaleCompare.js +8 -0
- package/dist/cjs/sort/byRandom.js +9 -1
- package/dist/cjs/sort/bySimpleComparison.js +8 -0
- package/dist/cjs/sort/bySubtraction.js +8 -0
- package/dist/cjs/sort/byTimestamp.js +8 -0
- package/dist/cjs/sort/factory/byProperty.js +8 -0
- package/dist/cjs/sort/factory/byReverseOf.js +8 -0
- package/dist/cjs/stripIndent.js +8 -0
- package/dist/cjs/stripWhitespace.js +8 -0
- package/dist/cjs/suffix.js +9 -0
- package/dist/cjs/toPascalCase.js +10 -0
- package/dist/cjs/trimEnd.js +9 -0
- package/dist/cjs/trimIndentation.js +8 -0
- package/dist/cjs/trimStart.js +9 -0
- package/dist/cjs/tryFn.js +11 -0
- package/dist/cjs/tryIt.js +9 -0
- package/dist/cjs/types/common.js +1 -0
- package/dist/cjs/types/utils.js +1 -0
- package/dist/cjs/unique.js +8 -0
- package/dist/cjs/uniqueItems.js +8 -0
- package/dist/cjs/until.js +35 -0
- package/dist/mjs/asArray.js +9 -0
- package/dist/mjs/asError.js +9 -0
- package/dist/mjs/assertion/assertExhaustive.js +19 -0
- package/dist/mjs/assertion/assertIsAsyncIterable.js +13 -0
- package/dist/mjs/assertion/assertIsBigInt.js +9 -0
- package/dist/mjs/assertion/assertIsBigIntArray.js +9 -0
- package/dist/mjs/assertion/assertIsBoolean.js +9 -0
- package/dist/mjs/assertion/assertIsBooleanArray.js +9 -0
- package/dist/mjs/assertion/assertIsDigitsString.js +9 -0
- package/dist/mjs/assertion/assertIsFiniteNumber.js +9 -0
- package/dist/mjs/assertion/assertIsFunction.js +9 -0
- package/dist/mjs/assertion/assertIsInt32.js +9 -0
- package/dist/mjs/assertion/assertIsIntString.js +9 -0
- package/dist/mjs/assertion/assertIsInteger.js +9 -0
- package/dist/mjs/assertion/assertIsIterable.js +9 -0
- package/dist/mjs/assertion/assertIsLengthAware.js +9 -0
- package/dist/mjs/assertion/assertIsNull.js +9 -0
- package/dist/mjs/assertion/assertIsNullArray.js +9 -0
- package/dist/mjs/assertion/assertIsNumber.js +9 -0
- package/dist/mjs/assertion/assertIsNumberArray.js +9 -0
- package/dist/mjs/assertion/assertIsNumberGTEOne.js +9 -0
- package/dist/mjs/assertion/assertIsNumericString.js +9 -0
- package/dist/mjs/assertion/assertIsNumericValue.js +11 -0
- package/dist/mjs/assertion/assertIsNumericValueArray.js +9 -0
- package/dist/mjs/assertion/assertIsObject.js +10 -0
- package/dist/mjs/assertion/assertIsOptionalBigInt.js +10 -0
- package/dist/mjs/assertion/assertIsOptionalBoolean.js +10 -0
- package/dist/mjs/assertion/assertIsOptionalNull.js +10 -0
- package/dist/mjs/assertion/assertIsOptionalNumber.js +10 -0
- package/dist/mjs/assertion/assertIsOptionalString.js +10 -0
- package/dist/mjs/assertion/assertIsOptionalSymbol.js +10 -0
- package/dist/mjs/assertion/assertIsPositiveFiniteNumber.js +9 -0
- package/dist/mjs/assertion/assertIsPositiveInteger.js +9 -0
- package/dist/mjs/assertion/assertIsPrimitive.js +9 -0
- package/dist/mjs/assertion/assertIsPromiseFulfilledResult.js +11 -0
- package/dist/mjs/assertion/assertIsPromiseRejectedResult.js +11 -0
- package/dist/mjs/assertion/assertIsPropertyKey.js +11 -0
- package/dist/mjs/assertion/assertIsSafeInteger.js +9 -0
- package/dist/mjs/assertion/assertIsSizeAware.js +9 -0
- package/dist/mjs/assertion/assertIsString.js +9 -0
- package/dist/mjs/assertion/assertIsStringArray.js +9 -0
- package/dist/mjs/assertion/assertIsStringMatching.js +9 -0
- package/dist/mjs/assertion/assertIsStringRecord.js +9 -0
- package/dist/mjs/assertion/assertIsStringWithLength.js +9 -0
- package/dist/mjs/assertion/assertIsSymbol.js +9 -0
- package/dist/mjs/assertion/assertIsSymbolArray.js +9 -0
- package/dist/mjs/assertion/assertIsUndefined.js +9 -0
- package/dist/mjs/assertion/assertIsUndefinedArray.js +9 -0
- package/dist/mjs/assertion/assertPathExists.js +12 -0
- package/dist/mjs/assertion/assertPredicate.js +11 -0
- package/dist/mjs/assertion/getError.js +9 -0
- package/dist/mjs/capitalize.js +8 -0
- package/dist/mjs/cartesian.js +10 -0
- package/dist/mjs/chunk.js +8 -0
- package/dist/mjs/clamp.js +9 -0
- package/dist/mjs/combinations.js +8 -0
- package/dist/mjs/comment.js +11 -0
- package/dist/mjs/compose.js +11 -0
- package/dist/mjs/constants.js +2 -0
- package/dist/mjs/convert.js +8 -0
- package/dist/mjs/countCharCode.js +8 -0
- package/dist/mjs/countCharacter.js +8 -0
- package/dist/mjs/counter.js +8 -0
- package/dist/mjs/dedent.js +14 -0
- package/dist/mjs/deepDecodeURI.js +8 -0
- package/dist/mjs/deepFreeze.js +13 -0
- package/dist/mjs/delay.js +14 -0
- package/dist/mjs/delayAnimationFrame.js +9 -0
- package/dist/mjs/delayAnimationFrames.js +9 -0
- package/dist/mjs/describeInput.js +12 -0
- package/dist/mjs/escapeRegExp.js +8 -0
- package/dist/mjs/findIndentation.js +8 -0
- package/dist/mjs/get.js +9 -0
- package/dist/mjs/getDateString.js +8 -0
- package/dist/mjs/getISODateString.js +8 -0
- package/dist/mjs/getMaxValue.js +8 -0
- package/dist/mjs/getMilliseconds.js +9 -0
- package/dist/mjs/getMinValue.js +8 -0
- package/dist/mjs/getOwnKeys.js +8 -0
- package/dist/mjs/getOwnPaths.js +8 -0
- package/dist/mjs/getOwnProperties.js +8 -0
- package/dist/mjs/getPackageName.js +9 -0
- package/dist/mjs/getPaths.js +8 -0
- package/dist/mjs/getRandomItem.js +8 -0
- package/dist/mjs/getSortedObject.js +8 -0
- package/dist/mjs/getType.js +9 -0
- package/dist/mjs/has.js +9 -0
- package/dist/mjs/hasAdditionalProperties.js +9 -0
- package/dist/mjs/inRange.js +9 -0
- package/dist/mjs/index.js +2 -0
- package/dist/mjs/isEmpty.js +9 -0
- package/dist/mjs/iterateForever.js +13 -0
- package/dist/mjs/joinStrings.js +8 -0
- package/dist/mjs/jsonParse.js +8 -0
- package/dist/mjs/looksLikeURL.js +10 -0
- package/dist/mjs/normalize.js +17 -0
- package/dist/mjs/numbers.js +3 -3
- package/dist/mjs/parseNumber.js +9 -0
- package/dist/mjs/pathParts.js +8 -0
- package/dist/mjs/predicate/assume.js +14 -0
- package/dist/mjs/predicate/factory/allOf.js +11 -0
- package/dist/mjs/predicate/factory/anyOf.js +11 -0
- package/dist/mjs/predicate/factory/everyItem.js +11 -0
- package/dist/mjs/predicate/factory/fromEnum.js +20 -0
- package/dist/mjs/predicate/factory/instanceOf.js +10 -0
- package/dist/mjs/predicate/factory/is.js +10 -0
- package/dist/mjs/predicate/factory/literal.js +10 -0
- package/dist/mjs/predicate/factory/matching.js +10 -0
- package/dist/mjs/predicate/factory/maybeArray.js +11 -0
- package/dist/mjs/predicate/factory/nonNullable.js +13 -0
- package/dist/mjs/predicate/factory/nullable.js +11 -0
- package/dist/mjs/predicate/factory/nullish.js +12 -0
- package/dist/mjs/predicate/factory/optional.js +11 -0
- package/dist/mjs/predicate/factory/range.js +10 -0
- package/dist/mjs/predicate/factory/shape.js +13 -0
- package/dist/mjs/predicate/factory/simple.js +10 -0
- package/dist/mjs/predicate/factory/stringLength.js +11 -0
- package/dist/mjs/predicate/factory/tuple.js +11 -0
- package/dist/mjs/predicate/factory/typeOf.js +11 -0
- package/dist/mjs/predicate/factory/withLength.js +15 -0
- package/dist/mjs/predicate/factory/withSize.js +14 -0
- package/dist/mjs/predicate/index.js +0 -1
- package/dist/mjs/predicate/isAny.js +10 -0
- package/dist/mjs/predicate/isAnyObject.js +9 -0
- package/dist/mjs/predicate/isAnyObjectWith.js +9 -0
- package/dist/mjs/predicate/isAnyObjectWithOwn.js +9 -0
- package/dist/mjs/predicate/isArray.js +9 -0
- package/dist/mjs/predicate/isAsyncIterable.js +12 -0
- package/dist/mjs/predicate/isBigInt.js +9 -0
- package/dist/mjs/predicate/isBigIntArray.js +9 -0
- package/dist/mjs/predicate/isBinaryNumberString.js +11 -0
- package/dist/mjs/predicate/isBoolean.js +9 -0
- package/dist/mjs/predicate/isBooleanArray.js +9 -0
- package/dist/mjs/predicate/isDateInputString.js +9 -0
- package/dist/mjs/predicate/isDigitsString.js +9 -0
- package/dist/mjs/predicate/isFiniteNumber.js +9 -0
- package/dist/mjs/predicate/isFunction.js +9 -0
- package/dist/mjs/predicate/isHexNumberString.js +11 -0
- package/dist/mjs/predicate/isISODateString.js +12 -0
- package/dist/mjs/predicate/isInt32.js +9 -0
- package/dist/mjs/predicate/isIntString.js +9 -0
- package/dist/mjs/predicate/isInteger.js +9 -0
- package/dist/mjs/predicate/isIterable.js +9 -0
- package/dist/mjs/predicate/isJSONable.js +11 -1
- package/dist/mjs/predicate/isLengthAware.js +9 -0
- package/dist/mjs/predicate/isNonNullable.js +9 -0
- package/dist/mjs/predicate/isNull.js +9 -0
- package/dist/mjs/predicate/isNullArray.js +9 -0
- package/dist/mjs/predicate/isNullish.js +9 -0
- package/dist/mjs/predicate/isNumber.js +9 -0
- package/dist/mjs/predicate/isNumberArray.js +9 -0
- package/dist/mjs/predicate/isNumericString.js +9 -0
- package/dist/mjs/predicate/isNumericValue.js +9 -0
- package/dist/mjs/predicate/isNumericValueArray.js +9 -0
- package/dist/mjs/predicate/isObject.js +9 -0
- package/dist/mjs/predicate/isObjectLiteral.js +9 -0
- package/dist/mjs/predicate/isObjectWith.js +9 -0
- package/dist/mjs/predicate/isOctalNumberString.js +11 -0
- package/dist/mjs/predicate/isOptionalArray.js +9 -0
- package/dist/mjs/predicate/isOptionalBigInt.js +9 -0
- package/dist/mjs/predicate/isOptionalBoolean.js +9 -0
- package/dist/mjs/predicate/isOptionalISODateString.js +9 -0
- package/dist/mjs/predicate/isOptionalNull.js +9 -0
- package/dist/mjs/predicate/isOptionalNumber.js +9 -0
- package/dist/mjs/predicate/isOptionalObject.js +9 -0
- package/dist/mjs/predicate/isOptionalString.js +9 -0
- package/dist/mjs/predicate/isOptionalSymbol.js +9 -0
- package/dist/mjs/predicate/isPositiveFiniteNumber.js +9 -0
- package/dist/mjs/predicate/isPositiveInteger.js +9 -0
- package/dist/mjs/predicate/isPrimitive.js +9 -0
- package/dist/mjs/predicate/isPromiseFulfilledResult.js +9 -0
- package/dist/mjs/predicate/isPromiseLike.js +9 -0
- package/dist/mjs/predicate/isPromiseRejectedResult.js +9 -0
- package/dist/mjs/predicate/isPropertyKey.js +9 -0
- package/dist/mjs/predicate/isSafeInteger.js +9 -0
- package/dist/mjs/predicate/isSizeAware.js +9 -0
- package/dist/mjs/predicate/isString.js +9 -0
- package/dist/mjs/predicate/isStringArray.js +9 -0
- package/dist/mjs/predicate/isStringRecord.js +9 -0
- package/dist/mjs/predicate/isStringWithLength.js +9 -0
- package/dist/mjs/predicate/isSymbol.js +9 -0
- package/dist/mjs/predicate/isSymbolArray.js +9 -0
- package/dist/mjs/predicate/isTimeoutError.js +13 -0
- package/dist/mjs/predicate/isUInt32.js +9 -0
- package/dist/mjs/predicate/isUndefined.js +9 -0
- package/dist/mjs/predicate/isUndefinedArray.js +9 -0
- package/dist/mjs/predicate/isUnknown.js +9 -0
- package/dist/mjs/predicate/isUrlString.js +9 -0
- package/dist/mjs/prefix.js +9 -0
- package/dist/mjs/randomInt.js +9 -0
- package/dist/mjs/redactCredentialsInURL.js +8 -0
- package/dist/mjs/resultify.js +25 -0
- package/dist/mjs/secToString.js +9 -0
- package/dist/mjs/set.js +13 -0
- package/dist/mjs/sort/byLocaleCompare.js +8 -0
- package/dist/mjs/sort/byRandom.js +9 -1
- package/dist/mjs/sort/bySimpleComparison.js +8 -0
- package/dist/mjs/sort/bySubtraction.js +8 -0
- package/dist/mjs/sort/byTimestamp.js +8 -0
- package/dist/mjs/sort/factory/byProperty.js +8 -0
- package/dist/mjs/sort/factory/byReverseOf.js +8 -0
- package/dist/mjs/stripIndent.js +8 -0
- package/dist/mjs/stripWhitespace.js +8 -0
- package/dist/mjs/suffix.js +9 -0
- package/dist/mjs/toPascalCase.js +10 -0
- package/dist/mjs/trimEnd.js +9 -0
- package/dist/mjs/trimIndentation.js +8 -0
- package/dist/mjs/trimStart.js +9 -0
- package/dist/mjs/tryFn.js +11 -0
- package/dist/mjs/tryIt.js +9 -0
- package/dist/mjs/types/common.js +1 -0
- package/dist/mjs/types/utils.js +1 -0
- package/dist/mjs/unique.js +8 -0
- package/dist/mjs/uniqueItems.js +8 -0
- package/dist/mjs/until.js +35 -0
- package/dist/types/asArray.d.ts +9 -0
- package/dist/types/asError.d.ts +9 -0
- package/dist/types/assertion/assertExhaustive.d.ts +19 -0
- package/dist/types/assertion/assertIsAsyncIterable.d.ts +13 -0
- package/dist/types/assertion/assertIsBigInt.d.ts +9 -0
- package/dist/types/assertion/assertIsBigIntArray.d.ts +9 -0
- package/dist/types/assertion/assertIsBoolean.d.ts +9 -0
- package/dist/types/assertion/assertIsBooleanArray.d.ts +9 -0
- package/dist/types/assertion/assertIsDigitsString.d.ts +9 -0
- package/dist/types/assertion/assertIsFiniteNumber.d.ts +9 -0
- package/dist/types/assertion/assertIsFunction.d.ts +9 -0
- package/dist/types/assertion/assertIsInt32.d.ts +9 -0
- package/dist/types/assertion/assertIsIntString.d.ts +9 -0
- package/dist/types/assertion/assertIsInteger.d.ts +9 -0
- package/dist/types/assertion/assertIsIterable.d.ts +9 -0
- package/dist/types/assertion/assertIsLengthAware.d.ts +9 -0
- package/dist/types/assertion/assertIsNull.d.ts +9 -0
- package/dist/types/assertion/assertIsNullArray.d.ts +9 -0
- package/dist/types/assertion/assertIsNumber.d.ts +9 -0
- package/dist/types/assertion/assertIsNumberArray.d.ts +9 -0
- package/dist/types/assertion/assertIsNumberGTEOne.d.ts +9 -0
- package/dist/types/assertion/assertIsNumericString.d.ts +9 -0
- package/dist/types/assertion/assertIsNumericValue.d.ts +11 -0
- package/dist/types/assertion/assertIsNumericValueArray.d.ts +9 -0
- package/dist/types/assertion/assertIsObject.d.ts +10 -0
- package/dist/types/assertion/assertIsOptionalBigInt.d.ts +10 -0
- package/dist/types/assertion/assertIsOptionalBoolean.d.ts +10 -0
- package/dist/types/assertion/assertIsOptionalNull.d.ts +10 -0
- package/dist/types/assertion/assertIsOptionalNumber.d.ts +10 -0
- package/dist/types/assertion/assertIsOptionalString.d.ts +10 -0
- package/dist/types/assertion/assertIsOptionalSymbol.d.ts +10 -0
- package/dist/types/assertion/assertIsPositiveFiniteNumber.d.ts +9 -0
- package/dist/types/assertion/assertIsPositiveInteger.d.ts +9 -0
- package/dist/types/assertion/assertIsPrimitive.d.ts +9 -0
- package/dist/types/assertion/assertIsPromiseFulfilledResult.d.ts +11 -0
- package/dist/types/assertion/assertIsPromiseRejectedResult.d.ts +11 -0
- package/dist/types/assertion/assertIsPropertyKey.d.ts +11 -0
- package/dist/types/assertion/assertIsSafeInteger.d.ts +9 -0
- package/dist/types/assertion/assertIsSizeAware.d.ts +9 -0
- package/dist/types/assertion/assertIsString.d.ts +9 -0
- package/dist/types/assertion/assertIsStringArray.d.ts +9 -0
- package/dist/types/assertion/assertIsStringMatching.d.ts +9 -0
- package/dist/types/assertion/assertIsStringRecord.d.ts +9 -0
- package/dist/types/assertion/assertIsStringWithLength.d.ts +9 -0
- package/dist/types/assertion/assertIsSymbol.d.ts +9 -0
- package/dist/types/assertion/assertIsSymbolArray.d.ts +9 -0
- package/dist/types/assertion/assertIsUndefined.d.ts +9 -0
- package/dist/types/assertion/assertIsUndefinedArray.d.ts +9 -0
- package/dist/types/assertion/assertPredicate.d.ts +11 -0
- package/dist/types/assertion/getError.d.ts +9 -0
- package/dist/types/capitalize.d.ts +9 -1
- package/dist/types/cartesian.d.ts +10 -0
- package/dist/types/chunk.d.ts +8 -0
- package/dist/types/clamp.d.ts +9 -0
- package/dist/types/combinations.d.ts +8 -0
- package/dist/types/comment.d.ts +8 -0
- package/dist/types/compose.d.ts +11 -0
- package/dist/types/convert.d.ts +8 -0
- package/dist/types/countCharCode.d.ts +8 -0
- package/dist/types/countCharacter.d.ts +8 -0
- package/dist/types/counter.d.ts +8 -0
- package/dist/types/dedent.d.ts +14 -0
- package/dist/types/deepDecodeURI.d.ts +8 -0
- package/dist/types/deepFreeze.d.ts +13 -0
- package/dist/types/describeInput.d.ts +10 -0
- package/dist/types/escapeRegExp.d.ts +8 -0
- package/dist/types/findIndentation.d.ts +8 -0
- package/dist/types/getDateString.d.ts +8 -0
- package/dist/types/getISODateString.d.ts +8 -0
- package/dist/types/getMaxValue.d.ts +8 -0
- package/dist/types/getMilliseconds.d.ts +9 -0
- package/dist/types/getMinValue.d.ts +8 -0
- package/dist/types/getOwnKeys.d.ts +8 -0
- package/dist/types/getOwnPaths.d.ts +8 -0
- package/dist/types/getOwnProperties.d.ts +8 -0
- package/dist/types/getPackageName.d.ts +9 -0
- package/dist/types/getPaths.d.ts +8 -0
- package/dist/types/getType.d.ts +9 -0
- package/dist/types/hasAdditionalProperties.d.ts +9 -0
- package/dist/types/inRange.d.ts +9 -0
- package/dist/types/isEmpty.d.ts +9 -0
- package/dist/types/iterateForever.d.ts +13 -0
- package/dist/types/joinStrings.d.ts +8 -0
- package/dist/types/looksLikeURL.d.ts +9 -0
- package/dist/types/memo.d.ts +14 -0
- package/dist/types/parseNumber.d.ts +9 -0
- package/dist/types/pathParts.d.ts +8 -0
- package/dist/types/predicate/assume.d.ts +13 -0
- package/dist/types/predicate/factory/allOf.d.ts +11 -0
- package/dist/types/predicate/factory/anyOf.d.ts +11 -0
- package/dist/types/predicate/factory/everyItem.d.ts +11 -0
- package/dist/types/predicate/factory/fromEnum.d.ts +17 -0
- package/dist/types/predicate/factory/instanceOf.d.ts +10 -0
- package/dist/types/predicate/factory/is.d.ts +10 -0
- package/dist/types/predicate/factory/literal.d.ts +10 -0
- package/dist/types/predicate/factory/matching.d.ts +10 -0
- package/dist/types/predicate/factory/maybeArray.d.ts +11 -0
- package/dist/types/predicate/factory/nonNullable.d.ts +13 -0
- package/dist/types/predicate/factory/nullable.d.ts +11 -0
- package/dist/types/predicate/factory/nullish.d.ts +12 -0
- package/dist/types/predicate/factory/optional.d.ts +11 -0
- package/dist/types/predicate/factory/shape.d.ts +13 -0
- package/dist/types/predicate/factory/simple.d.ts +10 -0
- package/dist/types/predicate/factory/stringLength.d.ts +11 -0
- package/dist/types/predicate/factory/tuple.d.ts +11 -0
- package/dist/types/predicate/factory/typeOf.d.ts +11 -0
- package/dist/types/predicate/index.d.ts +0 -1
- package/dist/types/predicate/isAny.d.ts +9 -0
- package/dist/types/predicate/isAnyObject.d.ts +9 -0
- package/dist/types/predicate/isAnyObjectWith.d.ts +9 -0
- package/dist/types/predicate/isAnyObjectWithOwn.d.ts +9 -0
- package/dist/types/predicate/isArray.d.ts +9 -0
- package/dist/types/predicate/isAsyncIterable.d.ts +12 -0
- package/dist/types/predicate/isBigInt.d.ts +9 -0
- package/dist/types/predicate/isBigIntArray.d.ts +9 -0
- package/dist/types/predicate/isBinaryNumberString.d.ts +11 -0
- package/dist/types/predicate/isBoolean.d.ts +9 -0
- package/dist/types/predicate/isBooleanArray.d.ts +9 -0
- package/dist/types/predicate/isDateInputString.d.ts +9 -0
- package/dist/types/predicate/isDigitsString.d.ts +9 -0
- package/dist/types/predicate/isFiniteNumber.d.ts +9 -0
- package/dist/types/predicate/isFunction.d.ts +9 -0
- package/dist/types/predicate/isHexNumberString.d.ts +11 -0
- package/dist/types/predicate/isISODateString.d.ts +12 -0
- package/dist/types/predicate/isInt32.d.ts +9 -0
- package/dist/types/predicate/isIntString.d.ts +9 -0
- package/dist/types/predicate/isInteger.d.ts +9 -0
- package/dist/types/predicate/isIterable.d.ts +9 -0
- package/dist/types/predicate/isJSONable.d.ts +9 -0
- package/dist/types/predicate/isLengthAware.d.ts +9 -0
- package/dist/types/predicate/isNonNullable.d.ts +9 -0
- package/dist/types/predicate/isNull.d.ts +9 -0
- package/dist/types/predicate/isNullArray.d.ts +9 -0
- package/dist/types/predicate/isNullish.d.ts +9 -0
- package/dist/types/predicate/isNumber.d.ts +9 -0
- package/dist/types/predicate/isNumberArray.d.ts +9 -0
- package/dist/types/predicate/isNumericString.d.ts +9 -0
- package/dist/types/predicate/isNumericValue.d.ts +9 -0
- package/dist/types/predicate/isNumericValueArray.d.ts +9 -0
- package/dist/types/predicate/isObject.d.ts +9 -0
- package/dist/types/predicate/isObjectLiteral.d.ts +9 -0
- package/dist/types/predicate/isObjectWith.d.ts +9 -0
- package/dist/types/predicate/isOctalNumberString.d.ts +11 -0
- package/dist/types/predicate/isOptionalArray.d.ts +9 -0
- package/dist/types/predicate/isOptionalBigInt.d.ts +9 -0
- package/dist/types/predicate/isOptionalBoolean.d.ts +9 -0
- package/dist/types/predicate/isOptionalISODateString.d.ts +9 -0
- package/dist/types/predicate/isOptionalNull.d.ts +9 -0
- package/dist/types/predicate/isOptionalNumber.d.ts +9 -0
- package/dist/types/predicate/isOptionalObject.d.ts +9 -0
- package/dist/types/predicate/isOptionalString.d.ts +9 -0
- package/dist/types/predicate/isOptionalSymbol.d.ts +9 -0
- package/dist/types/predicate/isPositiveFiniteNumber.d.ts +9 -0
- package/dist/types/predicate/isPositiveInteger.d.ts +9 -0
- package/dist/types/predicate/isPrimitive.d.ts +9 -0
- package/dist/types/predicate/isPromiseFulfilledResult.d.ts +9 -0
- package/dist/types/predicate/isPromiseLike.d.ts +9 -0
- package/dist/types/predicate/isPromiseRejectedResult.d.ts +9 -0
- package/dist/types/predicate/isPropertyKey.d.ts +9 -0
- package/dist/types/predicate/isSafeInteger.d.ts +9 -0
- package/dist/types/predicate/isSizeAware.d.ts +9 -0
- package/dist/types/predicate/isString.d.ts +9 -0
- package/dist/types/predicate/isStringArray.d.ts +9 -0
- package/dist/types/predicate/isStringRecord.d.ts +9 -0
- package/dist/types/predicate/isStringWithLength.d.ts +9 -0
- package/dist/types/predicate/isSymbol.d.ts +9 -0
- package/dist/types/predicate/isSymbolArray.d.ts +9 -0
- package/dist/types/predicate/isTimeoutError.d.ts +13 -0
- package/dist/types/predicate/isUInt32.d.ts +9 -0
- package/dist/types/predicate/isUndefined.d.ts +9 -0
- package/dist/types/predicate/isUndefinedArray.d.ts +9 -0
- package/dist/types/predicate/isUnknown.d.ts +9 -0
- package/dist/types/predicate/isUrlString.d.ts +9 -0
- package/dist/types/prefix.d.ts +9 -0
- package/dist/types/redactCredentialsInURL.d.ts +8 -0
- package/dist/types/resultify.d.ts +25 -0
- package/dist/types/secToString.d.ts +8 -0
- package/dist/types/sort/byLocaleCompare.d.ts +8 -0
- package/dist/types/sort/byRandom.d.ts +8 -0
- package/dist/types/sort/bySimpleComparison.d.ts +8 -0
- package/dist/types/sort/bySubtraction.d.ts +8 -0
- package/dist/types/sort/byTimestamp.d.ts +8 -0
- package/dist/types/sort/factory/byProperty.d.ts +8 -0
- package/dist/types/sort/factory/byReverseOf.d.ts +8 -0
- package/dist/types/stripIndent.d.ts +8 -0
- package/dist/types/stripWhitespace.d.ts +8 -0
- package/dist/types/suffix.d.ts +9 -0
- package/dist/types/toPascalCase.d.ts +9 -0
- package/dist/types/trimEnd.d.ts +9 -0
- package/dist/types/trimIndentation.d.ts +8 -0
- package/dist/types/trimStart.d.ts +9 -0
- package/dist/types/types/arrays.d.ts +3 -0
- package/dist/types/types/common.d.ts +3 -0
- package/dist/types/types/date-time.d.ts +9 -0
- package/dist/types/types/functions.d.ts +7 -0
- package/dist/types/types/numbers.d.ts +21 -0
- package/dist/types/types/objects.d.ts +74 -0
- package/dist/types/types/records.d.ts +5 -0
- package/dist/types/types/utils.d.ts +24 -0
- package/dist/types/unique.d.ts +18 -0
- package/dist/types/uniqueItems.d.ts +8 -0
- package/dist/types/until.d.ts +33 -0
- package/package.json +4 -2
- package/readme.md +11 -1
- package/dist/cjs/predicate/isDateString.js +0 -5
- package/dist/mjs/predicate/isDateString.js +0 -2
- package/dist/types/predicate/isDateString.d.ts +0 -2
package/dist/mjs/capitalize.js
CHANGED
package/dist/mjs/cartesian.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazily yield the Cartesian product of the given arrays.
|
|
3
|
+
*
|
|
4
|
+
* @see {@link https://en.wikipedia.org/wiki/Cartesian_product}
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* [...cartesian([1, 2], ['a', 'b'])]; // [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
1
11
|
export function* cartesian(...input) {
|
|
2
12
|
const [head, ...tail] = input;
|
|
3
13
|
if (!Array.isArray(head)) {
|
package/dist/mjs/chunk.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split `items` into consecutive chunks of at most `chunkSize` items each.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* [...chunk([1, 2, 3, 4, 5], 2)]; // [[1, 2], [3, 4], [5]]
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
1
9
|
export function* chunk(items, chunkSize) {
|
|
2
10
|
if (!Number.isSafeInteger(chunkSize) || chunkSize <= 0) {
|
|
3
11
|
throw new RangeError('Chunk size must be an integer greater than 0');
|
package/dist/mjs/clamp.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { getMaxValue } from './getMaxValue.js';
|
|
2
2
|
import { getMinValue } from './getMinValue.js';
|
|
3
|
+
/**
|
|
4
|
+
* Clamp `value` so it falls between `min` and `max`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* clamp(0, 15, 10); // 10
|
|
9
|
+
* clamp(0, -5, 10); // 0
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
3
12
|
export function clamp(min, value, max) {
|
|
4
13
|
return getMaxValue(min, getMinValue(value, max));
|
|
5
14
|
}
|
package/dist/mjs/combinations.js
CHANGED
|
@@ -2,6 +2,14 @@ import { asArray } from './asArray.js';
|
|
|
2
2
|
import { cartesian } from './cartesian.js';
|
|
3
3
|
import { isIterable } from './predicate/isIterable.js';
|
|
4
4
|
import { isObject } from './predicate/isObject.js';
|
|
5
|
+
/**
|
|
6
|
+
* Generate every combination of `input`'s property values, recursing into nested objects.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* [...combinations({ a: [1, 2], b: 'x' })]; // [{ a: 1, b: 'x' }, { a: 2, b: 'x' }]
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
5
13
|
export function* combinations(input) {
|
|
6
14
|
const propertyNames = Object.keys(input);
|
|
7
15
|
const propertyValues = Object.values(input).map((value) => isIterable(value)
|
package/dist/mjs/comment.js
CHANGED
|
@@ -5,6 +5,9 @@ export var CommentType;
|
|
|
5
5
|
CommentType["Single"] = "single";
|
|
6
6
|
CommentType["HTML"] = "html";
|
|
7
7
|
})(CommentType || (CommentType = {}));
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
8
11
|
function getCommentParts(type) {
|
|
9
12
|
return {
|
|
10
13
|
[CommentType.Block]: {
|
|
@@ -33,6 +36,14 @@ function getCommentParts(type) {
|
|
|
33
36
|
},
|
|
34
37
|
}[type];
|
|
35
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Wrap `text` in a comment of the given `type`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* comment('Hello\nWorld'); // '/**\n * Hello\n * World\n *\/'
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
36
47
|
export function comment(text, options) {
|
|
37
48
|
if (!text) {
|
|
38
49
|
return '';
|
package/dist/mjs/compose.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compose `functions` into a single function that pipes data through each of them in order.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const addOne = (n: number) => n + 1;
|
|
7
|
+
* const double = (n: number) => n * 2;
|
|
8
|
+
*
|
|
9
|
+
* compose(addOne, double)(3); // 8
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
1
12
|
export function compose(...functions) {
|
|
2
13
|
return functions.reduce((prev, next) => (data, ...args) => {
|
|
3
14
|
const updatedData = prev(data, ...args);
|
package/dist/mjs/constants.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
// Longest-alternative-first so a lone `\r` from a CRLF pair is never matched on its own.
|
|
1
2
|
export const NEWLINE_RAW_PATTERN = String.raw `\r\n|\r|\n`;
|
|
3
|
+
// Whitespace excluding line breaks, since those are matched separately via `NEWLINE`.
|
|
2
4
|
export const INDENT_CHAR_RAW_PATTERN = String.raw `[^\S\r\n]`;
|
package/dist/mjs/convert.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { getOwnProperties } from './getOwnProperties.js';
|
|
2
2
|
import { getType } from './getType.js';
|
|
3
|
+
/**
|
|
4
|
+
* Convert `input` using `converter`, which may be a function or a record of nested converters.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* convert({ name: 'Andy' }, { greeting: (data) => `Hi, ${data.name}` }); // { greeting: 'Hi, Andy' }
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export const convert = (input, converter) => {
|
|
4
12
|
if (typeof converter === 'function') {
|
|
5
13
|
return converter(input);
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Count how many times `charCode` occurs in `input`.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* countCharCode('hello', 'l'.charCodeAt(0)); // 2
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
1
9
|
export function countCharCode(input, charCode) {
|
|
2
10
|
let count = 0;
|
|
3
11
|
for (let index = 0, length = input.length; index < length; ++index) {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { countCharCode } from './countCharCode.js';
|
|
2
|
+
/**
|
|
3
|
+
* Count how many times `char` occurs in `input`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* countCharacter('hello', 'l'); // 2
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
2
10
|
export function countCharacter(input, char) {
|
|
3
11
|
if (char.length !== 1) {
|
|
4
12
|
throw new Error('Expected a single character');
|
package/dist/mjs/counter.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a sequence of numbers from `start` to `end`, incrementing by `step` each time.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* [...counter(1, 5)]; // [1, 2, 3, 4, 5]
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
1
9
|
export function* counter(start = 0, end = Infinity, step = 1) {
|
|
2
10
|
if (step === 0) {
|
|
3
11
|
throw new TypeError('step cannot be zero');
|
package/dist/mjs/dedent.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { INDENT_CHAR_RAW_PATTERN, NEWLINE_RAW_PATTERN } from './constants.js';
|
|
2
2
|
import { findIndentation } from './findIndentation.js';
|
|
3
3
|
import { stripIndent } from './stripIndent.js';
|
|
4
|
+
/**
|
|
5
|
+
* This is a tagged template function that removes common leading indentation from
|
|
6
|
+
* each line, re-indents any interpolated multi-line values to match, and trims
|
|
7
|
+
* leading/trailing whitespace from the result.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const value = 'World';
|
|
12
|
+
*
|
|
13
|
+
* dedent`
|
|
14
|
+
* Hello, ${value}!
|
|
15
|
+
* `; // 'Hello, World!'
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
4
18
|
export const dedent = (raw, ...values) => {
|
|
5
19
|
const indent = findIndentation(raw);
|
|
6
20
|
if (!indent) {
|
package/dist/mjs/deepFreeze.js
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep freeze an object or array.
|
|
3
|
+
*
|
|
4
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze}
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* const frozen = deepFreeze({ nested: { value: 1 } });
|
|
9
|
+
*
|
|
10
|
+
* Object.isFrozen(frozen); // true
|
|
11
|
+
* Object.isFrozen(frozen.nested); // true
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
1
14
|
export function deepFreeze(input, partialOptions = {}) {
|
|
2
15
|
const { filterProperties = new Set(['prototype', '__proto__']), doNotFreeze = new WeakSet([globalThis]), frozen = new WeakSet(), } = partialOptions;
|
|
3
16
|
if (doNotFreeze.has(input)) {
|
package/dist/mjs/delay.js
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { isPositiveInteger } from './predicate/isPositiveInteger.js';
|
|
2
2
|
const MAX_DELAY_MS = 2 ** 31 - 1;
|
|
3
|
+
/**
|
|
4
|
+
* Delay a specified number of milliseconds before resolving.
|
|
5
|
+
*
|
|
6
|
+
* The `ms` value can be between zero and the max delay value for `setTimeout()`, which is `2 ** 31 - 1`.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value}
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* await delay(1000); // resolves with `undefined` after 1 second
|
|
13
|
+
* await delay(1000, 'done'); // resolves with 'done' after 1 second
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
3
16
|
export function delay(milliseconds, value, signal) {
|
|
4
17
|
return new Promise((resolve, reject) => {
|
|
5
18
|
if (!isPositiveInteger(milliseconds)) {
|
|
6
19
|
reject(new TypeError('milliseconds must be a positive integer'));
|
|
7
20
|
return;
|
|
8
21
|
}
|
|
22
|
+
// `0` already checked above.
|
|
9
23
|
if (milliseconds > MAX_DELAY_MS) {
|
|
10
24
|
reject(new RangeError(`milliseconds must be between 0 and ${MAX_DELAY_MS}`));
|
|
11
25
|
return;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return a Promise that resolves with `value` on the next animation frame.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* await delayAnimationFrame(); // resolves with `undefined` on the next animation frame
|
|
7
|
+
* await delayAnimationFrame('done'); // resolves with 'done' on the next animation frame
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
export function delayAnimationFrame(value) {
|
|
2
11
|
return new Promise((resolve) => {
|
|
3
12
|
window.requestAnimationFrame(() => resolve(value));
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return a Promise that resolves with `value` after the given number of animation `frames` have elapsed.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* await delayAnimationFrames(5); // resolves with `undefined` after 5 animation frames
|
|
7
|
+
* await delayAnimationFrames(5, 'done'); // resolves with 'done' after 5 animation frames
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
export function delayAnimationFrames(frames, value) {
|
|
2
11
|
return new Promise((resolve, reject) => {
|
|
3
12
|
if (!Number.isInteger(frames) || frames < 1) {
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { getType } from './getType.js';
|
|
2
2
|
import { looksLikeURL } from './looksLikeURL.js';
|
|
3
3
|
import { isNumericString } from './predicate/isNumericString.js';
|
|
4
|
+
/**
|
|
5
|
+
* Describe `input` with a short, human-readable label based on its type and shape.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* describeInput(true); // 'true'
|
|
10
|
+
* describeInput('https://example.com'); // 'https URL'
|
|
11
|
+
* describeInput(42); // 'Safe Integer'
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
4
14
|
export const describeInput = (input) => {
|
|
5
15
|
switch (typeof input) {
|
|
6
16
|
case 'boolean':
|
|
@@ -46,6 +56,8 @@ export const describeInput = (input) => {
|
|
|
46
56
|
if (Number.isNaN(input)) {
|
|
47
57
|
return 'NaN';
|
|
48
58
|
}
|
|
59
|
+
// Only remaining option is finite number, which we will
|
|
60
|
+
// call "Float" since we've already covered integers
|
|
49
61
|
return 'Float';
|
|
50
62
|
}
|
|
51
63
|
}
|
package/dist/mjs/escapeRegExp.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
const pattern = /[.*+?^${}()|[\]\\]/g;
|
|
2
|
+
/**
|
|
3
|
+
* Escape RegExp special characters in `input`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* escapeRegExp('a.b*c'); // 'a\\.b\\*c'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
2
10
|
export function escapeRegExp(input) {
|
|
3
11
|
return input.length ? input.replace(pattern, '\\$&') : input;
|
|
4
12
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { INDENT_CHAR_RAW_PATTERN, NEWLINE_RAW_PATTERN } from './constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Find indentation on first line that isn't whitespace only.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* findIndentation([' hello', ' world']); // ' '
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
2
10
|
export function findIndentation(lines) {
|
|
3
11
|
return lines
|
|
4
12
|
.find((line) => !/^\s*$/.test(line))
|
package/dist/mjs/get.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { pathParts } from './pathParts.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the value at `path` within `input`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* get({ a: { b: 1 } }, 'a.b'); // 1
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
2
10
|
export function get(input, path) {
|
|
3
11
|
if (path === '') {
|
|
4
12
|
return input;
|
|
5
13
|
}
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
15
|
let current = input;
|
|
7
16
|
for (const part of pathParts(path)) {
|
|
8
17
|
if (typeof current === 'object' && current !== null && part in current) {
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { getISODateString } from './getISODateString.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the date portion (`YYYY-MM-DD`) of `value` as a date string.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* getDateString(new Date('2024-01-15T10:30:00Z')); // '2024-01-15'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
2
10
|
export const getDateString = (value = new Date()) => getISODateString(value).split('T')[0];
|
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert `value` to an ISO 8601 date string.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* getISODateString(new Date('2024-01-15T10:30:00Z')); // '2024-01-15T10:30:00.000Z'
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
1
9
|
export const getISODateString = (value = new Date()) => (value instanceof Date ? value : new Date(value)).toISOString();
|
package/dist/mjs/getMaxValue.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { assertIsNumericValueArray } from './assertion/assertIsNumericValueArray.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the largest value among `values`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* getMaxValue(1, 5, 3); // 5
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
2
10
|
export function getMaxValue(...values) {
|
|
3
11
|
if (values.length === 0) {
|
|
4
12
|
throw new Error('Expected at least one numeric value');
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { isInteger } from './predicate/isInteger.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the number of milliseconds represented by `input`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* getMilliseconds(1000); // 1000
|
|
8
|
+
* getMilliseconds(new Date(0)); // 0
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
2
11
|
export const getMilliseconds = (input) => input instanceof Date ? input.getTime() : isInteger(input) ? input : Date.parse(input);
|
package/dist/mjs/getMinValue.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { assertIsNumericValueArray } from './assertion/assertIsNumericValueArray.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the smallest value among `values`.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* getMinValue(1, 5, 3); // 1
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
2
10
|
export function getMinValue(...values) {
|
|
3
11
|
if (values.length === 0) {
|
|
4
12
|
throw new Error('Expected at least one numeric value');
|
package/dist/mjs/getOwnKeys.js
CHANGED
package/dist/mjs/getOwnPaths.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get all own property paths of `input`, including dot-separated paths for nested objects.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* getOwnPaths({ a: 1, b: { c: 2 } }); // ['a', 'b', 'b.c']
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
1
9
|
export const getOwnPaths = (input) => {
|
|
2
10
|
return Object.entries(input).reduce((paths, [key, value]) => {
|
|
3
11
|
paths.push(key);
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get `data`'s own property names and symbols.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* getOwnProperties({ a: 1, b: 2 }); // ['a', 'b']
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
1
9
|
export function getOwnProperties(data) {
|
|
2
10
|
return [...Object.getOwnPropertyNames(data), ...Object.getOwnPropertySymbols(data)];
|
|
3
11
|
}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract the package name, including any scope, from `input`.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* getPackageName('@scope/name/sub/path'); // '@scope/name'
|
|
7
|
+
* getPackageName('lodash/fp'); // 'lodash'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
export function getPackageName(input) {
|
|
2
11
|
return /^(?<pkg>(?:(?<scope>@[^/]+)\/)?(?<name>[a-z][^/]+))/i.exec(input)?.groups?.['pkg'];
|
|
3
12
|
}
|
package/dist/mjs/getPaths.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { isAnyObject } from './predicate/isAnyObject.js';
|
|
2
2
|
const defaultCompareFunction = (left, right) => typeof left === 'symbol' || typeof right === 'symbol' ? 0 : left.localeCompare(right);
|
|
3
|
+
/**
|
|
4
|
+
* Recursively sort the keys of `data`, optionally using a custom `compareFunction`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* getSortedObject({ b: 2, a: 1 }); // { a: 1, b: 2 }
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export function getSortedObject(data, compareFunction = defaultCompareFunction) {
|
|
4
12
|
if (Array.isArray(data)) {
|
|
5
13
|
return data.map((item) => getSortedObject(item, compareFunction));
|
package/dist/mjs/getType.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the internal `[[Class]]` type of `input`, e.g. `'String'`, `'Array'`, `'Null'`.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* getType([]); // 'Array'
|
|
7
|
+
* getType(null); // 'Null'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
export function getType(input) {
|
|
2
11
|
return Object.prototype.toString.call(input).slice(8, -1);
|
|
3
12
|
}
|
package/dist/mjs/has.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { pathParts } from './pathParts.js';
|
|
2
2
|
import { isAnyObject } from './predicate/isAnyObject.js';
|
|
3
|
+
/**
|
|
4
|
+
* Determine if the path exists on an object.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* has({ a: { b: 1 } }, 'a.b'); // true
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export function has(input, path) {
|
|
4
12
|
if (!isAnyObject(input)) {
|
|
5
13
|
return false;
|
|
@@ -7,6 +15,7 @@ export function has(input, path) {
|
|
|
7
15
|
if (path === '') {
|
|
8
16
|
return false;
|
|
9
17
|
}
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
19
|
let current = input;
|
|
11
20
|
for (const part of pathParts(path)) {
|
|
12
21
|
if (typeof current === 'object' && current !== null && part in current) {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determine if the `input` object has properties other than the provided `knownProperties`.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* hasAdditionalProperties({ a: 1, b: 2 }, ['a']); // true
|
|
7
|
+
* hasAdditionalProperties({ a: 1 }, ['a']); // false
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
export const hasAdditionalProperties = (input, knownProperties) => {
|
|
2
11
|
const properties = Array.isArray(input) ? [...knownProperties.map(String), 'length'] : knownProperties;
|
|
3
12
|
return !Reflect.ownKeys(input).every((key) => properties.includes(key));
|
package/dist/mjs/inRange.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determine if `input` is a number or bigint between `min` and `max`, inclusive.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* inRange(5, 1, 10); // true
|
|
7
|
+
* inRange(15, 1, 10); // false
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
export const inRange = (input, min, max) => (typeof input === 'number' || typeof input === 'bigint') && input >= min && input <= max;
|
package/dist/mjs/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
// Folders
|
|
1
2
|
export * from './assertion/index.js';
|
|
2
3
|
export * from './predicate/factory/index.js';
|
|
3
4
|
export * from './predicate/index.js';
|
|
4
5
|
export * from './types/index.js';
|
|
6
|
+
// Files
|
|
5
7
|
export * from './asArray.js';
|
|
6
8
|
export * from './asError.js';
|
|
7
9
|
export * from './capitalize.js';
|
package/dist/mjs/isEmpty.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { isLengthAware } from './predicate/isLengthAware.js';
|
|
2
|
+
/**
|
|
3
|
+
* Determine if `input` is empty.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* isEmpty(''); // true
|
|
8
|
+
* isEmpty([1]); // false
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
2
11
|
export function isEmpty(input) {
|
|
3
12
|
if (input == null || (typeof input === 'string' && !input.length)) {
|
|
4
13
|
return true;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repeatedly yield the items in `items`, looping forever.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const iterator = iterateForever([1, 2, 3]);
|
|
7
|
+
*
|
|
8
|
+
* iterator.next().value; // 1
|
|
9
|
+
* iterator.next().value; // 2
|
|
10
|
+
* iterator.next().value; // 3
|
|
11
|
+
* iterator.next().value; // 1
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
1
14
|
export function* iterateForever(items) {
|
|
2
15
|
while (true) {
|
|
3
16
|
yield* items;
|
package/dist/mjs/joinStrings.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { trimEnd } from './trimEnd.js';
|
|
2
2
|
import { trimStart } from './trimStart.js';
|
|
3
|
+
/**
|
|
4
|
+
* Join `left` and `right` with `separator`, without duplicating the separator at the seam.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* joinStrings('a/', '/b'); // 'a/b'
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export function joinStrings(left, right, separator = '/') {
|
|
4
12
|
return trimEnd(left, separator) + separator + trimStart(right, separator);
|
|
5
13
|
}
|
package/dist/mjs/jsonParse.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse `input` as JSON, optionally asserting the parsed value's type with `assertionFn`.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* jsonParse('{"a":1}'); // { a: 1 }
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
1
9
|
export function jsonParse(input, reviver, assertionFn) {
|
|
2
10
|
const data = JSON.parse(input, reviver);
|
|
3
11
|
assertionFn?.(data);
|
package/dist/mjs/looksLikeURL.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determine if `input` looks like a URL.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* looksLikeURL('https://example.com'); // true
|
|
7
|
+
* looksLikeURL('not a url'); // false
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line no-control-regex
|
|
1
11
|
export const looksLikeURL = (input) => /^[\x00-\x7F]+:\/\/.+/.test(input);
|