-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect ARM64 macOS running on Apple Silicon
Also distinguishes whether 64-bit Node is running because we're actually on an Intel Mac or if it's just Rosetta 2 pretending to be one.
- Loading branch information
1 parent
af5b7e1
commit 6a6c1f9
Showing
3 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
declare function arch(): 'x64' | 'x86'; | ||
declare function arch(): 'x64' | 'x86' | 'arm64'; | ||
|
||
export = arch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
var arch = require('../') | ||
var test = require('tape') | ||
|
||
test('returns x86 or x64', function (t) { | ||
test('returns a valid architecture', function (t) { | ||
var str = arch() | ||
t.ok(str === 'x86' || str === 'x64') | ||
t.ok(str === 'x86' || str === 'x64' || str === 'arm64') | ||
t.end() | ||
}) |