Skip to content

Commit 74a0d5a

Browse files
committed
Fix Node.js 12 compatibility
Fixes #146
1 parent 925035b commit 74a0d5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import os from 'node:os';
33
import tty from 'node:tty';
44

55
// From: https://github.com/sindresorhus/has-flag/blob/main/index.js
6-
function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
6+
/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
7+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
78
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
89
const position = argv.indexOf(prefix + flag);
910
const terminatorPosition = argv.indexOf('--');

0 commit comments

Comments
 (0)