Skip to content

Commit

Permalink
Require Node.js 12 and move to ESM (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmywarting authored Aug 8, 2021
1 parent 79474b1 commit 4ad6c27
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ jobs:
fail-fast: false
matrix:
node-version:
- 16
- 14
- 12
- 10
- 8
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand Down
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

let fastProto = null;

// Creates an object with permanently fast properties in V8. See Toon Verwaest's
Expand Down Expand Up @@ -28,6 +26,6 @@ for (let i = 0; i <= inlineCacheCutoff; i++) {
FastObject();
}

module.exports = function toFastproperties(o) {
export default function toFastproperties(o) {
return FastObject(o);
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=12"
},
"type": "module",
"scripts": {
"test": "node --allow-natives-syntax test.js && tsd"
},
Expand Down
5 changes: 2 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
const test = require('ava');
const toFastProperties = require('.');
import test from 'ava';
import toFastProperties from './index.js';

const toSlowProperties = object => {
for (let i = 0; i < 1000; i++) {
Expand Down

0 comments on commit 4ad6c27

Please sign in to comment.