inferred-types 0.44.0 → 0.45.2
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/constants/Characters.d.ts +2 -0
- package/dist/constants/Characters.d.ts.map +1 -0
- package/dist/constants/Characters.js +5 -0
- package/dist/constants/NetworkConstants.d.ts +29 -0
- package/dist/constants/NetworkConstants.d.ts.map +1 -0
- package/dist/constants/NetworkConstants.js +83 -0
- package/dist/constants/Phone.d.ts +8 -0
- package/dist/constants/Phone.d.ts.map +1 -0
- package/dist/constants/Phone.js +262 -0
- package/dist/constants/ProxmoxConstants.d.ts +2 -0
- package/dist/constants/ProxmoxConstants.d.ts.map +1 -0
- package/dist/constants/ProxmoxConstants.js +3 -0
- package/dist/constants/index.d.ts +4 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +4 -1
- package/dist/constants/tsconfig.tsbuildinfo +1 -1
- package/dist/inferred-types/index.cjs +1657 -1029
- package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/api/defineApi.d.ts +56 -0
- package/dist/runtime/api/defineApi.d.ts.map +1 -0
- package/dist/runtime/api/defineApi.js +97 -0
- package/dist/runtime/api/handleDoneFn.d.ts.map +1 -0
- package/dist/runtime/api/index.d.ts +3 -0
- package/dist/runtime/api/index.d.ts.map +1 -0
- package/dist/runtime/api/index.js +2 -0
- package/dist/runtime/boolean-logic/ifArrayPartial.d.ts +1 -1
- package/dist/runtime/boolean-logic/ifArrayPartial.d.ts.map +1 -1
- package/dist/runtime/boolean-logic/ifArrayPartial.js +1 -1
- package/dist/runtime/boolean-logic/ifLength.d.ts.map +1 -1
- package/dist/runtime/boolean-logic/ifScalar.d.ts.map +1 -1
- package/dist/runtime/boolean-logic/ifScalar.js +1 -1
- package/dist/runtime/boolean-logic/index.d.ts +0 -1
- package/dist/runtime/boolean-logic/index.d.ts.map +1 -1
- package/dist/runtime/boolean-logic/index.js +0 -1
- package/dist/runtime/dictionary/defineOptions.d.ts +26 -0
- package/dist/runtime/dictionary/defineOptions.d.ts.map +1 -0
- package/dist/runtime/dictionary/defineOptions.js +30 -0
- package/dist/runtime/dictionary/keysOf.d.ts +1 -1
- package/dist/runtime/dictionary/keysOf.d.ts.map +1 -1
- package/dist/runtime/dictionary/withKeys.d.ts +1 -1
- package/dist/runtime/errors/KindError.d.ts +2 -2
- package/dist/runtime/errors/KindError.d.ts.map +1 -1
- package/dist/runtime/functions/index.d.ts +1 -0
- package/dist/runtime/functions/index.d.ts.map +1 -1
- package/dist/runtime/functions/index.js +1 -0
- package/dist/runtime/functions/wrapFn.d.ts +2 -0
- package/dist/runtime/functions/wrapFn.d.ts.map +1 -0
- package/dist/runtime/functions/wrapFn.js +24 -0
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -10
- package/dist/runtime/lists/find.d.ts +1 -1
- package/dist/runtime/lists/find.d.ts.map +1 -1
- package/dist/runtime/lists/intersection.d.ts.map +1 -1
- package/dist/runtime/lists/intersection.js +2 -1
- package/dist/runtime/literals/asPhoneNumber.d.ts +10 -0
- package/dist/runtime/literals/asPhoneNumber.d.ts.map +1 -0
- package/dist/runtime/literals/asPhoneNumber.js +62 -0
- package/dist/runtime/literals/index.d.ts +5 -0
- package/dist/runtime/literals/index.d.ts.map +1 -1
- package/dist/runtime/literals/index.js +5 -0
- package/dist/runtime/literals/retainChars.d.ts +16 -0
- package/dist/runtime/literals/retainChars.d.ts.map +1 -0
- package/dist/runtime/literals/retainChars.js +17 -0
- package/dist/runtime/literals/retainWhile.d.ts +11 -0
- package/dist/runtime/literals/retainWhile.d.ts.map +1 -0
- package/dist/runtime/literals/retainWhile.js +12 -0
- package/dist/runtime/literals/stripChars.d.ts +10 -0
- package/dist/runtime/literals/stripChars.d.ts.map +1 -0
- package/dist/runtime/literals/stripChars.js +11 -0
- package/dist/runtime/literals/stripLeading.d.ts +3 -3
- package/dist/runtime/literals/stripLeading.d.ts.map +1 -1
- package/dist/runtime/literals/stripLeading.js +5 -5
- package/dist/runtime/literals/takeNumericCharacters.d.ts +9 -0
- package/dist/runtime/literals/takeNumericCharacters.d.ts.map +1 -0
- package/dist/runtime/literals/takeNumericCharacters.js +12 -0
- package/dist/runtime/literals/unset.d.ts +8 -0
- package/dist/runtime/literals/unset.d.ts.map +1 -0
- package/dist/runtime/literals/unset.js +14 -0
- package/dist/runtime/meta/index.d.ts +3 -0
- package/dist/runtime/meta/index.d.ts.map +1 -0
- package/dist/runtime/meta/index.js +2 -0
- package/dist/runtime/meta/urlMeta.d.ts +52 -0
- package/dist/runtime/meta/urlMeta.d.ts.map +1 -0
- package/dist/runtime/meta/urlMeta.js +57 -0
- package/dist/runtime/meta/youtube-meta.d.ts +38 -0
- package/dist/runtime/meta/youtube-meta.d.ts.map +1 -0
- package/dist/runtime/meta/youtube-meta.js +67 -0
- package/dist/runtime/runtime-types/dict.d.ts +2 -2
- package/dist/runtime/runtime-types/dict.d.ts.map +1 -1
- package/dist/runtime/runtime-types/ip6Prefix.d.ts +1 -1
- package/dist/runtime/runtime-types/parse.d.ts +1 -1
- package/dist/runtime/runtime-types/shape-helpers/getTokenData.d.ts +1 -1
- package/dist/runtime/runtime-types/shape-helpers/getTokenName.d.ts +1 -1
- package/dist/runtime/runtime-types/shape-helpers/singletons.d.ts.map +1 -1
- package/dist/runtime/runtime-types/shape-helpers/singletons.js +1 -1
- package/dist/runtime/runtime-types/shape.d.ts +1 -1
- package/dist/runtime/runtime-types/shape.js +1 -1
- package/dist/runtime/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/type-conversion/asChars.d.ts +8 -0
- package/dist/runtime/type-conversion/asChars.d.ts.map +1 -0
- package/dist/runtime/type-conversion/asChars.js +8 -0
- package/dist/runtime/type-conversion/index.d.ts +2 -0
- package/dist/runtime/type-conversion/index.d.ts.map +1 -1
- package/dist/runtime/type-conversion/index.js +2 -0
- package/dist/runtime/type-conversion/ip6GroupExpansion.d.ts +14 -0
- package/dist/runtime/type-conversion/ip6GroupExpansion.d.ts.map +1 -0
- package/dist/runtime/type-conversion/ip6GroupExpansion.js +15 -0
- package/dist/runtime/type-guards/api-tg.d.ts +33 -0
- package/dist/runtime/type-guards/api-tg.d.ts.map +1 -0
- package/dist/runtime/type-guards/api-tg.js +38 -0
- package/dist/runtime/type-guards/hasWhitespace.d.ts +7 -0
- package/dist/runtime/type-guards/hasWhitespace.d.ts.map +1 -0
- package/dist/runtime/type-guards/hasWhitespace.js +11 -0
- package/dist/runtime/type-guards/index.d.ts +11 -0
- package/dist/runtime/type-guards/index.d.ts.map +1 -1
- package/dist/runtime/type-guards/index.js +11 -0
- package/dist/runtime/type-guards/isConstant.d.ts +6 -0
- package/dist/runtime/type-guards/isConstant.d.ts.map +1 -1
- package/dist/runtime/type-guards/isConstant.js +12 -2
- package/dist/runtime/type-guards/isEmail.d.ts +7 -0
- package/dist/runtime/type-guards/isEmail.d.ts.map +1 -0
- package/dist/runtime/type-guards/isEmail.js +11 -0
- package/dist/runtime/type-guards/isHexadecimal.d.ts +8 -0
- package/dist/runtime/type-guards/isHexadecimal.d.ts.map +1 -0
- package/dist/runtime/type-guards/isHexadecimal.js +13 -0
- package/dist/runtime/type-guards/isPhoneNumber.d.ts +14 -0
- package/dist/runtime/type-guards/isPhoneNumber.d.ts.map +1 -0
- package/dist/runtime/type-guards/isPhoneNumber.js +26 -0
- package/dist/runtime/type-guards/isSpecificConstant.js +2 -3
- package/dist/runtime/type-guards/isTrimmable.d.ts +7 -0
- package/dist/runtime/type-guards/isTrimmable.d.ts.map +1 -0
- package/dist/runtime/type-guards/isTrimmable.js +9 -0
- package/dist/runtime/type-guards/isUnset.d.ts +18 -0
- package/dist/runtime/type-guards/isUnset.d.ts.map +1 -0
- package/dist/runtime/type-guards/isUnset.js +23 -0
- package/dist/runtime/type-guards/isUrl.d.ts +2 -4
- package/dist/runtime/type-guards/isUrl.d.ts.map +1 -1
- package/dist/runtime/type-guards/isUrl.js +2 -3
- package/dist/runtime/type-guards/network-tg.d.ts +54 -0
- package/dist/runtime/type-guards/network-tg.d.ts.map +1 -0
- package/dist/runtime/type-guards/network-tg.js +94 -0
- package/dist/runtime/type-guards/repos.d.ts +6 -6
- package/dist/runtime/type-guards/repos.d.ts.map +1 -1
- package/dist/runtime/type-guards/youtube.d.ts +44 -0
- package/dist/runtime/type-guards/youtube.d.ts.map +1 -0
- package/dist/runtime/type-guards/youtube.js +84 -0
- package/dist/types/api/api.d.ts +96 -37
- package/dist/types/api/api.d.ts.map +1 -1
- package/dist/types/base-types/fns/EscapeFunction.d.ts +22 -0
- package/dist/types/base-types/fns/EscapeFunction.d.ts.map +1 -0
- package/dist/types/base-types/fns/OptionalParamFn.d.ts +30 -0
- package/dist/types/base-types/fns/OptionalParamFn.d.ts.map +1 -0
- package/dist/types/base-types/fns/index.d.ts +2 -0
- package/dist/types/base-types/fns/index.d.ts.map +1 -1
- package/dist/types/base-types/fns/index.js +2 -0
- package/dist/types/boolean-logic/branching/If.d.ts +2 -3
- package/dist/types/boolean-logic/branching/If.d.ts.map +1 -1
- package/dist/types/boolean-logic/branching/IfUnset.d.ts +12 -0
- package/dist/types/boolean-logic/branching/IfUnset.d.ts.map +1 -0
- package/dist/types/boolean-logic/branching/OnPass.d.ts +4 -3
- package/dist/types/boolean-logic/branching/OnPass.d.ts.map +1 -1
- package/dist/types/boolean-logic/branching/WhenNever.d.ts +11 -0
- package/dist/types/boolean-logic/branching/WhenNever.d.ts.map +1 -0
- package/dist/types/boolean-logic/branching/index.d.ts +2 -0
- package/dist/types/boolean-logic/branching/index.d.ts.map +1 -1
- package/dist/types/boolean-logic/branching/index.js +2 -0
- package/dist/types/boolean-logic/combinators/And.d.ts +1 -1
- package/dist/types/boolean-logic/combinators/And.d.ts.map +1 -1
- package/dist/types/boolean-logic/combinators/Compare.d.ts +3 -3
- package/dist/types/boolean-logic/combinators/Compare.d.ts.map +1 -1
- package/dist/types/boolean-logic/combinators/Not.d.ts +5 -6
- package/dist/types/boolean-logic/combinators/Not.d.ts.map +1 -1
- package/dist/types/boolean-logic/combinators/Some.d.ts +8 -0
- package/dist/types/boolean-logic/combinators/Some.d.ts.map +1 -0
- package/dist/types/boolean-logic/combinators/Some.js +1 -0
- package/dist/types/boolean-logic/combinators/index.d.ts +1 -0
- package/dist/types/boolean-logic/combinators/index.d.ts.map +1 -1
- package/dist/types/boolean-logic/combinators/index.js +1 -0
- package/dist/types/boolean-logic/narrowing/AsDoneFn.d.ts +2 -2
- package/dist/types/boolean-logic/narrowing/AsDoneFn.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/ApiOperators.d.ts +11 -0
- package/dist/types/boolean-logic/operators/ApiOperators.d.ts.map +1 -0
- package/dist/types/boolean-logic/operators/ApiOperators.js +1 -0
- package/dist/types/boolean-logic/operators/Extends.d.ts +2 -1
- package/dist/types/boolean-logic/operators/Extends.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/HasSameValues.d.ts +4 -3
- package/dist/types/boolean-logic/operators/HasSameValues.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/IsBoolean.d.ts +2 -1
- package/dist/types/boolean-logic/operators/IsBoolean.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/IsCssHexadecimal.d.ts +9 -0
- package/dist/types/boolean-logic/operators/IsCssHexadecimal.d.ts.map +1 -0
- package/dist/types/boolean-logic/operators/IsCssHexadecimal.js +1 -0
- package/dist/types/boolean-logic/operators/IsEqual.d.ts +7 -1
- package/dist/types/boolean-logic/operators/IsEqual.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/IsGreaterThan.d.ts +2 -2
- package/dist/types/boolean-logic/operators/IsGreaterThan.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/IsLessThan.d.ts +13 -0
- package/dist/types/boolean-logic/operators/IsLessThan.d.ts.map +1 -0
- package/dist/types/boolean-logic/operators/IsLessThan.js +1 -0
- package/dist/types/boolean-logic/operators/IsNever.d.ts +2 -1
- package/dist/types/boolean-logic/operators/IsNever.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/IsNumber.d.ts +2 -2
- package/dist/types/boolean-logic/operators/IsNumber.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/IsString.d.ts +2 -2
- package/dist/types/boolean-logic/operators/IsString.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/IsUnset.d.ts +9 -0
- package/dist/types/boolean-logic/operators/IsUnset.d.ts.map +1 -0
- package/dist/types/boolean-logic/operators/IsUnset.js +1 -0
- package/dist/types/boolean-logic/operators/IsUrl.d.ts +35 -0
- package/dist/types/boolean-logic/operators/IsUrl.d.ts.map +1 -0
- package/dist/types/boolean-logic/operators/IsUrl.js +1 -0
- package/dist/types/boolean-logic/operators/Network-operators.d.ts +71 -0
- package/dist/types/boolean-logic/operators/Network-operators.d.ts.map +1 -0
- package/dist/types/boolean-logic/operators/Network-operators.js +1 -0
- package/dist/types/boolean-logic/operators/PhoneOperators.d.ts +33 -0
- package/dist/types/boolean-logic/operators/PhoneOperators.d.ts.map +1 -0
- package/dist/types/boolean-logic/operators/PhoneOperators.js +1 -0
- package/dist/types/boolean-logic/operators/YouTube-operators.d.ts +32 -0
- package/dist/types/boolean-logic/operators/YouTube-operators.d.ts.map +1 -0
- package/dist/types/boolean-logic/operators/YouTube-operators.js +1 -0
- package/dist/types/boolean-logic/operators/index.d.ts +7 -1
- package/dist/types/boolean-logic/operators/index.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/index.js +7 -1
- package/dist/types/dictionary/Keys.d.ts +58 -4
- package/dist/types/dictionary/Keys.d.ts.map +1 -1
- package/dist/types/dictionary/KvFn.d.ts +2 -2
- package/dist/types/dictionary/KvFn.d.ts.map +1 -1
- package/dist/types/dictionary/MakeKeysOptional.d.ts +12 -3
- package/dist/types/dictionary/MakeKeysOptional.d.ts.map +1 -1
- package/dist/types/dictionary/MakeKeysRequired.d.ts +14 -0
- package/dist/types/dictionary/MakeKeysRequired.d.ts.map +1 -0
- package/dist/types/dictionary/MakeKeysRequired.js +1 -0
- package/dist/types/dictionary/OptionalKeys.d.ts +19 -4
- package/dist/types/dictionary/OptionalKeys.d.ts.map +1 -1
- package/dist/types/dictionary/OptionalKeys.js +1 -0
- package/dist/types/dictionary/RequiredKeys.d.ts +14 -6
- package/dist/types/dictionary/RequiredKeys.d.ts.map +1 -1
- package/dist/types/dictionary/Values.d.ts +2 -2
- package/dist/types/dictionary/Values.d.ts.map +1 -1
- package/dist/types/dictionary/index.d.ts +1 -2
- package/dist/types/dictionary/index.d.ts.map +1 -1
- package/dist/types/dictionary/index.js +1 -2
- package/dist/types/errors/KindError.d.ts +1 -1
- package/dist/types/errors/KindError.d.ts.map +1 -1
- package/dist/types/functions/FnFrom.d.ts +5 -0
- package/dist/types/functions/FnFrom.d.ts.map +1 -1
- package/dist/types/functions/{Fn.d.ts → FnWithDescription.d.ts} +2 -2
- package/dist/types/functions/FnWithDescription.d.ts.map +1 -0
- package/dist/types/functions/FnWithDescription.js +1 -0
- package/dist/types/functions/WrapperFn.d.ts +23 -0
- package/dist/types/functions/WrapperFn.d.ts.map +1 -0
- package/dist/types/functions/WrapperFn.js +1 -0
- package/dist/types/functions/index.d.ts +2 -1
- package/dist/types/functions/index.d.ts.map +1 -1
- package/dist/types/functions/index.js +2 -1
- package/dist/types/lists/ConvertSet.d.ts +2 -2
- package/dist/types/lists/ConvertSet.d.ts.map +1 -1
- package/dist/types/lists/Find.d.ts +7 -18
- package/dist/types/lists/Find.d.ts.map +1 -1
- package/dist/types/literals/DoneFnTuple.d.ts +3 -3
- package/dist/types/literals/DoneFnTuple.d.ts.map +1 -1
- package/dist/types/literals/Unset.d.ts +13 -0
- package/dist/types/literals/Unset.d.ts.map +1 -0
- package/dist/types/literals/Unset.js +1 -0
- package/dist/types/literals/index.d.ts +1 -0
- package/dist/types/literals/index.d.ts.map +1 -1
- package/dist/types/literals/index.js +1 -0
- package/dist/types/numeric-literals/NumberLike.d.ts +1 -1
- package/dist/types/numeric-literals/NumberLike.d.ts.map +1 -1
- package/dist/types/string-literals/Proxmox.d.ts +7 -0
- package/dist/types/string-literals/Proxmox.d.ts.map +1 -0
- package/dist/types/string-literals/Proxmox.js +1 -0
- package/dist/types/string-literals/RetainUntil.d.ts +33 -0
- package/dist/types/string-literals/RetainUntil.d.ts.map +1 -0
- package/dist/types/string-literals/RetainUntil.js +1 -0
- package/dist/types/string-literals/Split.d.ts +3 -3
- package/dist/types/string-literals/Split.d.ts.map +1 -1
- package/dist/types/string-literals/StripAfter.d.ts +2 -2
- package/dist/types/string-literals/StripAfter.d.ts.map +1 -1
- package/dist/types/string-literals/StripBefore.d.ts +2 -2
- package/dist/types/string-literals/StripBefore.d.ts.map +1 -1
- package/dist/types/string-literals/StripLeading.d.ts +2 -2
- package/dist/types/string-literals/StripLeading.d.ts.map +1 -1
- package/dist/types/string-literals/StripUntil.d.ts +18 -0
- package/dist/types/string-literals/StripUntil.d.ts.map +1 -0
- package/dist/types/string-literals/StripUntil.js +1 -0
- package/dist/types/string-literals/character-sets/DomainName.d.ts +17 -18
- package/dist/types/string-literals/character-sets/DomainName.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/IpAddress.d.ts +28 -4
- package/dist/types/string-literals/character-sets/IpAddress.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/Optional.d.ts +14 -0
- package/dist/types/string-literals/character-sets/Optional.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/Optional.js +1 -0
- package/dist/types/string-literals/character-sets/Repos.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/Url.d.ts +85 -37
- package/dist/types/string-literals/character-sets/Url.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/Url.js +1 -0
- package/dist/types/string-literals/character-sets/Whitespace.d.ts +3 -1
- package/dist/types/string-literals/character-sets/Whitespace.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/YouTube.d.ts +127 -0
- package/dist/types/string-literals/character-sets/YouTube.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/YouTube.js +1 -0
- package/dist/types/string-literals/character-sets/index.d.ts +3 -0
- package/dist/types/string-literals/character-sets/index.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/index.js +3 -0
- package/dist/types/string-literals/character-sets/phone.d.ts +192 -0
- package/dist/types/string-literals/character-sets/phone.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/phone.js +1 -0
- package/dist/types/string-literals/index.d.ts +2 -0
- package/dist/types/string-literals/index.d.ts.map +1 -1
- package/dist/types/string-literals/index.js +2 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/type-conversion/ReduceValues.d.ts +19 -0
- package/dist/types/type-conversion/ReduceValues.d.ts.map +1 -0
- package/dist/types/type-conversion/ReduceValues.js +1 -0
- package/dist/types/type-conversion/ReturnValues.d.ts +10 -6
- package/dist/types/type-conversion/ReturnValues.d.ts.map +1 -1
- package/dist/types/type-conversion/Trim.d.ts +3 -1
- package/dist/types/type-conversion/Trim.d.ts.map +1 -1
- package/dist/types/type-conversion/UnionFilter.d.ts +2 -2
- package/dist/types/type-conversion/UnionFilter.d.ts.map +1 -1
- package/dist/types/type-conversion/form-fields.d.ts +5 -1
- package/dist/types/type-conversion/form-fields.d.ts.map +1 -1
- package/dist/types/type-conversion/index.d.ts +1 -0
- package/dist/types/type-conversion/index.d.ts.map +1 -1
- package/dist/types/type-conversion/index.js +1 -0
- package/package.json +17 -11
- package/dist/constants/Network.d.ts +0 -22
- package/dist/constants/Network.d.ts.map +0 -1
- package/dist/constants/Network.js +0 -21
- package/dist/runtime/boolean-logic/handleDoneFn.d.ts.map +0 -1
- package/dist/types/boolean-logic/operators/IsHexadecimal.d.ts +0 -9
- package/dist/types/boolean-logic/operators/IsHexadecimal.d.ts.map +0 -1
- package/dist/types/dictionary/PrivateKeys.d.ts +0 -17
- package/dist/types/dictionary/PrivateKeys.d.ts.map +0 -1
- package/dist/types/dictionary/PublicKeys.d.ts +0 -10
- package/dist/types/dictionary/PublicKeys.d.ts.map +0 -1
- package/dist/types/functions/Fn.d.ts.map +0 -1
- /package/dist/runtime/{boolean-logic → api}/handleDoneFn.d.ts +0 -0
- /package/dist/runtime/{boolean-logic → api}/handleDoneFn.js +0 -0
- /package/dist/types/{boolean-logic/operators/IsHexadecimal.js → base-types/fns/EscapeFunction.js} +0 -0
- /package/dist/types/{dictionary/PrivateKeys.js → base-types/fns/OptionalParamFn.js} +0 -0
- /package/dist/types/{dictionary/PublicKeys.js → boolean-logic/branching/IfUnset.js} +0 -0
- /package/dist/types/{functions/Fn.js → boolean-logic/branching/WhenNever.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asChars.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-conversion/asChars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,0BAAwB;AAExC;;;;GAIG;AACH,eAAO,MAAM,OAAO,0BAA2B,CAAC,KAAG,MAAM,CAAC,CAEzD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-conversion/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-conversion/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Ip6GroupExpansion } from "../../types/index";
|
|
2
|
+
/**
|
|
3
|
+
* **ip6GroupExpansion**`(ip)`
|
|
4
|
+
*
|
|
5
|
+
* Looks at the IPv6 address and expands all instances of `::` to add
|
|
6
|
+
* a block of `0000` where it was.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* // fe89:0000:1256
|
|
10
|
+
* const ip6 = ip6GroupExpansion("fe89::1256");
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const ip6GroupExpansion: <T extends string>(ip: T) => Ip6GroupExpansion<T>;
|
|
14
|
+
//# sourceMappingURL=ip6GroupExpansion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ip6GroupExpansion.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-conversion/ip6GroupExpansion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,0BAAuB;AAGnD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,yBAA0B,CAAC,yBAExD,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { stripTrailing } from "../literals/stripTrailing.js";
|
|
2
|
+
/**
|
|
3
|
+
* **ip6GroupExpansion**`(ip)`
|
|
4
|
+
*
|
|
5
|
+
* Looks at the IPv6 address and expands all instances of `::` to add
|
|
6
|
+
* a block of `0000` where it was.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* // fe89:0000:1256
|
|
10
|
+
* const ip6 = ip6GroupExpansion("fe89::1256");
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export const ip6GroupExpansion = (ip) => {
|
|
14
|
+
return stripTrailing(ip.replaceAll("::", ":0000:"), ":");
|
|
15
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Dictionary, Narrowable, OptionalParamFn, TypedFunction } from "../../types/index";
|
|
2
|
+
export declare const isEscapeFunction: <T>(val: T) => val is T & (() => unknown);
|
|
3
|
+
/**
|
|
4
|
+
* **isOptionalParamFunction**`(val)`
|
|
5
|
+
*
|
|
6
|
+
* A type guard which ensures that the value passed in is not only a _function_
|
|
7
|
+
* but also has the `optionalParam` value set to **true** indicating that it
|
|
8
|
+
* is safe to be called _without_ parameters.
|
|
9
|
+
*
|
|
10
|
+
* **Note:** this is similar to an "escape function" but whereas an API can
|
|
11
|
+
* only have one escape function, an API may have as many ze
|
|
12
|
+
*/
|
|
13
|
+
export declare const isOptionalParamFunction: <T>(val: T) => val is T & OptionalParamFn;
|
|
14
|
+
/**
|
|
15
|
+
* **isApi**`(val)`
|
|
16
|
+
*
|
|
17
|
+
* Type guard which validates that the value passed in is an `Api` type
|
|
18
|
+
* with "surface" and "_kind" property.
|
|
19
|
+
*
|
|
20
|
+
* **Related:** `isFluentApi()`
|
|
21
|
+
*/
|
|
22
|
+
export declare const isApi: <T extends Narrowable>(api: T) => api is T & {
|
|
23
|
+
__kind: "api";
|
|
24
|
+
surface: Dictionary | TypedFunction;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* **isApiSurface**`(val)`
|
|
28
|
+
*
|
|
29
|
+
* A type guard which tests whether the value passed in is the SurfaceArea
|
|
30
|
+
* of an API (or could be).
|
|
31
|
+
*/
|
|
32
|
+
export declare const isApiSurface: <T>(val: T) => val is T & (Dictionary | TypedFunction);
|
|
33
|
+
//# sourceMappingURL=api-tg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-tg.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/api-tg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,UAAU,EAAG,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,0BAAwB;AAK3F,eAAO,MAAM,gBAAgB,WAAY,CAAC,uBAAqB,OAAO,CAErE,CAAA;AAGD;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,WAAY,CAAC,+BAEhD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,8BAA+B,CAAC;YAAwB,KAAK;aAAW,UAAU,GAAG,aAAa;CAEnH,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,WAAY,CAAC,4CAErC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { isFunction } from "./isFunction.js";
|
|
2
|
+
import { isObject } from "./isObject.js";
|
|
3
|
+
export const isEscapeFunction = (val) => {
|
|
4
|
+
return isFunction(val) && "escape" in val && val.escape === true;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* **isOptionalParamFunction**`(val)`
|
|
8
|
+
*
|
|
9
|
+
* A type guard which ensures that the value passed in is not only a _function_
|
|
10
|
+
* but also has the `optionalParam` value set to **true** indicating that it
|
|
11
|
+
* is safe to be called _without_ parameters.
|
|
12
|
+
*
|
|
13
|
+
* **Note:** this is similar to an "escape function" but whereas an API can
|
|
14
|
+
* only have one escape function, an API may have as many ze
|
|
15
|
+
*/
|
|
16
|
+
export const isOptionalParamFunction = (val) => {
|
|
17
|
+
return isFunction(val) && "optionalParams" in val && val.optionalParams === true;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* **isApi**`(val)`
|
|
21
|
+
*
|
|
22
|
+
* Type guard which validates that the value passed in is an `Api` type
|
|
23
|
+
* with "surface" and "_kind" property.
|
|
24
|
+
*
|
|
25
|
+
* **Related:** `isFluentApi()`
|
|
26
|
+
*/
|
|
27
|
+
export const isApi = (api) => {
|
|
28
|
+
return isObject(api) && "surface" in api && "_kind" in api && api._kind === "api";
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* **isApiSurface**`(val)`
|
|
32
|
+
*
|
|
33
|
+
* A type guard which tests whether the value passed in is the SurfaceArea
|
|
34
|
+
* of an API (or could be).
|
|
35
|
+
*/
|
|
36
|
+
export const isApiSurface = (val) => {
|
|
37
|
+
return isObject(val) && Object.keys(val).some(k => isEscapeFunction(val[k]));
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasWhitespace.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/hasWhitespace.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,aAAa,WAAY,CAAC,aAEtC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WHITESPACE_CHARS } from "../../constants/Characters.js";
|
|
2
|
+
import { asChars } from "../type-conversion/index.js";
|
|
3
|
+
import { isString } from "./isString.js";
|
|
4
|
+
/**
|
|
5
|
+
* **hasWhiteSpace**`(val)`
|
|
6
|
+
*
|
|
7
|
+
* Type guard which checks whether a string has a any whitespace characters in it
|
|
8
|
+
*/
|
|
9
|
+
export const hasWhiteSpace = (val) => {
|
|
10
|
+
return isString(val) && asChars(val).some(c => WHITESPACE_CHARS.includes(c));
|
|
11
|
+
};
|
|
@@ -35,5 +35,16 @@ export * from "./isDoneFn";
|
|
|
35
35
|
export * from "./isUrl";
|
|
36
36
|
export * from "./isCssAspectRatio";
|
|
37
37
|
export * from "./isInlineSvg";
|
|
38
|
+
export * from "./youtube";
|
|
39
|
+
export * from "./repos";
|
|
40
|
+
export * from "./network-tg";
|
|
41
|
+
export * from "./isHexadecimal";
|
|
42
|
+
export * from "./isTrimmable";
|
|
43
|
+
export * from "./hasWhitespace";
|
|
44
|
+
export * from "./isEmail";
|
|
45
|
+
export * from "./isPhoneNumber";
|
|
46
|
+
export * from "./isUnset";
|
|
47
|
+
export * from "./api-tg";
|
|
48
|
+
export * from "./isFunction";
|
|
38
49
|
export * from "./higher-order/index";
|
|
39
50
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAE7B,cAAc,sBAAsB,CAAC"}
|
|
@@ -35,4 +35,15 @@ export * from "./isDoneFn.js";
|
|
|
35
35
|
export * from "./isUrl.js";
|
|
36
36
|
export * from "./isCssAspectRatio.js";
|
|
37
37
|
export * from "./isInlineSvg.js";
|
|
38
|
+
export * from "./youtube.js";
|
|
39
|
+
export * from "./repos.js";
|
|
40
|
+
export * from "./network-tg.js";
|
|
41
|
+
export * from "./isHexadecimal.js";
|
|
42
|
+
export * from "./isTrimmable.js";
|
|
43
|
+
export * from "./hasWhitespace.js";
|
|
44
|
+
export * from "./isEmail.js";
|
|
45
|
+
export * from "./isPhoneNumber.js";
|
|
46
|
+
export * from "./isUnset.js";
|
|
47
|
+
export * from "./api-tg.js";
|
|
48
|
+
export * from "./isFunction.js";
|
|
38
49
|
export * from "./higher-order/index.js";
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { Constant } from "../../constants/index";
|
|
2
|
+
/**
|
|
3
|
+
* **isConstant**`(val)`
|
|
4
|
+
*
|
|
5
|
+
* Type guard which checks to see if it is of type
|
|
6
|
+
* `Constant<T>`.
|
|
7
|
+
*/
|
|
2
8
|
export declare function isConstant<K extends string>(value: unknown): value is Constant<K>;
|
|
3
9
|
//# sourceMappingURL=isConstant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isConstant.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isConstant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"isConstant.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isConstant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAG,8BAA4B;AAGhD;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,CAAC,SAAS,MAAM,EAChB,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAMtC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { isObject
|
|
1
|
+
import { isObject } from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* **isConstant**`(val)`
|
|
4
|
+
*
|
|
5
|
+
* Type guard which checks to see if it is of type
|
|
6
|
+
* `Constant<T>`.
|
|
7
|
+
*/
|
|
2
8
|
export function isConstant(value) {
|
|
3
|
-
return isObject(value) &&
|
|
9
|
+
return isObject(value) &&
|
|
10
|
+
"_type" in value &&
|
|
11
|
+
"kind" in value &&
|
|
12
|
+
value._type === "Constant"
|
|
13
|
+
? true : false;
|
|
4
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEmail.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isEmail.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,OAAO,WAAY,CAAC,+CAMhC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { asChars, isString, last } from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* **isEmail**`(val)`
|
|
4
|
+
*
|
|
5
|
+
* Tests to see if a string is shaped as an email address.
|
|
6
|
+
*/
|
|
7
|
+
export const isEmail = (val) => {
|
|
8
|
+
return isString(val) && (val.split("@").length === 2 &&
|
|
9
|
+
val.split("@")[1].split(".").length > 1 &&
|
|
10
|
+
asChars(last(val.split("@")[1].split("."))).length > 1);
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isHexadecimal.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isHexadecimal.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,aAAa,WAAY,CAAC,aAGtC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { asChars } from "../type-conversion/asChars.js";
|
|
2
|
+
import { isNumericString } from "./isNumericString.js";
|
|
3
|
+
import { isString } from "./isString.js";
|
|
4
|
+
/**
|
|
5
|
+
* **isHexadecimal**`(val)`
|
|
6
|
+
*
|
|
7
|
+
* Type guard which checks whether all of the characters in the given string
|
|
8
|
+
* are hexadecimal characters.
|
|
9
|
+
*/
|
|
10
|
+
export const isHexadecimal = (val) => {
|
|
11
|
+
return isString(val) &&
|
|
12
|
+
asChars(val).every(i => isNumericString(i) || ["a", "b", "c", "d", "e", "f"].includes(i.toLowerCase()));
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **isPhoneNumber**`(val)`
|
|
3
|
+
*
|
|
4
|
+
* Type guard which validates that a string is in the shape of a phone
|
|
5
|
+
* number.
|
|
6
|
+
*
|
|
7
|
+
* - Only valid characters (numeric, whitespace, `+`, `-`, `.`, and parenthesis)
|
|
8
|
+
* - at least 7 numeric characters, 8 if `+` character used
|
|
9
|
+
* - leading character (after whitespace) must be numeric, `(` or `+`
|
|
10
|
+
*
|
|
11
|
+
* **Related:** `asPhoneNumber()`, `PhoneNumber`
|
|
12
|
+
*/
|
|
13
|
+
export declare const isPhoneNumber: <T>(val: T) => val is T;
|
|
14
|
+
//# sourceMappingURL=isPhoneNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPhoneNumber.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isPhoneNumber.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,WAAY,CAAC,aAoBtC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { WHITESPACE_CHARS } from "../../constants/Characters.js";
|
|
2
|
+
import { NUMERIC_CHAR } from "../../constants/NumericChar.js";
|
|
3
|
+
import { isString, asChars, retainChars, stripChars } from "../index.js";
|
|
4
|
+
/**
|
|
5
|
+
* **isPhoneNumber**`(val)`
|
|
6
|
+
*
|
|
7
|
+
* Type guard which validates that a string is in the shape of a phone
|
|
8
|
+
* number.
|
|
9
|
+
*
|
|
10
|
+
* - Only valid characters (numeric, whitespace, `+`, `-`, `.`, and parenthesis)
|
|
11
|
+
* - at least 7 numeric characters, 8 if `+` character used
|
|
12
|
+
* - leading character (after whitespace) must be numeric, `(` or `+`
|
|
13
|
+
*
|
|
14
|
+
* **Related:** `asPhoneNumber()`, `PhoneNumber`
|
|
15
|
+
*/
|
|
16
|
+
export const isPhoneNumber = (val) => {
|
|
17
|
+
return (isString(val) &&
|
|
18
|
+
["+", "(", ...NUMERIC_CHAR].includes(asChars(val.trim())[0]) &&
|
|
19
|
+
[...NUMERIC_CHAR].includes([...asChars(val.trim())].pop()) &&
|
|
20
|
+
(val.trim().startsWith(`+`)
|
|
21
|
+
? asChars(retainChars(val, ...NUMERIC_CHAR)).length >= 8
|
|
22
|
+
: val.trim().startsWith("00")
|
|
23
|
+
? asChars(retainChars(val, ...NUMERIC_CHAR)).length >= 10
|
|
24
|
+
: asChars(retainChars(val, ...NUMERIC_CHAR)).length >= 7) &&
|
|
25
|
+
stripChars(val, ...NUMERIC_CHAR, ...WHITESPACE_CHARS, "(", ")", "+", ".", "-") === "");
|
|
26
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { isConstant } from "
|
|
2
|
-
import { isEqual } from "./higher-order/isEqual.js";
|
|
1
|
+
import { isConstant } from "../index.js";
|
|
3
2
|
/**
|
|
4
3
|
* **isSpecificConstant**(kind)
|
|
5
4
|
*
|
|
@@ -7,6 +6,6 @@ import { isEqual } from "./higher-order/isEqual.js";
|
|
|
7
6
|
*/
|
|
8
7
|
export function isSpecificConstant(kind) {
|
|
9
8
|
return (value) => {
|
|
10
|
-
return isConstant(value) &&
|
|
9
|
+
return isConstant(value) && value.kind === kind ? true : false;
|
|
11
10
|
};
|
|
12
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTrimmable.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isTrimmable.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,UAAU,WAAY,CAAC,aAEnC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Unset } from "../../types/index";
|
|
2
|
+
/**
|
|
3
|
+
* **isUnset**`(val)`
|
|
4
|
+
*
|
|
5
|
+
* Type guard which validates that the value passed in `Unset`.
|
|
6
|
+
*
|
|
7
|
+
* **Related:** `isSet()`
|
|
8
|
+
*/
|
|
9
|
+
export declare const isUnset: (val: unknown) => val is Unset;
|
|
10
|
+
/**
|
|
11
|
+
* **isSet**`(val)`
|
|
12
|
+
*
|
|
13
|
+
* Type guard which validates that the value passed in is **not** `Unset`.
|
|
14
|
+
*
|
|
15
|
+
* **Related:** `isUnset()`
|
|
16
|
+
*/
|
|
17
|
+
export declare const isSet: <T>(val: T) => val is Exclude<T, Unset>;
|
|
18
|
+
//# sourceMappingURL=isUnset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnset.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isUnset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,0BAAwB;AAGxC;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,QAAS,OAAO,iBAEnC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,WAAY,CAAC,6BAI9B,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isObject } from "./isObject.js";
|
|
2
|
+
/**
|
|
3
|
+
* **isUnset**`(val)`
|
|
4
|
+
*
|
|
5
|
+
* Type guard which validates that the value passed in `Unset`.
|
|
6
|
+
*
|
|
7
|
+
* **Related:** `isSet()`
|
|
8
|
+
*/
|
|
9
|
+
export const isUnset = (val) => {
|
|
10
|
+
return isObject(val) && val.kind === "Unset";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* **isSet**`(val)`
|
|
14
|
+
*
|
|
15
|
+
* Type guard which validates that the value passed in is **not** `Unset`.
|
|
16
|
+
*
|
|
17
|
+
* **Related:** `isUnset()`
|
|
18
|
+
*/
|
|
19
|
+
export const isSet = (val) => {
|
|
20
|
+
return isObject(val)
|
|
21
|
+
? val.kind !== "Unset" ? true : false
|
|
22
|
+
: true;
|
|
23
|
+
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { NetworkProtocol } from "../../types/
|
|
2
|
-
import { TupleToUnion } from "../../types/type-conversion";
|
|
3
|
-
import { Keys } from "../../types/index";
|
|
1
|
+
import { Keys, TupleToUnion, NetworkProtocol } from "../../types/index";
|
|
4
2
|
/**
|
|
5
3
|
* **isUri**`(val, ...protocols)`
|
|
6
4
|
*
|
|
@@ -23,5 +21,5 @@ export declare const isUri: <T, P extends readonly NetworkProtocol[]>(val: T, ..
|
|
|
23
21
|
*
|
|
24
22
|
* **Related:** `isUri`
|
|
25
23
|
*/
|
|
26
|
-
export declare const isUrl: <T, P extends readonly NetworkProtocol[]>(val: T, ...protocols: P) => val is T & `${Keys<P>["length"] extends 0 ? "
|
|
24
|
+
export declare const isUrl: <T, P extends readonly NetworkProtocol[]>(val: T, ...protocols: P) => val is T & `${Keys<P>["length"] extends 0 ? "https" | "http" : TupleToUnion<P>}://${string}`;
|
|
27
25
|
//# sourceMappingURL=isUrl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isUrl.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isUrl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isUrl.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/isUrl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAC,YAAY,EAAG,eAAe,EAAQ,0BAAwB;AAE5E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,iDAGX,CAAC,gBAAgB,CAAC,gGAUxB,CAAA;AAGD;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,iDAGX,CAAC,gBAAgB,CAAC,iGAUxB,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { isString } from "
|
|
2
|
-
import { NETWORK_PROTOCOL_LOOKUP } from "../../constants/
|
|
3
|
-
import { valuesOf } from "../dictionary/valuesOf.js";
|
|
1
|
+
import { isString, valuesOf } from "../index.js";
|
|
2
|
+
import { NETWORK_PROTOCOL_LOOKUP } from "../../constants/index.js";
|
|
4
3
|
/**
|
|
5
4
|
* **isUri**`(val, ...protocols)`
|
|
6
5
|
*
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DomainName, GetUrlProtocolPrefix, GetUrlSource } from "../../types/index";
|
|
2
|
+
import { AsString } from "../../types/type-conversion/AsString";
|
|
3
|
+
/**
|
|
4
|
+
* **isIp4Address**`(val)`
|
|
5
|
+
*
|
|
6
|
+
* Type guard which checks whether the value is a valid IPv4 address.
|
|
7
|
+
*/
|
|
8
|
+
export declare const isIp4Address: <T>(val: T) => val is T & `${number}.${number}.${number}.${number}`;
|
|
9
|
+
/**
|
|
10
|
+
* **isIp6Address**`(val)`
|
|
11
|
+
*
|
|
12
|
+
* Type guard which checks whether the value is a valid IPv6 address.
|
|
13
|
+
*/
|
|
14
|
+
export declare const isIp6Address: <T>(val: T) => val is T & (`0${string}:${string}` | `1${string}:${string}` | `2${string}:${string}` | `3${string}:${string}` | `4${string}:${string}` | `5${string}:${string}` | `6${string}:${string}` | `7${string}:${string}` | `8${string}:${string}` | `9${string}:${string}` | `A${string}:${string}` | `B${string}:${string}` | `C${string}:${string}` | `D${string}:${string}` | `E${string}:${string}` | `F${string}:${string}` | `a${string}:${string}` | `b${string}:${string}` | `c${string}:${string}` | `d${string}:${string}` | `e${string}:${string}` | `f${string}:${string}`);
|
|
15
|
+
/**
|
|
16
|
+
* **isIpAddress**`(val)`
|
|
17
|
+
*
|
|
18
|
+
* Type guard which checks whether the value is a valid IP address (v4 or v6).
|
|
19
|
+
*/
|
|
20
|
+
export declare const isIpAddress: <T>(val: T) => val is T & (`${number}.${number}.${number}.${number}` | `0${string}:${string}` | `1${string}:${string}` | `2${string}:${string}` | `3${string}:${string}` | `4${string}:${string}` | `5${string}:${string}` | `6${string}:${string}` | `7${string}:${string}` | `8${string}:${string}` | `9${string}:${string}` | `A${string}:${string}` | `B${string}:${string}` | `C${string}:${string}` | `D${string}:${string}` | `E${string}:${string}` | `F${string}:${string}` | `a${string}:${string}` | `b${string}:${string}` | `c${string}:${string}` | `d${string}:${string}` | `e${string}:${string}` | `f${string}:${string}`);
|
|
21
|
+
/**
|
|
22
|
+
* **hasUrlPort**`(val)`
|
|
23
|
+
*
|
|
24
|
+
* Type guard which tests whether there is an explicit _port_ reference
|
|
25
|
+
* in the passed in URL (versus implicitly using the default port of the
|
|
26
|
+
* protocol)
|
|
27
|
+
*/
|
|
28
|
+
export declare const hasUrlPort: <T>(val: T) => val is T & `${GetUrlProtocolPrefix<T>}${GetUrlSource<AsString<T>>}:${number}${string}`;
|
|
29
|
+
/**
|
|
30
|
+
* **isUrlPath**`(val)`
|
|
31
|
+
*
|
|
32
|
+
* Type guard which checks whether the value is a valid `UrlPath`
|
|
33
|
+
*/
|
|
34
|
+
export declare const isUrlPath: <T>(val: T) => val is T & ("" | `/.${string}` | `/-${string}` | `/_${string}` | `/0${string}` | `/1${string}` | `/2${string}` | `/3${string}` | `/4${string}` | `/5${string}` | `/6${string}` | `/7${string}` | `/8${string}` | `/9${string}` | `/A${string}` | `/B${string}` | `/C${string}` | `/D${string}` | `/E${string}` | `/F${string}` | `/G${string}` | `/H${string}` | `/I${string}` | `/J${string}` | `/K${string}` | `/L${string}` | `/M${string}` | `/N${string}` | `/O${string}` | `/P${string}` | `/Q${string}` | `/R${string}` | `/S${string}` | `/T${string}` | `/U${string}` | `/V${string}` | `/W${string}` | `/X${string}` | `/Y${string}` | `/Z${string}` | `/a${string}` | `/b${string}` | `/c${string}` | `/d${string}` | `/e${string}` | `/f${string}` | `/g${string}` | `/h${string}` | `/i${string}` | `/j${string}` | `/k${string}` | `/l${string}` | `/m${string}` | `/n${string}` | `/o${string}` | `/p${string}` | `/q${string}` | `/r${string}` | `/s${string}` | `/t${string}` | `/u${string}` | `/v${string}` | `/w${string}` | `/x${string}` | `/y${string}` | `/z${string}` | `/@${string}`);
|
|
35
|
+
/**
|
|
36
|
+
* **isDomainName**`(val)`
|
|
37
|
+
*
|
|
38
|
+
* Type guard which checks whether the value is a valid DNS domain name
|
|
39
|
+
*/
|
|
40
|
+
export declare const isDomainName: <T>(val: T) => val is T & DomainName<AsString<T>>;
|
|
41
|
+
/**
|
|
42
|
+
* **isUrlSource**`(val)`
|
|
43
|
+
*
|
|
44
|
+
* Type guard which checks whether the value is a valid URL source
|
|
45
|
+
* (aka, an IP address or a Domain Name)
|
|
46
|
+
*/
|
|
47
|
+
export declare const isUrlSource: <T>(val: T) => boolean;
|
|
48
|
+
/**
|
|
49
|
+
* **hasUrlQueryParameter**`(val,prop)`
|
|
50
|
+
*
|
|
51
|
+
* Tests whether the valued in has a query parameter specified by `prop`.
|
|
52
|
+
*/
|
|
53
|
+
export declare const hasUrlQueryParameter: <T, P extends string>(val: T, prop: P) => boolean;
|
|
54
|
+
//# sourceMappingURL=network-tg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-tg.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/network-tg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,YAAY,EAAwC,0BAAuB;AAKtH,OAAO,EAAE,QAAQ,EAAE,6CAA0C;AAQ7D;;;;GAIG;AACH,eAAO,MAAM,YAAY,WAAY,CAAC,yDAKrC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,WAAY,CAAC,qjBAOrC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,WAAY,CAAC,imBAEpC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,WAAY,CAAC,2FAEnC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,WAAY,CAAC,ojCAalC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,WAAY,CAAC,uCAQrC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,WAAY,CAAC,YAEpC,CAAA;AAGD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,6BAA6B,CAAC,QAAQ,CAAC,YAGvE,CAAA"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { asChars } from "../type-conversion/asChars.js";
|
|
2
|
+
import { isAlpha } from "./isAlpha.js";
|
|
3
|
+
import { isNumericString } from "./isNumericString.js";
|
|
4
|
+
import { isString } from "./isString.js";
|
|
5
|
+
import { ip6GroupExpansion } from "../type-conversion/index.js";
|
|
6
|
+
import { isHexadecimal } from "./isHexadecimal.js";
|
|
7
|
+
import { getUrlQueryParams, removeUrlProtocol } from "../meta/index.js";
|
|
8
|
+
/**
|
|
9
|
+
* **isIp4Address**`(val)`
|
|
10
|
+
*
|
|
11
|
+
* Type guard which checks whether the value is a valid IPv4 address.
|
|
12
|
+
*/
|
|
13
|
+
export const isIp4Address = (val) => {
|
|
14
|
+
return isString(val) &&
|
|
15
|
+
(val.split(".").length === 4) &&
|
|
16
|
+
(val.split(".").every(i => isNumericString(i))) &&
|
|
17
|
+
val.split(".").every(i => Number(i) >= 0 && Number(i) <= 255);
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* **isIp6Address**`(val)`
|
|
21
|
+
*
|
|
22
|
+
* Type guard which checks whether the value is a valid IPv6 address.
|
|
23
|
+
*/
|
|
24
|
+
export const isIp6Address = (val) => {
|
|
25
|
+
const expanded = isString(val)
|
|
26
|
+
? ip6GroupExpansion(val)
|
|
27
|
+
: "";
|
|
28
|
+
return isString(val) && isString(expanded) &&
|
|
29
|
+
(expanded.split(":").every(i => asChars(i).length >= 1 && asChars(i).length <= 4)) &&
|
|
30
|
+
expanded.split(":").every(i => isHexadecimal(i));
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* **isIpAddress**`(val)`
|
|
34
|
+
*
|
|
35
|
+
* Type guard which checks whether the value is a valid IP address (v4 or v6).
|
|
36
|
+
*/
|
|
37
|
+
export const isIpAddress = (val) => {
|
|
38
|
+
return isIp4Address(val) || isIp6Address(val);
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* **hasUrlPort**`(val)`
|
|
42
|
+
*
|
|
43
|
+
* Type guard which tests whether there is an explicit _port_ reference
|
|
44
|
+
* in the passed in URL (versus implicitly using the default port of the
|
|
45
|
+
* protocol)
|
|
46
|
+
*/
|
|
47
|
+
export const hasUrlPort = (val) => {
|
|
48
|
+
return isString(val) && asChars(removeUrlProtocol(val)).some(i => i === ":");
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* **isUrlPath**`(val)`
|
|
52
|
+
*
|
|
53
|
+
* Type guard which checks whether the value is a valid `UrlPath`
|
|
54
|
+
*/
|
|
55
|
+
export const isUrlPath = (val) => {
|
|
56
|
+
return isString(val) &&
|
|
57
|
+
(val === "" || val.startsWith("/")) &&
|
|
58
|
+
(asChars(val).every(c => isAlpha(c) ||
|
|
59
|
+
isNumericString(c) ||
|
|
60
|
+
c === "_" ||
|
|
61
|
+
c === "@" ||
|
|
62
|
+
c === "." ||
|
|
63
|
+
c === "-"));
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* **isDomainName**`(val)`
|
|
67
|
+
*
|
|
68
|
+
* Type guard which checks whether the value is a valid DNS domain name
|
|
69
|
+
*/
|
|
70
|
+
export const isDomainName = (val) => {
|
|
71
|
+
return isString(val) &&
|
|
72
|
+
val.split(".").filter(i => i).length > 1 &&
|
|
73
|
+
isString(val.split(".").filter(i => i).pop()) &&
|
|
74
|
+
asChars(val.split(".").filter(i => i).pop()).length > 1 &&
|
|
75
|
+
val.split(".").filter(i => i).every(i => isAlpha(i) || isNumericString(i) || i === "-" || i === "_");
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* **isUrlSource**`(val)`
|
|
79
|
+
*
|
|
80
|
+
* Type guard which checks whether the value is a valid URL source
|
|
81
|
+
* (aka, an IP address or a Domain Name)
|
|
82
|
+
*/
|
|
83
|
+
export const isUrlSource = (val) => {
|
|
84
|
+
return isDomainName(val) || isIpAddress(val);
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* **hasUrlQueryParameter**`(val,prop)`
|
|
88
|
+
*
|
|
89
|
+
* Tests whether the valued in has a query parameter specified by `prop`.
|
|
90
|
+
*/
|
|
91
|
+
export const hasUrlQueryParameter = (val, prop) => {
|
|
92
|
+
const re = new RegExp(`${prop}=`);
|
|
93
|
+
return isString(val) && re.test(getUrlQueryParams(val));
|
|
94
|
+
};
|