Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

international-types

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

international-types - npm Package Compare versions

Comparing version 0.5.3 to 0.6.0

9

dist/index.d.ts

@@ -20,2 +20,11 @@ export type LocaleValue = string | number | boolean | null | undefined | Date;

export type GetLocaleType<Locales extends ImportedLocales | ExplicitLocales> = Locales extends ImportedLocales ? Awaited<ReturnType<Locales[SomeKey<Locales>]>>['default'] : Locales[SomeKey<Locales>];
type Join<K, P> = K extends string | number ? P extends string | number ? `${K}${'' extends P ? '' : '.'}${P}` : never : never;
type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...0[]];
type Leaves<T, D extends number = 10> = [D] extends [never] ? never : T extends object ? {
[K in keyof T]-?: Join<K, Leaves<T[K], Prev[D]>>;
}[keyof T] : '';
type FollowPath<T, P> = P extends `${infer U}.${infer R}` ? U extends keyof T ? FollowPath<T[U], R> : never : P extends keyof T ? T[P] : never;
export type FlattenLocale<Locale extends Record<string, unknown>> = {
[K in Leaves<Locale>]: FollowPath<Locale, K>;
};
export {};

2

package.json
{
"name": "international-types",
"version": "0.5.3",
"version": "0.6.0",
"description": "Type-safe internationalization (i18n) utility types",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc