Skip to content

Commit

Permalink
feat: v3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine lanoe committed Feb 23, 2023
1 parent 0c22790 commit 0e59998
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/talkr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
- name: Install dependencies
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
cmd: install
- name: Build app
uses: borales/actions-yarn@v4
with:
cmd: build # will run `yarn build:prod` command
cmd: build
- name: Test app
uses: borales/actions-yarn@v4
with:
cmd: test # will run `yarn test` command
cmd: test
6 changes: 4 additions & 2 deletions dist/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ export interface TContext {
}
export type TrContext = Omit<TContext, "setLocale">;
type KeyPrefix<T extends string> = T extends "" ? "" : `.${T}`;
export type KeyPath<T> = (T extends object ? {
type Suffix = "zero" | "one" | "two" | "few" | "many" | "female" | "male";
type DynamicSuffix = Partial<Record<Suffix, string>>;
export type KeyPath<T> = (T extends DynamicSuffix ? "" : T extends object ? {
[K in Exclude<keyof T, symbol>]: `${K}${KeyPrefix<KeyPath<T[K]>>}`;
}[Exclude<keyof T, symbol>] : "") extends infer D ? Extract<D, string> : never;
export type TParams = {
count?: number;
[key: string]: any;
};
export type Autocomplete<schema> = KeyPath<schema> | (string & {});
export type Autocomplete<schema> = KeyPath<schema>;
export interface UseT extends TContext {
T: <Key extends string, Params extends TParams>(key: Key, params?: Params) => string;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "talkr",
"version": "3.3.9",
"version": "3.4.0",
"description": "Talkr is the lightest i18n provider for React applications. It supports Typescript, provides autocompletion, has 0 dependencies, and is very easy to use.",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down

0 comments on commit 0e59998

Please sign in to comment.