@yangsaiyam/helper 1.8.3 → 1.9.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/package.json +1 -1
- package/src/addressess/index.test.ts +19 -0
- package/src/addressess/index.ts +24 -0
- package/src/index.ts +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
|
|
3
|
+
import { COUNTRY_CODE, MALAYSIA_STATE } from "./index";
|
|
4
|
+
|
|
5
|
+
assert.deepEqual(COUNTRY_CODE, [
|
|
6
|
+
{ key: 1, value: "MY", i18nKey: "country.code.1" },
|
|
7
|
+
]);
|
|
8
|
+
|
|
9
|
+
assert.equal(MALAYSIA_STATE.length, 16);
|
|
10
|
+
assert.deepEqual(MALAYSIA_STATE[0], {
|
|
11
|
+
key: 1,
|
|
12
|
+
value: "Johor",
|
|
13
|
+
i18nKey: "malaysia.state.1",
|
|
14
|
+
});
|
|
15
|
+
assert.deepEqual(MALAYSIA_STATE[15], {
|
|
16
|
+
key: 16,
|
|
17
|
+
value: "Putrajaya",
|
|
18
|
+
i18nKey: "malaysia.state.16",
|
|
19
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MappingOption } from "../shared/types";
|
|
2
|
+
|
|
3
|
+
export const COUNTRY_CODE = [
|
|
4
|
+
{ key: 1, value: "MY", i18nKey: "country.code.1" },
|
|
5
|
+
] as const satisfies readonly MappingOption[];
|
|
6
|
+
|
|
7
|
+
export const MALAYSIA_STATE = [
|
|
8
|
+
{ key: 1, value: "Johor", i18nKey: "malaysia.state.1" },
|
|
9
|
+
{ key: 2, value: "Kedah", i18nKey: "malaysia.state.2" },
|
|
10
|
+
{ key: 3, value: "Kelantan", i18nKey: "malaysia.state.3" },
|
|
11
|
+
{ key: 4, value: "Melaka", i18nKey: "malaysia.state.4" },
|
|
12
|
+
{ key: 5, value: "Negeri Sembilan", i18nKey: "malaysia.state.5" },
|
|
13
|
+
{ key: 6, value: "Pahang", i18nKey: "malaysia.state.6" },
|
|
14
|
+
{ key: 7, value: "Penang", i18nKey: "malaysia.state.7" },
|
|
15
|
+
{ key: 8, value: "Perak", i18nKey: "malaysia.state.8" },
|
|
16
|
+
{ key: 9, value: "Perlis", i18nKey: "malaysia.state.9" },
|
|
17
|
+
{ key: 10, value: "Sabah", i18nKey: "malaysia.state.10" },
|
|
18
|
+
{ key: 11, value: "Sarawak", i18nKey: "malaysia.state.11" },
|
|
19
|
+
{ key: 12, value: "Selangor", i18nKey: "malaysia.state.12" },
|
|
20
|
+
{ key: 13, value: "Terengganu", i18nKey: "malaysia.state.13" },
|
|
21
|
+
{ key: 14, value: "Kuala Lumpur", i18nKey: "malaysia.state.14" },
|
|
22
|
+
{ key: 15, value: "Labuan", i18nKey: "malaysia.state.15" },
|
|
23
|
+
{ key: 16, value: "Putrajaya", i18nKey: "malaysia.state.16" },
|
|
24
|
+
] as const satisfies readonly MappingOption[];
|
package/src/index.ts
CHANGED