├── docs ├── CNAME ├── style.css └── index.html ├── .gitignore ├── .github ├── dependabot.yml └── workflows │ └── build.yml ├── tsconfig.json ├── LICENSE.md ├── CHANGELOG.md ├── package.json ├── scripts └── format-json.js ├── src └── country-coder.ts ├── README.md └── tests └── country-coder.spec.ts /docs/CNAME: -------------------------------------------------------------------------------- 1 | ideditor.codes -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .coverage 3 | .esm-cache 4 | .vscode 5 | .watchmanconfig 6 | 7 | node_modules/ 8 | dist/ 9 | 10 | npm-debug.log 11 | package-lock.json 12 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Please see the documentation for all configuration options: 2 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 3 | 4 | version: 2 5 | updates: 6 | - package-ecosystem: "npm" 7 | directory: "/" 8 | schedule: 9 | interval: "daily" 10 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["src/*"], 3 | "exclude": ["node_modules", "dist"], 4 | "compilerOptions": { 5 | "module": "ES2020", 6 | "declaration": true, 7 | "emitDeclarationOnly": true, 8 | "outDir": "dist", 9 | "esModuleInterop": true, 10 | "moduleResolution": "node", 11 | "noImplicitAny": false, 12 | "noImplicitReturns": true, 13 | "noImplicitThis": true, 14 | "resolveJsonModule": true, 15 | "strictBindCallApply": true, 16 | "strictFunctionTypes": true, 17 | "strictPropertyInitialization": true, 18 | "strictNullChecks": true 19 | }, 20 | "target": "esnext", 21 | "module": "commonjs" 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ## ISC License 2 | 3 | Copyright (c) 2019-present, country-coder contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: build 5 | 6 | on: 7 | push: 8 | branches: [ main ] 9 | pull_request: 10 | branches: [ main ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | strategy: 18 | matrix: 19 | node-version: [12.x, 14.x, 16.x] 20 | 21 | steps: 22 | - uses: actions/checkout@v2 23 | - name: Use Node.js ${{ matrix.node-version }} 24 | uses: actions/setup-node@v1 25 | with: 26 | node-version: ${{ matrix.node-version }} 27 | - run: npm install 28 | - run: npm run all 29 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # What's New 2 | 3 | **country-coder** is an open source project. You can submit bug reports, help out, 4 | or learn more by visiting our project page on GitHub: :octocat: https://github.com/ideditor/country-coder 5 | 6 | Please star our project on GitHub to show your support! :star: 7 | 8 | _Breaking changes, which may affect downstream projects, are marked with a_ :warning: 9 | 10 | 11 | 18 | 19 | 20 | # 5.0.3 21 | ##### 2021-Jun-24 22 | * Remove "browser" from the export map ([#45]) 23 | 24 | [#45]: https://github.com/ideditor/country-coder/issues/45 25 | 26 | 27 | # 5.0.2 28 | ##### 2021-Jun-17 29 | * Add an export map to `package.json`, fix file extensions again 30 | 31 | 32 | # 5.0.1 33 | ##### 2021-Jun-15 34 | * Use explicit file extensions for .cjs and .mjs exports ([#44]) 35 | 36 | 37 | # 5.0.0 38 | ##### 2021-Jun-14 39 | * :warning: Replace microbundle with [esbuild](https://esbuild.github.io/) for super fast build speed. Outputs are now: 40 | * `"source": "./src/country-coder.ts"` - TypeScript source file 41 | * `"types": "./dist/country-coder.d.ts"` - TypeScript definition file 42 | * `"main": "./dist/country-coder.cjs"` - CJS bundle, modern JavaScript, works with `require()` 43 | * `"module": "./dist/country-coder.mjs"` - ESM bundle, modern JavaScript, works with `import` 44 | * `"browser": "./dist/country-coder.iife.js"` - IIFE bundle, modern JavaScript, works in browser ` 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 |