File tree Expand file tree Collapse file tree 4 files changed +14
-0
lines changed Expand file tree Collapse file tree 4 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1+ import "./utils/symbol.dispose" ;
12import { prettyByte } from "./utils/prettyByte" ;
23import { ExtensionCodec , ExtensionCodecType } from "./ExtensionCodec" ;
34import { getInt64 , getUint64 , UINT32_MAX } from "./utils/int" ;
Original file line number Diff line number Diff line change 1+ import "./utils/symbol.dispose" ;
12import { utf8Count , utf8Encode } from "./utils/utf8" ;
23import { ExtensionCodec , ExtensionCodecType } from "./ExtensionCodec" ;
34import { 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) {
1111 // .js => .mjs
1212 const content = fs . readFileSync ( file ) . toString ( "utf-8" ) ;
1313 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";' )
1415 . replace ( / \/ \/ # s o u r c e M a p p i n g U R L = ( .+ ) \. j s \. m a p $ / ,
1516 "//# sourceMappingURL=$1.mjs.map" ) ;
1617 fs . writeFileSync ( fileMjs , newContent ) ;
You can’t perform that action at this time.
0 commit comments