feat: convert to Node.js compatible ES Module

This commit is contained in:
Simon Chan 2022-03-15 16:53:07 +08:00
parent 730aac8da2
commit d9212b4dac
No known key found for this signature in database
GPG key ID: 8F75717685A974FB
94 changed files with 429 additions and 466 deletions

View file

@ -26,7 +26,7 @@
"url": "https://github.com/yume-chan/ya-webadb/issues"
},
"type": "module",
"module": "esm/index.js",
"main": "esm/index.js",
"types": "esm/index.d.ts",
"scripts": {
"build": "build-ts-package",
@ -39,7 +39,7 @@
},
"devDependencies": {
"jest": "^26.6.3",
"typescript": "^4.6.2",
"typescript": "next",
"@yume-chan/ts-package-builder": "^1.0.0"
}
}

View file

@ -1,4 +1,4 @@
import { getBigInt64 as fallbackGetBigInt64, getBigUint64 as fallbackGetBigUint64, setBigInt64 as fallbackSetBigInt64, setBigUint64 as fallbackSetBigUint64 } from './pure';
import { getBigInt64 as fallbackGetBigInt64, getBigUint64 as fallbackGetBigUint64, setBigInt64 as fallbackSetBigInt64, setBigUint64 as fallbackSetBigUint64 } from './pure.js';
export const getBigInt64 =
'getBigInt64' in DataView.prototype ?

View file

@ -1 +1 @@
export * from './pure';
export * from './pure.js';

View file

@ -1,4 +1,4 @@
import { getBigInt64, getBigUint64, setBigInt64, setBigUint64 } from './pure';
import { getBigInt64, getBigUint64, setBigInt64, setBigUint64 } from './pure.js';
if (!('getBigInt64' in DataView)) {
DataView.prototype.getBigInt64 = function (byteOffset, littleEndian) {