aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/yargs-parser/build/lib/string-utils.js
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
commitd55b767039605256c736166a942a9138e3eacfd7 (patch)
tree947063b634c50d438a794325f13275e134aa5993 /node_modules/yargs-parser/build/lib/string-utils.js
parent864ce67d89c77d8ef9c3361f80d619853abcf91c (diff)
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/yargs-parser/build/lib/string-utils.js')
-rw-r--r--node_modules/yargs-parser/build/lib/string-utils.js65
1 files changed, 0 insertions, 65 deletions
diff --git a/node_modules/yargs-parser/build/lib/string-utils.js b/node_modules/yargs-parser/build/lib/string-utils.js
deleted file mode 100644
index 4e8bd99..0000000
--- a/node_modules/yargs-parser/build/lib/string-utils.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @license
- * Copyright (c) 2016, Contributors
- * SPDX-License-Identifier: ISC
- */
-export function camelCase(str) {
- // Handle the case where an argument is provided as camel case, e.g., fooBar.
- // by ensuring that the string isn't already mixed case:
- const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
- if (!isCamelCase) {
- str = str.toLowerCase();
- }
- if (str.indexOf('-') === -1 && str.indexOf('_') === -1) {
- return str;
- }
- else {
- let camelcase = '';
- let nextChrUpper = false;
- const leadingHyphens = str.match(/^-+/);
- for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) {
- let chr = str.charAt(i);
- if (nextChrUpper) {
- nextChrUpper = false;
- chr = chr.toUpperCase();
- }
- if (i !== 0 && (chr === '-' || chr === '_')) {
- nextChrUpper = true;
- }
- else if (chr !== '-' && chr !== '_') {
- camelcase += chr;
- }
- }
- return camelcase;
- }
-}
-export function decamelize(str, joinString) {
- const lowercase = str.toLowerCase();
- joinString = joinString || '-';
- let notCamelcase = '';
- for (let i = 0; i < str.length; i++) {
- const chrLower = lowercase.charAt(i);
- const chrString = str.charAt(i);
- if (chrLower !== chrString && i > 0) {
- notCamelcase += `${joinString}${lowercase.charAt(i)}`;
- }
- else {
- notCamelcase += chrString;
- }
- }
- return notCamelcase;
-}
-export function looksLikeNumber(x) {
- if (x === null || x === undefined)
- return false;
- // if loaded from config, may already be a number.
- if (typeof x === 'number')
- return true;
- // hexadecimal.
- if (/^0x[0-9a-f]+$/i.test(x))
- return true;
- // don't treat 0123 as a number; as it drops the leading '0'.
- if (/^0[^.]/.test(x))
- return false;
- return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
-}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage