inferred-types 0.50.4 → 0.50.6

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.
Files changed (28) hide show
  1. package/dist/constants/ISO3166.d.ts +1001 -0
  2. package/dist/constants/ISO3166.d.ts.map +1 -0
  3. package/dist/constants/ISO3166.js +6 -0
  4. package/dist/constants/index.d.ts +1 -0
  5. package/dist/constants/index.d.ts.map +1 -1
  6. package/dist/constants/index.js +1 -0
  7. package/dist/constants/tsconfig.tsbuildinfo +1 -1
  8. package/dist/index.cjs +263 -0
  9. package/dist/index.js +261 -0
  10. package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
  11. package/dist/runtime/tsconfig.tsbuildinfo +1 -1
  12. package/dist/runtime/type-guards/countries/index.d.ts +2 -0
  13. package/dist/runtime/type-guards/countries/index.d.ts.map +1 -0
  14. package/dist/runtime/type-guards/countries/index.js +1 -0
  15. package/dist/runtime/type-guards/countries/isIso3166Alpha2.d.ts +7 -0
  16. package/dist/runtime/type-guards/countries/isIso3166Alpha2.d.ts.map +1 -0
  17. package/dist/runtime/type-guards/countries/isIso3166Alpha2.js +10 -0
  18. package/dist/runtime/type-guards/index.d.ts +1 -0
  19. package/dist/runtime/type-guards/index.d.ts.map +1 -1
  20. package/dist/runtime/type-guards/index.js +1 -0
  21. package/dist/types/string-literals/character-sets/Country.d.ts +20 -0
  22. package/dist/types/string-literals/character-sets/Country.d.ts.map +1 -0
  23. package/dist/types/string-literals/character-sets/Country.js +1 -0
  24. package/dist/types/string-literals/character-sets/index.d.ts +1 -0
  25. package/dist/types/string-literals/character-sets/index.d.ts.map +1 -1
  26. package/dist/types/string-literals/character-sets/index.js +1 -0
  27. package/dist/types/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export * from "./isIso3166Alpha2";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/countries/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from "./isIso3166Alpha2";
@@ -0,0 +1,7 @@
1
+ import { Iso3166_1 } from "src/types/index";
2
+ /**
3
+ * Type guard which checks whether `val` is a 2 character country
4
+ * representation found in the ISO3166-1 standard.
5
+ */
6
+ export declare const isIso3166Alpha2: (val: unknown) => val is Iso3166_1;
7
+ //# sourceMappingURL=isIso3166Alpha2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isIso3166Alpha2.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/countries/isIso3166Alpha2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAS,OAAO,KAAG,GAAG,IAAI,SAGrD,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { isString } from "../isString";
2
+ import { ISO3166_1 } from "src/constants/ISO3166";
3
+ /**
4
+ * Type guard which checks whether `val` is a 2 character country
5
+ * representation found in the ISO3166-1 standard.
6
+ */
7
+ export const isIso3166Alpha2 = (val) => {
8
+ const codes = ISO3166_1.map(i => i["alpha-2"]);
9
+ return isString(val) && codes.includes(val);
10
+ };
@@ -55,4 +55,5 @@ export * from "./tokens/index";
55
55
  export * from "./higher-order/index";
56
56
  export * from "./tokens/index";
57
57
  export * from "./html/index";
58
+ export * from "./countries/index";
58
59
  //# 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,CAA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AiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
@@ -55,3 +55,4 @@ export * from "./tokens/index";
55
55
  export * from "./higher-order/index";
56
56
  export * from "./tokens/index";
57
57
  export * from "./html/index";
58
+ export * from "./countries/index";
@@ -0,0 +1,20 @@
1
+ import { ISO3166_1 } from "src/constants/index";
2
+ export type Iso3166_1_Lookup = typeof ISO3166_1;
3
+ /**
4
+ * **Iso3166_1**
5
+ *
6
+ * A union of all 2 character country codes defined by the ISO3166-1
7
+ * standard.
8
+ */
9
+ export type Iso3166_1 = {
10
+ [K in keyof Iso3166_1_Lookup]: "alpha-2" extends keyof Iso3166_1_Lookup[K] ? Iso3166_1_Lookup[K]["alpha-2"] : never;
11
+ }[number];
12
+ /**
13
+ * **CountryName**
14
+ *
15
+ * A union of all country names found in the ISO3166-1 standard.
16
+ */
17
+ export type CountryName = {
18
+ [K in keyof Iso3166_1_Lookup]: "name" extends keyof Iso3166_1_Lookup[K] ? Iso3166_1_Lookup[K]["name"] : never;
19
+ }[number];
20
+ //# sourceMappingURL=Country.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Country.d.ts","sourceRoot":"","sources":["../../../../src/types/string-literals/character-sets/Country.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG;KACrB,CAAC,IAAI,MAAM,gBAAgB,GAAG,SAAS,SAAS,MAAM,gBAAgB,CAAC,CAAC,CAAC,GACtE,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAC9B,KAAK;CACV,CAAC,MAAM,CAAC,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;KACvB,CAAC,IAAI,MAAM,gBAAgB,GAAG,MAAM,SAAS,MAAM,gBAAgB,CAAC,CAAC,CAAC,GACnE,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAC3B,KAAK;CACV,CAAC,MAAM,CAAC,CAAC"}
@@ -30,6 +30,7 @@ export * from "./Optional";
30
30
  export * from "./YouTube";
31
31
  export * from "./Github";
32
32
  export * from "./retail-urls";
33
+ export * from "./Country";
33
34
  export * from "./brackets/index";
34
35
  export * from "./quotation-marks/index";
35
36
  export * from "./phone/index";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/string-literals/character-sets/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB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CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAE1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
@@ -30,6 +30,7 @@ export * from "./Optional";
30
30
  export * from "./YouTube";
31
31
  export * from "./Github";
32
32
  export * from "./retail-urls";
33
+ export * from "./Country";
33
34
  export * from "./brackets/index";
34
35
  export * from "./quotation-marks/index";
35
36
  export * from "./phone/index";