inferred-types 0.43.6 → 0.45.0
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/NetworkConstants.d.ts +29 -0
- package/dist/constants/NetworkConstants.d.ts.map +1 -0
- package/dist/constants/NetworkConstants.js +83 -0
- package/dist/constants/RepoConstants.d.ts +31 -0
- package/dist/constants/RepoConstants.d.ts.map +1 -0
- package/dist/constants/RepoConstants.js +48 -0
- package/dist/constants/index.d.ts +2 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -1
- package/dist/constants/tsconfig.tsbuildinfo +1 -1
- package/dist/inferred-types/index.cjs +646 -312
- package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/dictionary/valuesOf.d.ts +1 -1
- package/dist/runtime/dictionary/valuesOf.d.ts.map +1 -1
- package/dist/runtime/dictionary/withKeys.d.ts +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/literals/index.d.ts +1 -0
- package/dist/runtime/literals/index.d.ts.map +1 -1
- package/dist/runtime/literals/index.js +1 -0
- 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/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 +31 -0
- package/dist/runtime/meta/youtube-meta.d.ts.map +1 -0
- package/dist/runtime/meta/youtube-meta.js +19 -0
- 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/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/index.d.ts +4 -0
- package/dist/runtime/type-guards/index.d.ts.map +1 -1
- package/dist/runtime/type-guards/index.js +4 -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/isUrl.d.ts +20 -4
- package/dist/runtime/type-guards/isUrl.d.ts.map +1 -1
- package/dist/runtime/type-guards/isUrl.js +29 -9
- package/dist/runtime/type-guards/network-tg.d.ts +48 -0
- package/dist/runtime/type-guards/network-tg.d.ts.map +1 -0
- package/dist/runtime/type-guards/network-tg.js +85 -0
- package/dist/runtime/type-guards/repos.d.ts +45 -0
- package/dist/runtime/type-guards/repos.d.ts.map +1 -0
- package/dist/runtime/type-guards/repos.js +77 -0
- package/dist/runtime/type-guards/youtube.d.ts +42 -0
- package/dist/runtime/type-guards/youtube.d.ts.map +1 -0
- package/dist/runtime/type-guards/youtube.js +74 -0
- package/dist/types/{numeric-literals/ValueCallback.d.ts → api/api.d.ts} +1 -1
- package/dist/types/api/api.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/index.d.ts.map +1 -0
- package/dist/types/api/index.js +1 -0
- package/dist/types/boolean-logic/branching/OnPass.d.ts +29 -0
- package/dist/types/boolean-logic/branching/OnPass.d.ts.map +1 -0
- package/dist/types/boolean-logic/branching/index.d.ts +1 -0
- package/dist/types/boolean-logic/branching/index.d.ts.map +1 -1
- package/dist/types/boolean-logic/branching/index.js +1 -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/Not.d.ts +5 -6
- package/dist/types/boolean-logic/combinators/Not.d.ts.map +1 -1
- 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/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/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/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/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 +4 -1
- package/dist/types/boolean-logic/operators/index.d.ts.map +1 -1
- package/dist/types/boolean-logic/operators/index.js +4 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/literals/ExpandRecursively.d.ts +7 -1
- package/dist/types/literals/ExpandRecursively.d.ts.map +1 -1
- package/dist/types/literals/Shape.d.ts +1 -1
- package/dist/types/literals/Shape.d.ts.map +1 -1
- package/dist/types/numeric-literals/index.d.ts +0 -1
- package/dist/types/numeric-literals/index.d.ts.map +1 -1
- package/dist/types/numeric-literals/index.js +0 -1
- 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/StripUntil.d.ts +6 -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 +26 -18
- package/dist/types/string-literals/character-sets/DomainName.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/InlineSvg.d.ts +2 -2
- package/dist/types/string-literals/character-sets/InlineSvg.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 +108 -0
- package/dist/types/string-literals/character-sets/Repos.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/Repos.js +1 -0
- package/dist/types/string-literals/character-sets/Url.d.ts +208 -6
- 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/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 +4 -0
- package/dist/types/string-literals/character-sets/index.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/index.js +4 -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/MergeObjects.d.ts.map +1 -1
- package/dist/types/type-conversion/RetainChars.d.ts +15 -0
- package/dist/types/type-conversion/RetainChars.d.ts.map +1 -0
- package/dist/types/type-conversion/RetainChars.js +1 -0
- package/dist/types/type-conversion/StripChars.d.ts +18 -0
- package/dist/types/type-conversion/StripChars.d.ts.map +1 -0
- package/dist/types/type-conversion/StripChars.js +1 -0
- package/dist/types/type-conversion/index.d.ts +2 -0
- package/dist/types/type-conversion/index.d.ts.map +1 -1
- package/dist/types/type-conversion/index.js +2 -0
- package/package.json +9 -9
- package/dist/constants/TCP_IP.d.ts +0 -11
- package/dist/constants/TCP_IP.d.ts.map +0 -1
- package/dist/constants/TCP_IP.js +0 -10
- 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/numeric-literals/ValueCallback.d.ts.map +0 -1
- /package/dist/types/{boolean-logic/operators/IsHexadecimal.js → api/api.js} +0 -0
- /package/dist/types/{numeric-literals/ValueCallback.js → boolean-logic/branching/OnPass.js} +0 -0
|
@@ -6,5 +6,5 @@ import { AsRecord, Narrowable, ObjectKey, Values } from "../../types/index";
|
|
|
6
6
|
* values while preserving as much type information as
|
|
7
7
|
* possible.
|
|
8
8
|
*/
|
|
9
|
-
export declare const valuesOf: <TObj extends
|
|
9
|
+
export declare const valuesOf: <TObj extends Record<ObjectKey, N>, N extends Narrowable>(obj: TObj) => Values<AsRecord<TObj>>;
|
|
10
10
|
//# sourceMappingURL=valuesOf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valuesOf.d.ts","sourceRoot":"","sources":["../../../src/runtime/dictionary/valuesOf.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAG,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,0BAAwB;AAE3E;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"valuesOf.d.ts","sourceRoot":"","sources":["../../../src/runtime/dictionary/valuesOf.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAG,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,0BAAwB;AAE3E;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,iEAGd,IAAI,KAAG,OAAO,SAAS,IAAI,CAAC,CAOlC,CAAA"}
|
|
@@ -7,7 +7,7 @@ import type { Dictionary, Narrowable, ObjectKey } from "../../types/index";
|
|
|
7
7
|
*
|
|
8
8
|
* - note: this function is an alias for `retain()`
|
|
9
9
|
*/
|
|
10
|
-
export declare const withKeys: <TObj extends Dictionary<string | symbol, N>, N extends Narrowable, TKeys extends readonly (ObjectKey & keyof TObj)[]>(dict: TObj, ...keys: TKeys) => ([] extends [...TKeys] ? false : (import("../../types/index").IsEqual<import("../../types/index").First<[...TKeys], never>, boolean, true, false> extends true ? false : import("../../types/index").UnionToTuple<import("../../types/index").First<[...TKeys], never>, import("../../types/index").LastInUnion<import("../../types/index").First<[...TKeys], never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<[...TKeys]> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<[...TKeys]>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<[...TKeys]>, never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>, never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>, never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>, never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>, never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>, never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>, never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>, never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>>, never>>>["length"] extends 1 ? false : true) extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>>> ? false : (import("../../types/index").UnionToTuple<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>>>, never>, import("../../types/index").LastInUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>>>, never>>>["length"] extends 1 ? false : true) extends true ? true : any) extends true ? {
|
|
10
|
+
export declare const withKeys: <TObj extends Dictionary<string | symbol, N>, N extends Narrowable, TKeys extends readonly (ObjectKey & keyof TObj)[]>(dict: TObj, ...keys: TKeys) => ([] extends [...TKeys] ? false : import("../../types/index").IsUnion<import("../../types/index").First<[...TKeys], never>> extends true ? true : [] extends import("../../types/index").AfterFirst<[...TKeys]> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<[...TKeys]>, never>> extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>, never>> extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>, never>> extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>, never>> extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>, never>> extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>, never>> extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>, never>> extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>, never>> extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>>, never>> extends true ? true : [] extends import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>>> ? false : import("../../types/index").IsUnion<import("../../types/index").First<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<import("../../types/index").AfterFirst<[...TKeys]>>>>>>>>>>, never>> extends true ? true : any) extends true ? {
|
|
11
11
|
kind: "invalid-union";
|
|
12
12
|
msg: "the retain(obj, keys) function was called with keys which included a value which was a union type; this would make the typing inconsistent with the runtime type and should be avoided. Note that at runtime this will not produce an error but rather produce the valid runtime value.";
|
|
13
13
|
utility: "retain()";
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./functions/index";
|
|
|
7
7
|
export * from "./initializers/index";
|
|
8
8
|
export * from "./lists/index";
|
|
9
9
|
export * from "./literals/index";
|
|
10
|
+
export * from "./meta/index";
|
|
10
11
|
export * from "./runtime-types/index";
|
|
11
12
|
export * from "./sets/index";
|
|
12
13
|
export * from "./type-conversion/index";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AASA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AASA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAA"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./functions/index.js";
|
|
|
13
13
|
export * from "./initializers/index.js";
|
|
14
14
|
export * from "./lists/index.js";
|
|
15
15
|
export * from "./literals/index.js";
|
|
16
|
+
export * from "./meta/index.js";
|
|
16
17
|
export * from "./runtime-types/index.js";
|
|
17
18
|
export * from "./sets/index.js";
|
|
18
19
|
export * from "./type-conversion/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/index.ts"],"names":[],"mappings":"AAMA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/index.ts"],"names":[],"mappings":"AAMA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC"}
|
|
@@ -36,6 +36,7 @@ export * from "./toPascalCase.js";
|
|
|
36
36
|
export * from "./toUppercase.js";
|
|
37
37
|
export * from "./toNumericArray.js";
|
|
38
38
|
export * from "./truncate.js";
|
|
39
|
+
export * from "./takeNumericCharacters.js";
|
|
39
40
|
// #endregion auto-indexed files
|
|
40
41
|
// see https://github.com/inocan-group/do-devops/docs/autoindex.md
|
|
41
42
|
// for more info
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RetainWhile } from "../../types/string-literals";
|
|
2
|
+
/**
|
|
3
|
+
* **takeNumericCharacters**`(content)`
|
|
4
|
+
*
|
|
5
|
+
* Starts at the passed in content and extracts all numeric characters
|
|
6
|
+
* in the string until a non-numeric value arrives.
|
|
7
|
+
*/
|
|
8
|
+
export declare const takeNumericCharacters: <T extends string>(content: T) => RetainWhile<T, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
|
|
9
|
+
//# sourceMappingURL=takeNumericCharacters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"takeNumericCharacters.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/takeNumericCharacters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,WAAW,EAAE,oCAAkC;AAGrE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,8BAA+B,CAAC,8EAIjE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NUMERIC_CHAR } from "../../constants/NumericChar.js";
|
|
2
|
+
import { asChars } from "../index.js";
|
|
3
|
+
/**
|
|
4
|
+
* **takeNumericCharacters**`(content)`
|
|
5
|
+
*
|
|
6
|
+
* Starts at the passed in content and extracts all numeric characters
|
|
7
|
+
* in the string until a non-numeric value arrives.
|
|
8
|
+
*/
|
|
9
|
+
export const takeNumericCharacters = (content) => {
|
|
10
|
+
let nonNumericIdx = asChars(content).findIndex(i => !NUMERIC_CHAR.includes(i));
|
|
11
|
+
return content.slice(0, nonNumericIdx);
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/meta/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IsUrl, GetUrlProtocol, GetUrlSource, GetUrlPath, GetUrlQueryParams, GetUrlPort, IsIpAddress, IsIp4Address, IsIp6Address } from "../../types/index";
|
|
2
|
+
export type UrlMeta<T> = {
|
|
3
|
+
/** the URL passed in */
|
|
4
|
+
url: T;
|
|
5
|
+
/** boolean flag indicating whether the value passed in is considered a valid URL */
|
|
6
|
+
isUrl: IsUrl<T>;
|
|
7
|
+
/** the `NetworkProtocol` used in the URL */
|
|
8
|
+
protocol: GetUrlProtocol<T>;
|
|
9
|
+
path: T extends string ? GetUrlPath<T> : never;
|
|
10
|
+
queryParams: T extends string ? GetUrlQueryParams<T> : never;
|
|
11
|
+
/** the port number -- when stated explicitly -- or "default" */
|
|
12
|
+
port: GetUrlPort<T>;
|
|
13
|
+
/** either the domain name or the IP address */
|
|
14
|
+
source: T extends string ? GetUrlSource<T> : never;
|
|
15
|
+
/**
|
|
16
|
+
* Boolean flag which indicates that the _source_ is an IP address (vs. Domain Name)
|
|
17
|
+
*/
|
|
18
|
+
isIpAddress: IsIpAddress<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Boolean flag indicating the _source_ is a IPv4 IP address
|
|
21
|
+
*/
|
|
22
|
+
isIpV4Address: IsIp4Address<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Boolean flag indicating the _source_ is a IPv6 IP address
|
|
25
|
+
*/
|
|
26
|
+
isIpV6Address: IsIp6Address<T>;
|
|
27
|
+
};
|
|
28
|
+
export declare const getUrlProtocol: <T extends string>(url: T) => GetUrlProtocol<T>;
|
|
29
|
+
export declare const removeUrlProtocol: <T extends string>(url: T) => import("../../types/index").StripBefore<T, "://">;
|
|
30
|
+
export declare const getUrlPath: <T extends string>(url: T) => GetUrlPath<T>;
|
|
31
|
+
export declare const getUrlQueryParams: <T extends string>(url: T) => GetUrlQueryParams<T>;
|
|
32
|
+
export declare const getUrlPort: <T extends string>(url: T) => number | "default";
|
|
33
|
+
export declare const getUrlSource: <T extends string>(url: T) => GetUrlSource<T>;
|
|
34
|
+
/**
|
|
35
|
+
* **urlMeta**`(url)`
|
|
36
|
+
*
|
|
37
|
+
* Analyzes the string passed in and provides a small dictionary of
|
|
38
|
+
* metadata properties about the URL.
|
|
39
|
+
*/
|
|
40
|
+
export declare const urlMeta: <T extends string>(url: T) => {
|
|
41
|
+
url: T;
|
|
42
|
+
isUrl: IsUrl<T>;
|
|
43
|
+
protocol: GetUrlProtocol<T>;
|
|
44
|
+
path: GetUrlPath<T>;
|
|
45
|
+
queryParameters: GetUrlQueryParams<T>;
|
|
46
|
+
port: GetUrlPort<T>;
|
|
47
|
+
source: GetUrlSource<T>;
|
|
48
|
+
isIpAddress: IsIpAddress<GetUrlSource<T>>;
|
|
49
|
+
isIp4Address: IsIp4Address<GetUrlSource<T>>;
|
|
50
|
+
isIp6Address: IsIp6Address<GetUrlSource<T>>;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=urlMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlMeta.d.ts","sourceRoot":"","sources":["../../../src/runtime/meta/urlMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,cAAc,EACd,YAAY,EACZ,UAAU,EACV,iBAAiB,EAEjB,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACb,0BAAwB;AAiBzB,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IACvB,wBAAwB;IACxB,GAAG,EAAE,CAAC,CAAC;IACP,oFAAoF;IACpF,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChB,4CAA4C;IAC5C,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,EAAE,CAAC,SAAS,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAC/C,WAAW,EAAE,CAAC,SAAS,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAC7D,gEAAgE;IAChE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAGpB,+CAA+C;IAC/C,MAAM,EAAE,CAAC,SAAS,MAAM,GACpB,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC;IACV;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5B;;OAEG;IACH,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAE/B;;OAEG;IACH,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CAChC,CAAA;AAKD,eAAO,MAAM,cAAc,0BAGpB,CAAC,sBAKP,CAAA;AAED,eAAO,MAAM,iBAAiB,0BAA2B,CAAC,sDAEzD,CAAA;AAMD,eAAO,MAAM,UAAU,0BAGhB,CAAC,kBAQP,CAAA;AAED,eAAO,MAAM,iBAAiB,0BAGvB,CAAC,yBASP,CAAA;AAED,eAAO,MAAM,UAAU,0BAGhB,CAAC,uBAUP,CAAA;AAED,eAAO,MAAM,YAAY,0BAGlB,CAAC,oBASP,CAAA;AAGD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,0BAEb,CAAC;;;;;;;;;;;CAcP,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { isUrl, isIp4Address, isIp6Address, isIpAddress, stripAfter, stripBefore, ensureLeading, stripTrailing, isDomainName, takeNumericCharacters, } from "../index.js";
|
|
2
|
+
import { NETWORK_PROTOCOL_LOOKUP } from "../../constants/NetworkConstants.js";
|
|
3
|
+
import { Never } from "../../constants/Never.js";
|
|
4
|
+
const PROTOCOLS = Object.values(NETWORK_PROTOCOL_LOOKUP).flat().filter(i => i !== "");
|
|
5
|
+
export const getUrlProtocol = (url) => {
|
|
6
|
+
const proto = PROTOCOLS.find(p => url.startsWith(`${p}://`));
|
|
7
|
+
return proto;
|
|
8
|
+
};
|
|
9
|
+
export const removeUrlProtocol = (url) => {
|
|
10
|
+
return stripBefore(url, "://");
|
|
11
|
+
};
|
|
12
|
+
const ensurePath = (val) => val === ""
|
|
13
|
+
? ""
|
|
14
|
+
: stripTrailing(ensureLeading(val, "/"), "/");
|
|
15
|
+
export const getUrlPath = (url) => {
|
|
16
|
+
return isUrl(url)
|
|
17
|
+
? ensurePath(stripAfter(stripBefore(removeUrlProtocol(url), "/"), "?"))
|
|
18
|
+
: Never;
|
|
19
|
+
};
|
|
20
|
+
export const getUrlQueryParams = (url) => {
|
|
21
|
+
const qp = stripBefore(url, "?");
|
|
22
|
+
return (qp === ""
|
|
23
|
+
? qp
|
|
24
|
+
: `?${qp}`);
|
|
25
|
+
};
|
|
26
|
+
export const getUrlPort = (url) => {
|
|
27
|
+
const candidate = takeNumericCharacters(stripBefore(removeUrlProtocol(url), ":"));
|
|
28
|
+
return (candidate === ""
|
|
29
|
+
? "default"
|
|
30
|
+
: Number(candidate));
|
|
31
|
+
};
|
|
32
|
+
export const getUrlSource = (url) => {
|
|
33
|
+
const candidate = stripAfter(stripAfter(stripAfter(removeUrlProtocol(url), "/"), "?"), ":");
|
|
34
|
+
return (isIpAddress(candidate) || isDomainName(candidate)
|
|
35
|
+
? candidate
|
|
36
|
+
: Never);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* **urlMeta**`(url)`
|
|
40
|
+
*
|
|
41
|
+
* Analyzes the string passed in and provides a small dictionary of
|
|
42
|
+
* metadata properties about the URL.
|
|
43
|
+
*/
|
|
44
|
+
export const urlMeta = (url) => {
|
|
45
|
+
return {
|
|
46
|
+
url,
|
|
47
|
+
isUrl: isUrl(url),
|
|
48
|
+
protocol: getUrlProtocol(url),
|
|
49
|
+
path: getUrlPath(url),
|
|
50
|
+
queryParameters: getUrlQueryParams(url),
|
|
51
|
+
port: getUrlPort(url),
|
|
52
|
+
source: getUrlSource(url),
|
|
53
|
+
isIpAddress: isIpAddress(getUrlSource(url)),
|
|
54
|
+
isIp4Address: isIp4Address(getUrlSource(url)),
|
|
55
|
+
isIp6Address: isIp6Address(getUrlSource(url)),
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { As, GetYouTubePageType, YouTubePageType, YouTubeShareUrl, YouTubeUrl } from "../../types/index";
|
|
2
|
+
/**
|
|
3
|
+
* **YouTubeMeta**`<T>`
|
|
4
|
+
*
|
|
5
|
+
* Provides metadata about YouTube related URLs.
|
|
6
|
+
*/
|
|
7
|
+
export type YouTubeMeta<T extends string> = {
|
|
8
|
+
/**
|
|
9
|
+
* The URL passed in
|
|
10
|
+
*/
|
|
11
|
+
url: T;
|
|
12
|
+
/**
|
|
13
|
+
* boolean flag indicating whether the URL is a valid
|
|
14
|
+
* YouTube URL.
|
|
15
|
+
*/
|
|
16
|
+
isYouTubeUrl: T extends YouTubeUrl ? true : false;
|
|
17
|
+
/**
|
|
18
|
+
* boolean flag indicating whether URL is part of YouTube's `https://youtu.be`
|
|
19
|
+
* URL shortener used when _sharing_ videos.
|
|
20
|
+
*/
|
|
21
|
+
isShareUrl: T extends YouTubeShareUrl ? true : false;
|
|
22
|
+
pageType: As<GetYouTubePageType<T>, YouTubePageType>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* **youtube**`(url)`
|
|
26
|
+
*
|
|
27
|
+
* Takes a YouTube URL and converts it to a meta-data object
|
|
28
|
+
* that helps describe the intent of the URL.
|
|
29
|
+
*/
|
|
30
|
+
export declare const youtube: <T extends string>(url: T) => YouTubeMeta<T>;
|
|
31
|
+
//# sourceMappingURL=youtube-meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"youtube-meta.d.ts","sourceRoot":"","sources":["../../../src/runtime/meta/youtube-meta.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EACF,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,UAAU,EACX,0BAAwB;AAOzB;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,IAAI;IAC1C;;OAEG;IACH,GAAG,EAAE,CAAC,CAAC;IACP;;;OAGG;IACH,YAAY,EAAE,CAAC,SAAS,UAAU,GAAG,IAAI,GAAG,KAAK,CAAC;IAElD;;;SAGK;IACL,UAAU,EAAE,CAAC,SAAS,eAAe,GAAG,IAAI,GAAG,KAAK,CAAC;IAErD,QAAQ,EAAE,EAAE,CACV,kBAAkB,CAAC,CAAC,CAAC,EACrB,eAAe,CAChB,CAAA;CACF,CAAC;AAGF;;;;;GAKG;AACH,eAAO,MAAM,OAAO,0BAA2B,CAAC,KAAG,YAAY,CAAC,CAc/D,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isYouTubeShareUrl, isYouTubeUrl } from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* **youtube**`(url)`
|
|
4
|
+
*
|
|
5
|
+
* Takes a YouTube URL and converts it to a meta-data object
|
|
6
|
+
* that helps describe the intent of the URL.
|
|
7
|
+
*/
|
|
8
|
+
export const youtube = (url) => {
|
|
9
|
+
return (isYouTubeUrl(url)
|
|
10
|
+
? {
|
|
11
|
+
url,
|
|
12
|
+
isYouTubeUrl: true,
|
|
13
|
+
isShareUrl: isYouTubeShareUrl(url),
|
|
14
|
+
}
|
|
15
|
+
: {
|
|
16
|
+
url,
|
|
17
|
+
isYouTubeUrl: false
|
|
18
|
+
});
|
|
19
|
+
};
|
|
@@ -15,7 +15,7 @@ export type ParsedToken<TType> = {
|
|
|
15
15
|
export declare const parse: <T>(value: T) => {
|
|
16
16
|
isToken: boolean;
|
|
17
17
|
type: T;
|
|
18
|
-
token: (T & `<<string${string}>>`) | (T & `<<number${string}>>`) | (T & `<<boolean${string}>>`) | (T & `<<undefined${string}>>`) | (T & `<<map${string}>>`) | (T & `<<set${string}>>`) | (T & `<<
|
|
18
|
+
token: (T & `<<string${string}>>`) | (T & `<<number${string}>>`) | (T & `<<boolean${string}>>`) | (T & `<<undefined${string}>>`) | (T & `<<map${string}>>`) | (T & `<<set${string}>>`) | (T & `<<null${string}>>`) | (T & `<<true${string}>>`) | (T & `<<false${string}>>`) | (T & `<<rec${string}>>`) | (T & `<<arr${string}>>`) | (T & `<<union${string}>>`) | (T & `<<obj${string}>>`) | (T & `<<tuple${string}>>`) | (T & `<<fn${string}>>`) | (T & `<<gen${string}>>`) | (T & `<<string-set${string}>>`) | (T & `<<numeric-set${string}>>`) | (T & `<<union-set${string}>>`);
|
|
19
19
|
tokenName: string;
|
|
20
20
|
tokenData: string[];
|
|
21
21
|
} | {
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* Given a `Shape` token, this function will extract the
|
|
5
5
|
* data parameters from the token.
|
|
6
6
|
*/
|
|
7
|
-
export declare const getTokenData: <T extends `<<string${string}>>` | `<<number${string}>>` | `<<boolean${string}>>` | `<<undefined${string}>>` | `<<map${string}>>` | `<<set${string}>>` | `<<
|
|
7
|
+
export declare const getTokenData: <T extends `<<string${string}>>` | `<<number${string}>>` | `<<boolean${string}>>` | `<<undefined${string}>>` | `<<map${string}>>` | `<<set${string}>>` | `<<null${string}>>` | `<<true${string}>>` | `<<false${string}>>` | `<<rec${string}>>` | `<<arr${string}>>` | `<<union${string}>>` | `<<obj${string}>>` | `<<tuple${string}>>` | `<<fn${string}>>` | `<<gen${string}>>` | `<<string-set${string}>>` | `<<numeric-set${string}>>` | `<<union-set${string}>>`>(token: T) => string[];
|
|
8
8
|
//# sourceMappingURL=getTokenData.d.ts.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Given a `Shape` token, this function will extract the
|
|
5
5
|
*/
|
|
6
|
-
export declare const getTokenName: <T extends `<<string${string}>>` | `<<number${string}>>` | `<<boolean${string}>>` | `<<undefined${string}>>` | `<<map${string}>>` | `<<set${string}>>` | `<<
|
|
6
|
+
export declare const getTokenName: <T extends `<<string${string}>>` | `<<number${string}>>` | `<<boolean${string}>>` | `<<undefined${string}>>` | `<<map${string}>>` | `<<set${string}>>` | `<<null${string}>>` | `<<true${string}>>` | `<<false${string}>>` | `<<rec${string}>>` | `<<arr${string}>>` | `<<union${string}>>` | `<<obj${string}>>` | `<<tuple${string}>>` | `<<fn${string}>>` | `<<gen${string}>>` | `<<string-set${string}>>` | `<<numeric-set${string}>>` | `<<union-set${string}>>`>(token: T) => string;
|
|
7
7
|
//# sourceMappingURL=getTokenName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singletons.d.ts","sourceRoot":"","sources":["../../../../src/runtime/runtime-types/shape-helpers/singletons.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"singletons.d.ts","sourceRoot":"","sources":["../../../../src/runtime/runtime-types/shape-helpers/singletons.ts"],"names":[],"mappings":"AAAC,OAAO,EAMN,oBAAoB,EAGpB,YAAY,EAKb,6BAAwB;AAmEzB,eAAO,MAAM,MAAM,wJAAoC,CAAC;AACxD,eAAO,MAAM,MAAM,kIAAyB,CAAC"}
|
|
@@ -10,7 +10,7 @@ const addSingleton = (token, api) => (...literals) => {
|
|
|
10
10
|
: literals.length === 1
|
|
11
11
|
? addToken(token, literals[0])
|
|
12
12
|
: addToken("union", literals
|
|
13
|
-
.map(l => addToken(token, `${l}`))
|
|
13
|
+
.map((l) => addToken(token, `${l}`))
|
|
14
14
|
.join(",")));
|
|
15
15
|
};
|
|
16
16
|
const stringApi = ({
|
|
@@ -14,5 +14,5 @@ export declare const shape: <T extends ShapeCallback>(cb: T) => HandleDoneFn<Ret
|
|
|
14
14
|
*
|
|
15
15
|
* Type guard which tests whether a value is a _type_ defined by a `Shape`.
|
|
16
16
|
*/
|
|
17
|
-
export declare const isShape: (v: unknown) => v is `<<string${string}>>` | `<<number${string}>>` | `<<boolean${string}>>` | `<<undefined${string}>>` | `<<map${string}>>` | `<<set${string}>>` | `<<
|
|
17
|
+
export declare const isShape: (v: unknown) => v is `<<string${string}>>` | `<<number${string}>>` | `<<boolean${string}>>` | `<<undefined${string}>>` | `<<map${string}>>` | `<<set${string}>>` | `<<null${string}>>` | `<<true${string}>>` | `<<false${string}>>` | `<<rec${string}>>` | `<<arr${string}>>` | `<<union${string}>>` | `<<obj${string}>>` | `<<tuple${string}>>` | `<<fn${string}>>` | `<<gen${string}>>` | `<<string-set${string}>>` | `<<numeric-set${string}>>` | `<<union-set${string}>>`;
|
|
18
18
|
//# sourceMappingURL=shape.d.ts.map
|