{"version":3,"file":"argv.js","names":[],"sources":["../../../src/checkers/stylelint/argv.ts"],"sourcesContent":["// copied from https://github.com/jonschlinkert/is-plain-object/blob/master/is-plain-object.js\n// to make less breaking change, we'll make it a dependency before v1.0.0\n\nexport { parseArgsStringToArgv as default, parseArgsStringToArgv }\n\nfunction parseArgsStringToArgv(\n value: string,\n env?: string,\n file?: string,\n): string[] {\n // ([^\\s'\"]([^\\s'\"]*(['\"])([^\\3]*?)\\3)+[^\\s'\"]*) Matches nested quotes until the first space outside of quotes\n\n // [^\\s'\"]+ or Match if not a space ' or \"\n\n // (['\"])([^\\5]*?)\\5 or Match \"quoted text\" without quotes\n // `\\3` and `\\5` are a backreference to the quote style (' or \") captured\n const myRegexp =\n // @ts-expect-error Bypass typescript validation\n // biome-ignore lint/complexity/noUselessEscapeInRegex: Bypass validation\n /([^\\s'\"]([^\\s'\"]*(['\"])([^\\3]*?)\\3)+[^\\s'\"]*)|[^\\s'\"]+|(['\"])([^\\5]*?)\\5/gi\n const myString = value\n const myArray: string[] = []\n if (env) {\n myArray.push(env)\n }\n if (file) {\n myArray.push(file)\n }\n let match: RegExpExecArray | null\n do {\n // Each call to exec returns the next regex match as an array\n match = myRegexp.exec(myString)\n if (match !== null) {\n // Index 1 in the array is the captured group if it exists\n // Index 0 is the matched text, which we use if no captured group exists\n myArray.push(firstString(match[1], match[6], match[0])!)\n }\n } while (match !== null)\n\n return myArray\n}\n\n// Accepts any number of arguments, and returns the first one that is a string\n// (even an empty string)\n// @ts-expect-error\nfunction firstString(...args: Array): string | undefined {\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < args.length; i++) {\n const arg = args[i]\n if (typeof arg === 'string') {\n return arg\n }\n }\n}\n"],"mappings":";AAKA,SAAS,sBACP,OACA,KACA,MACU;CAOV,MAAM,WAGJ;CACF,MAAM,WAAW;CACjB,MAAM,UAAoB,CAAC;CAC3B,IAAI,KACF,QAAQ,KAAK,GAAG;CAElB,IAAI,MACF,QAAQ,KAAK,IAAI;CAEnB,IAAI;CACJ,GAAG;EAED,QAAQ,SAAS,KAAK,QAAQ;EAC9B,IAAI,UAAU,MAGZ,QAAQ,KAAK,YAAY,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAE;CAE3D,SAAS,UAAU;CAEnB,OAAO;AACT;AAKA,SAAS,YAAY,GAAG,MAAsC;CAE5D,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,MAAM,KAAK;EACjB,IAAI,OAAO,QAAQ,UACjB,OAAO;CAEX;AACF"}