Skip to main content
Module

x/phonenumber/scripts/rewrite.ts

Google's libphonenumber pre-compiled with the closure compiler
Go to Latest
File

import { promises } from 'fs'import * as path from 'path'
const { readFile, writeFile } = promises;
const distFile = path.resolve( __dirname, '..', 'lib', 'index.js' );
async function rewrite( ){ const data = await readFile( distFile, 'utf-8' ); const res = data.replace( /\bconst /g, 'var ' ); await writeFile( distFile, res, 'utf-8' );}rewrite( );