Upgrade Ava to v4

This commit is contained in:
Henry Mercer 2022-02-01 18:01:11 +00:00
parent 9a40cc5274
commit ce89f1b611
1153 changed files with 27264 additions and 95308 deletions

View file

@ -3,12 +3,10 @@ Detect whether the terminal supports Unicode.
@example
```
import isUnicodeSupported = require('is-unicode-supported');
import isUnicodeSupported from 'is-unicode-supported';
isUnicodeSupported();
//=> true
```
*/
declare function isUnicodeSupported(): boolean;
export = isUnicodeSupported;
export default function isUnicodeSupported(): boolean;

View file

@ -1,13 +1,12 @@
'use strict';
module.exports = () => {
export default function isUnicodeSupported() {
if (process.platform !== 'win32') {
return true;
return process.env.TERM !== 'linux'; // Linux console (kernel)
}
return Boolean(process.env.CI) ||
Boolean(process.env.WT_SESSION) || // Windows Terminal
process.env.ConEmuTask === '{cmd::Cmder}' || // ConEmu and cmder
process.env.TERM_PROGRAM === 'vscode' ||
process.env.TERM === 'xterm-256color' ||
process.env.TERM === 'alacritty';
};
}

View file

@ -1,6 +1,6 @@
{
"name": "is-unicode-supported",
"version": "0.1.0",
"version": "1.1.0",
"description": "Detect whether the terminal supports Unicode",
"license": "MIT",
"repository": "sindresorhus/is-unicode-supported",
@ -10,8 +10,10 @@
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=10"
"node": ">=12"
},
"scripts": {
"test": "xo && ava && tsd"
@ -34,7 +36,7 @@
"detection"
],
"devDependencies": {
"ava": "^2.4.0",
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.38.2"
}

View file

@ -15,7 +15,7 @@ $ npm install is-unicode-supported
## Usage
```js
const isUnicodeSupported = require('is-unicode-supported');
import isUnicodeSupported from 'is-unicode-supported';
isUnicodeSupported();
//=> true