Skip to content

Commit

Permalink
cache isUnicodeSupported result
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoppippi committed Aug 13, 2024
1 parent 010737f commit a11d76a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions symbols.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {blue, green, yellow, red} from 'yoctocolors';
import isUnicodeSupported from 'is-unicode-supported';

const info = blue(isUnicodeSupported() ? 'ℹ' : 'i');
const success = green(isUnicodeSupported() ? '✔' : '√');
const warning = yellow(isUnicodeSupported() ? '⚠' : '‼');
const error = red(isUnicodeSupported() ? '✖️' : '×');
const _isUnicodeSupported = isUnicodeSupported();

const info = blue(_isUnicodeSupported ? 'ℹ' : 'i');
const success = green(_isUnicodeSupported ? '✔' : '√');
const warning = yellow(_isUnicodeSupported ? '⚠' : '‼');
const error = red(_isUnicodeSupported ? '✖️' : '×');

export {info, success, warning, error};

0 comments on commit a11d76a

Please sign in to comment.