File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
// Based on:
2
2
// <https://github.com/babel/babel/blob/main/packages/babel-helper-validator-identifier/scripts/generate-identifier-regex.js>
3
3
4
- import fs from 'node:fs'
5
- import path from 'node:path'
4
+ import fs from 'node:fs/promises'
6
5
import regenerate from 'regenerate'
7
6
// @ts -expect-error untyped.
8
7
import idStart_ from '@unicode/unicode-15.0.0/Binary_Property/ID_Start/code-points.js'
9
- /** @type {Array<number> } */
10
8
// @ts -expect-error untyped.
11
9
import idCont_ from '@unicode/unicode-15.0.0/Binary_Property/ID_Continue/code-points.js'
12
10
@@ -19,8 +17,8 @@ const cont = [0x20_0c, 0x20_0d].concat(idCont.filter((d) => bmp(d)))
19
17
const startRe = regenerate ( ) . add ( start ) . toRegExp ( )
20
18
const contRe = regenerate ( ) . add ( cont ) . remove ( start ) . toRegExp ( )
21
19
22
- fs . writeFileSync (
23
- path . join ( 'lib' , ' regex.js') ,
20
+ await fs . writeFile (
21
+ new URL ( 'lib/ regex.js' , import . meta . url ) ,
24
22
[
25
23
'// This module is generated by `build.js`.' ,
26
24
'export const start = ' + startRe ,
You can’t perform that action at this time.
0 commit comments