Skip to content

Commit

Permalink
Refactor code and add tests
Browse files Browse the repository at this point in the history
Change the function/class responsible for flattening objects.
  • Loading branch information
brocococonut committed Mar 5, 2024
1 parent 5923c59 commit e782e6a
Show file tree
Hide file tree
Showing 15 changed files with 2,448 additions and 1,315 deletions.
16 changes: 8 additions & 8 deletions demo.ts
@@ -1,14 +1,14 @@
import { LocaleKit } from "./mod.ts";

const locale = new LocaleKit({
languages: {
en: {
test: {
key: "Test Key",
},
},
},
fallback_language: "en",
languages: {
en: {
test: {
key: "Test Key",
},
},
},
fallback_language: "en",
});

console.log(locale.t("test.key"));
38 changes: 29 additions & 9 deletions deno.json
@@ -1,23 +1,43 @@
{
"fmt": {
"exclude": ["README.md", "npm_build/"],
"exclude": [
"README.md",
"npm_build/"
],
"options": {}
},
"lint": {
"exclude": ["npm_build/"],
"exclude": [
"npm_build/"
],
"rules": {
"tags": ["recommended"],
"tags": [
"recommended"
],
"include": [],
"exclude": []
}
},
"test": {
"include": ["test/"],
"exclude": ["npm_build/"]
"include": [
"test/"
],
"exclude": [
"npm_build/"
]
},
"bench": {
"include": ["test/"],
"exclude": ["npm_build/"]
"include": [
"test/"
],
"exclude": [
"npm_build/"
]
},
"compilerOptions": {}
}
"compilerOptions": {},
"tasks": {
"lint": "deno run -A npm:@biomejs/biome lint **/*.ts",
"format": "deno run -A npm:@biomejs/biome format **/*.ts --write",
"check": "deno run -A npm:@biomejs/biome check --apply **/*.ts"
}
}

0 comments on commit e782e6a

Please sign in to comment.