HEX
Server: LiteSpeed
System: Linux spg20.cloudpowerdns.com 5.14.0-611.35.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 25 03:46:09 EST 2026 x86_64
User: carrerup (3153)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //opt/bitninja-dispatcher/node_modules/libphonenumber-js/runnable/generate-country-codes.js
import metadata from '../metadata.min.json' assert { type: 'json' }
import fs from 'fs'

const countryCodes = Object.keys(metadata.countries)

fs.writeFileSync(
	'./types.d.ts',
	fs.readFileSync('./types.d.ts', 'utf-8').replace(
		/export type CountryCode = .*;/,
		`export type CountryCode = ${countryCodes.map(_ => `'${_}'`).join(' | ')};`
	),
	'utf-8'
)