MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / splitBuildSetting

Function splitBuildSetting

scripts/experimental/swiftui-preview.mjs:1382–1418  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

1380}
1381
1382function splitBuildSetting(value) {
1383 if (!value) {
1384 return [];
1385 }
1386 const text = String(value);
1387 const items = [];
1388 let current = "";
1389 let quote = "";
1390 for (let index = 0; index < text.length; index += 1) {
1391 const char = text[index];
1392 if (quote) {
1393 if (char === "\\") {
1394 current += text[index + 1] ?? "";
1395 index += 1;
1396 } else if (char === quote) {
1397 quote = "";
1398 } else {
1399 current += char;
1400 }
1401 continue;
1402 }
1403 if (char === '"' || char === "'") {
1404 quote = char;
1405 } else if (/\s/.test(char)) {
1406 if (current) {
1407 items.push(current);
1408 current = "";
1409 }
1410 } else {
1411 current += char;
1412 }
1413 }
1414 if (current) {
1415 items.push(current);
1416 }
1417 return items;
1418}
1419
1420function run(command, args, options = {}) {
1421 const result = spawnSync(command, args, {

Callers 2

xcodeSwiftcArgsFunction · 0.85
pushSearchArgsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected