Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update packages #59

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tools/prepare.js → .scripts/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const BSON = require('bson')

const isDir = (source) => lstatSync(source).isDirectory()

const prepareLocale = async (localePath, locale, type) => {
async function prepareLocale(localePath, locale, type) {
const fileRe = /[0-9]+\.txt/
const files = readdirSync(localePath).filter((source) => fileRe.test(source))
const lineRe = /^([0-9]+)\|(.*)$/
Expand Down Expand Up @@ -48,7 +48,7 @@ const prepareLocale = async (localePath, locale, type) => {
}
}

const preparePath = async (dataPath, type) => {
async function preparePath(dataPath, type) {
const locales = readdirSync(dataPath).filter((source) =>
isDir(join(dataPath, source))
)
Expand All @@ -63,7 +63,7 @@ const preparePath = async (dataPath, type) => {
return { locales }
}

const prepareTimezones = async () => {
async function prepareTimezones() {
const lineRe = /^([0-9]+)\|(.*)$/
let data = {}
const file = join(
Expand Down Expand Up @@ -119,4 +119,9 @@ const prepare = async () => {
console.log('Creating types...')
writeFileSync(join(__dirname, '/../src/locales.ts'), generatedTypes)
}

prepare()
.then()
.catch((e) => {
console.error(`error`, e)
})
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## v1.2.13
- Update dependencies
- Refactor tests

## v1.2.12
- Update dependencies

## v1.2.11
- Update license from MIT to BSL-1.1
- Update dependencies
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devmehq/phone-number-validator-js",
"version": "1.2.12",
"version": "1.2.13",
"description": "Verify phone number, validate format, checking carrier name, geo and timezone infos.",
"keywords": [
"telephone",
Expand Down Expand Up @@ -34,9 +34,9 @@
],
"scripts": {
"build": "rimraf lib && rollup -c --bundleConfigAsCjs",
"preparemetadata": "rimraf resources && node tools/prepare.js && rimraf resources/libphonenumber",
"preparemetadata": "rimraf resources && node .scripts/prepare.js && rimraf resources/libphonenumber",
"prepublishOnly": "yarn build",
"prettier": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"prettier": "prettier --write \\\"src/**/*.ts\\\" \\\"__tests__/**/*.ts\\\"",
"test": "jest",
"watch": "rimraf lib && rollup -cw"
},
Expand Down
46 changes: 2 additions & 44 deletions src/locales.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,3 @@
/* THIS FILE IS AUTOGENERATED. */
export type GeocoderLocale =
| 'ar'
| 'be'
| 'bg'
| 'bs'
| 'de'
| 'el'
| 'en'
| 'es'
| 'fa'
| 'fi'
| 'fr'
| 'hr'
| 'hu'
| 'hy'
| 'id'
| 'it'
| 'iw'
| 'ja'
| 'ko'
| 'nl'
| 'pl'
| 'pt'
| 'ro'
| 'ru'
| 'sq'
| 'sr'
| 'sv'
| 'th'
| 'tr'
| 'uk'
| 'vi'
| 'zh'
| 'zh_Hant'
export type CarrierLocale =
| 'ar'
| 'be'
| 'en'
| 'fa'
| 'ko'
| 'ru'
| 'uk'
| 'zh'
| 'zh_Hant'
export type GeocoderLocale = 'ar' | 'be' | 'bg' | 'bs' | 'de' | 'el' | 'en' | 'es' | 'fa' | 'fi' | 'fr' | 'hr' | 'hu' | 'hy' | 'id' | 'it' | 'iw' | 'ja' | 'ko' | 'nl' | 'pl' | 'pt' | 'ro' | 'ru' | 'sq' | 'sr' | 'sv' | 'th' | 'tr' | 'uk' | 'vi' | 'zh' | 'zh_Hant';
export type CarrierLocale = 'ar' | 'be' | 'en' | 'fa' | 'ko' | 'ru' | 'uk' | 'zh' | 'zh_Hant';