Skip to content

Commit 8a35c29

Browse files
committed
fix: Fix issue with node versions above 6.9
The converting version to number converted 6.11.0 to 6110 which is a larger number than 760. Thus breaking the supports async-await-test.
1 parent 13dcefb commit 8a35c29

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/adapter-utils/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const supportsAsyncAwait = parseInt(process.version.slice(1).split('.').join('')) > 760;
1+
const supportsAsyncAwait =
2+
parseInt(process.version.slice(1).split('.').join('').substring(0, 3)) > 760;
23

34
const path = supportsAsyncAwait ? './src/index' : './dist/index';
45

packages/adapter-utils/unit-tests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const supportsAsyncAwait = parseInt(process.version.slice(1).split('.').join('')) > 760;
1+
const supportsAsyncAwait =
2+
parseInt(process.version.slice(1).split('.').join('').substring(0, 3)) > 760;
23

34
const path = supportsAsyncAwait ? './src/unit-tests' : './dist/unit-tests';
45

packages/micro-analytics-cli/cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const pkg = require('./package.json');
66

77
updateNotifier({ pkg }).notify();
88

9-
const supportsAsyncAwait = parseInt(process.version.slice(1).split('.').join('')) > 760;
9+
const supportsAsyncAwait =
10+
parseInt(process.version.slice(1).split('.').join('').substring(0, 3)) > 760;
1011

1112
const microAnalytics = supportsAsyncAwait ? './src/index' : './dist/index';
1213

0 commit comments

Comments
 (0)