format: prettify entire project

This commit is contained in:
Rim
2025-04-02 06:50:39 -04:00
parent 86f0782a98
commit 7ccc0be712
1711 changed files with 755867 additions and 235931 deletions

35
node_modules/braces/lib/utils.js generated vendored
View File

@ -1,6 +1,6 @@
'use strict';
exports.isInteger = num => {
exports.isInteger = (num) => {
if (typeof num === 'number') {
return Number.isInteger(num);
}
@ -14,7 +14,7 @@ exports.isInteger = num => {
* Find a node of the given type
*/
exports.find = (node, type) => node.nodes.find(node => node.type === type);
exports.find = (node, type) => node.nodes.find((node) => node.type === type);
/**
* Find a node of the given type
@ -23,7 +23,7 @@ exports.find = (node, type) => node.nodes.find(node => node.type === type);
exports.exceedsLimit = (min, max, step = 1, limit) => {
if (limit === false) return false;
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
return ((Number(max) - Number(min)) / Number(step)) >= limit;
return (Number(max) - Number(min)) / Number(step) >= limit;
};
/**
@ -34,7 +34,11 @@ exports.escapeNode = (block, n = 0, type) => {
const node = block.nodes[n];
if (!node) return;
if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
if (
(type && node.type === type) ||
node.type === 'open' ||
node.type === 'close'
) {
if (node.escaped !== true) {
node.value = '\\' + node.value;
node.escaped = true;
@ -46,9 +50,9 @@ exports.escapeNode = (block, n = 0, type) => {
* Returns true if the given brace node should be enclosed in literal braces
*/
exports.encloseBrace = node => {
exports.encloseBrace = (node) => {
if (node.type !== 'brace') return false;
if ((node.commas >> 0 + node.ranges >> 0) === 0) {
if ((node.commas >> (0 + node.ranges)) >> 0 === 0) {
node.invalid = true;
return true;
}
@ -59,10 +63,10 @@ exports.encloseBrace = node => {
* Returns true if a brace node is invalid.
*/
exports.isInvalidBrace = block => {
exports.isInvalidBrace = (block) => {
if (block.type !== 'brace') return false;
if (block.invalid === true || block.dollar) return true;
if ((block.commas >> 0 + block.ranges >> 0) === 0) {
if ((block.commas >> (0 + block.ranges)) >> 0 === 0) {
block.invalid = true;
return true;
}
@ -77,7 +81,7 @@ exports.isInvalidBrace = block => {
* Returns true if a node is an open or close node
*/
exports.isOpenOrClose = node => {
exports.isOpenOrClose = (node) => {
if (node.type === 'open' || node.type === 'close') {
return true;
}
@ -88,11 +92,12 @@ exports.isOpenOrClose = node => {
* Reduce an array of text nodes.
*/
exports.reduce = nodes => nodes.reduce((acc, node) => {
if (node.type === 'text') acc.push(node.value);
if (node.type === 'range') node.type = 'text';
return acc;
}, []);
exports.reduce = (nodes) =>
nodes.reduce((acc, node) => {
if (node.type === 'text') acc.push(node.value);
if (node.type === 'range') node.type = 'text';
return acc;
}, []);
/**
* Flatten an array
@ -101,7 +106,7 @@ exports.reduce = nodes => nodes.reduce((acc, node) => {
exports.flatten = (...args) => {
const result = [];
const flat = arr => {
const flat = (arr) => {
for (let i = 0; i < arr.length; i++) {
const ele = arr[i];