fn_b/node_modules/concurrently/dist/src/utils.js
2026-02-12 13:55:43 +08:00

17 lines
450 B
JavaScript
Executable File

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.escapeRegExp = escapeRegExp;
exports.castArray = castArray;
/**
* Escapes a string for use in a regular expression.
*/
function escapeRegExp(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
/**
* Casts a value to an array if it's not one.
*/
function castArray(value) {
return (Array.isArray(value) ? value : value != null ? [value] : []);
}