File tree 4 files changed +14
-0
lines changed
4 files changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ import "./utils/symbol.dispose" ;
1
2
import { prettyByte } from "./utils/prettyByte" ;
2
3
import { ExtensionCodec , ExtensionCodecType } from "./ExtensionCodec" ;
3
4
import { getInt64 , getUint64 , UINT32_MAX } from "./utils/int" ;
Original file line number Diff line number Diff line change
1
+ import "./utils/symbol.dispose" ;
1
2
import { utf8Count , utf8Encode } from "./utils/utf8" ;
2
3
import { ExtensionCodec , ExtensionCodecType } from "./ExtensionCodec" ;
3
4
import { setInt64 , setUint64 } from "./utils/int" ;
Original file line number Diff line number Diff line change
1
+ // Polyfill to Symbol.dispose
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
4
+ if ( ! Symbol . dispose ) {
5
+ Object . defineProperty ( Symbol , "dispose" , {
6
+ value : Symbol ( "dispose" ) ,
7
+ writable : false ,
8
+ enumerable : false ,
9
+ configurable : false ,
10
+ } ) ;
11
+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ for (const file of files) {
11
11
// .js => .mjs
12
12
const content = fs . readFileSync ( file ) . toString ( "utf-8" ) ;
13
13
const newContent = content . replace ( / \b f r o m " ( \. \. ? \/ [ ^ " ] + ) " ; / g, 'from "$1.mjs";' )
14
+ . replace ( / \b i m p o r t " ( \. \. ? \/ [ ^ " ] + ) " ; / g, 'import "$1.mjs";' )
14
15
. replace ( / \/ \/ # s o u r c e M a p p i n g U R L = ( .+ ) \. j s \. m a p $ / ,
15
16
"//# sourceMappingURL=$1.mjs.map" ) ;
16
17
fs . writeFileSync ( fileMjs , newContent ) ;
You can’t perform that action at this time.
0 commit comments