diff --git a/.github/workflows/node-esm.yml b/.github/workflows/node-esm.yml deleted file mode 100644 index 6d387f2..0000000 --- a/.github/workflows/node-esm.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: 'Tests: node.js (ESM)' - -on: [pull_request, push] - -jobs: - tests: - uses: ljharb/actions/.github/workflows/node-esm.yml@main - with: - command: npm run tests-esm \ No newline at end of file diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 071705c..0000000 --- a/index.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import callBind from 'call-bind'; - -import getPolyfill from 'number.prototype.toexponential/polyfill'; - -export default callBind(getPolyfill()); - -export { default as getPolyfill } from 'number.prototype.toexponential/polyfill'; -export { default as implementation } from 'number.prototype.toexponential/implementation'; -export { default as shim } from 'number.prototype.toexponential/shim'; diff --git a/package.json b/package.json index 720a42f..2769b0c 100644 --- a/package.json +++ b/package.json @@ -4,14 +4,7 @@ "description": "An ES-spec-compliant Number.prototype.toExponential shim/polyfill/replacement that works as far down as ES3", "main": "index.js", "exports": { - ".": [ - { - "import": "./index.mjs", - "require": "./index.js", - "default": "./index.js" - }, - "./index.js" - ], + ".": "./index.js", "./auto": "./auto.js", "./polyfill": "./polyfill.js", "./implementation": "./implementation.js", @@ -26,8 +19,7 @@ "lint": "eslint --ext=js,mjs .", "postlint": "es-shim-api --bound", "tests-only": "nyc tape 'test/**/*.js'", - "tests-esm": "nyc node test/index.mjs", - "test": "npm run tests-only && npm run tests-esm", + "test": "npm run tests-only", "posttest": "npx npm@'>= 10.2' audit --production", "version": "auto-changelog && git add CHANGELOG.md", "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" diff --git a/test/index.mjs b/test/index.mjs deleted file mode 100644 index 143f092..0000000 --- a/test/index.mjs +++ /dev/null @@ -1,24 +0,0 @@ -import toExponential, * as toExponentialModule from 'number.prototype.toexponential'; -import test from 'tape'; -import runTests from './tests.js'; - -test('as a function', (t) => { - runTests(toExponential, t); - - t.end(); -}); - -test('named exports', async (t) => { - t.deepEqual( - Object.keys(toExponentialModule).sort(), - ['default', 'shim', 'getPolyfill', 'implementation'].sort(), - 'has expected named exports', - ); - - const { shim, getPolyfill, implementation } = toExponentialModule; - t.equal((await import('number.prototype.toexponential/shim')).default, shim, 'shim named export matches deep export'); - t.equal((await import('number.prototype.toexponential/implementation')).default, implementation, 'implementation named export matches deep export'); - t.equal((await import('number.prototype.toexponential/polyfill')).default, getPolyfill, 'getPolyfill named export matches deep export'); - - t.end(); -});