-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
659 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,8 @@ | |
"hooks": { | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
}, | ||
"dependencies": { | ||
"tsup": "^8.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "@bigcapital/utils", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
} | ||
}, | ||
"scripts": { | ||
"build:cjs": "tsup src/index.ts --format cjs --dts --sourcemap", | ||
"build:esm": "tsup src/index.ts --format esm --dts --sourcemap", | ||
"build": "npm run build:cjs && npm run build:esm", | ||
"dev": "npm run build -- --watch" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
11 changes: 1 addition & 10 deletions
11
packages/webapp/src/constants/countries.ts → ...igcapital-utils/src/countries/constant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Countries } from './constant'; | ||
import { Country, Maybe } from './types'; | ||
|
||
export const getAllCountries = () => { | ||
return Object.keys(Countries).map((countryCode) => { | ||
return { | ||
...Countries[countryCode], | ||
countryCode, | ||
}; | ||
}); | ||
}; | ||
|
||
export const findByIsoCountryCode = ( | ||
isoCode: string | ||
): Maybe<Country & { countryCode: string }> => { | ||
const _isoCode = isoCode?.toUpperCase(); | ||
const country = Countries[_isoCode]; | ||
|
||
return country ? { ...country, countryCode: isoCode } : null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export interface Country { | ||
name: string; | ||
native: string; | ||
phone: number[]; | ||
continent: string; | ||
continents?: string[]; | ||
capital: string; | ||
currency: string[]; | ||
languages: string[]; | ||
} | ||
|
||
export type Maybe<T> = T | null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './countries'; | ||
|
||
export const test = () => {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES6", // Equivalent to ES6 output | ||
"module": "ESNext", // CommonJS for Node.js compatibility | ||
"outDir": "dist", // Output directory for compiled files | ||
"declaration": true, // Generates .d.ts files (same as dts: true) | ||
"declarationDir": "dist", // Specifies where to output declaration files | ||
"sourceMap": true, // Generate sourcemaps | ||
"esModuleInterop": true, // Enables interop between CommonJS and ESModules | ||
"strict": true, // Enables strict type-checking options | ||
"moduleResolution": "node", // Resolve modules using Node.js-style resolution | ||
"skipLibCheck": true, // Skip type checking of declaration files | ||
"forceConsistentCasingInFileNames": true // Enforces consistent casing in import paths | ||
}, | ||
"include": ["src/**/*"], // Includes all TypeScript files in the src directory | ||
"exclude": ["node_modules"] // Excludes node_modules from being compiled | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.