This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
admin-panel/graphql-types/node_modules/figures/index.js

148 lines
2.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
var objectAssign = require('object-assign');
var escapeStringRegexp = require('escape-string-regexp');
var platform = process.platform;
var main = {
tick: '✔',
cross: '✖',
star: '★',
square: '▇',
squareSmall: '◻',
squareSmallFilled: '◼',
play: '▶',
circle: '◯',
circleFilled: '◉',
circleDotted: '◌',
circleDouble: '◎',
circleCircle: 'ⓞ',
circleCross: 'ⓧ',
circlePipe: 'Ⓘ',
circleQuestionMark: '?⃝',
bullet: '●',
dot: '',
line: '─',
ellipsis: '…',
pointer: '',
pointerSmall: '',
info: '',
warning: '⚠',
hamburger: '☰',
smiley: '㋡',
mustache: '෴',
heart: '♥',
arrowUp: '↑',
arrowDown: '↓',
arrowLeft: '←',
arrowRight: '→',
radioOn: '◉',
radioOff: '◯',
checkboxOn: '☒',
checkboxOff: '☐',
checkboxCircleOn: 'ⓧ',
checkboxCircleOff: 'Ⓘ',
questionMarkPrefix: '?⃝',
oneHalf: '½',
oneThird: '⅓',
oneQuarter: '¼',
oneFifth: '⅕',
oneSixth: '⅙',
oneSeventh: '⅐',
oneEighth: '⅛',
oneNinth: '⅑',
oneTenth: '⅒',
twoThirds: '⅔',
twoFifths: '⅖',
threeQuarters: '¾',
threeFifths: '⅗',
threeEighths: '⅜',
fourFifths: '⅘',
fiveSixths: '⅚',
fiveEighths: '⅝',
sevenEighths: '⅞'
};
var win = {
tick: '√',
cross: '×',
star: '*',
square: '█',
squareSmall: '[ ]',
squareSmallFilled: '[█]',
play: '►',
circle: '( )',
circleFilled: '(*)',
circleDotted: '( )',
circleDouble: '( )',
circleCircle: '(○)',
circleCross: '(×)',
circlePipe: '(│)',
circleQuestionMark: '(?)',
bullet: '*',
dot: '.',
line: '─',
ellipsis: '...',
pointer: '>',
pointerSmall: '»',
info: 'i',
warning: '‼',
hamburger: '≡',
smiley: '☺',
mustache: '┌─┐',
heart: main.heart,
arrowUp: main.arrowUp,
arrowDown: main.arrowDown,
arrowLeft: main.arrowLeft,
arrowRight: main.arrowRight,
radioOn: '(*)',
radioOff: '( )',
checkboxOn: '[×]',
checkboxOff: '[ ]',
checkboxCircleOn: '(×)',
checkboxCircleOff: '( )',
questionMarkPrefix: '',
oneHalf: '1/2',
oneThird: '1/3',
oneQuarter: '1/4',
oneFifth: '1/5',
oneSixth: '1/6',
oneSeventh: '1/7',
oneEighth: '1/8',
oneNinth: '1/9',
oneTenth: '1/10',
twoThirds: '2/3',
twoFifths: '2/5',
threeQuarters: '3/4',
threeFifths: '3/5',
threeEighths: '3/8',
fourFifths: '4/5',
fiveSixths: '5/6',
fiveEighths: '5/8',
sevenEighths: '7/8'
};
if (platform === 'linux') {
// the main one doesn't look that good on Ubuntu
main.questionMarkPrefix = '?';
}
var figures = platform === 'win32' ? win : main;
var fn = function (str) {
if (figures === main) {
return str;
}
Object.keys(main).forEach(function (key) {
if (main[key] === figures[key]) {
return;
}
str = str.replace(new RegExp(escapeStringRegexp(main[key]), 'g'), figures[key]);
});
return str;
};
module.exports = objectAssign(fn, figures);