MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / parseDirection

Function parseDirection

packages/core/css/parser.ts:428–444  ·  view source on GitHub ↗
(text: string, start = 0)

Source from the content-addressed store, hash-verified

426 },
427};
428function parseDirection(text: string, start = 0): Parsed<Angle> {
429 directionRegEx.lastIndex = start;
430 const result = directionRegEx.exec(text);
431 if (!result) {
432 return null;
433 }
434 const end = directionRegEx.lastIndex;
435 const firstDirection = result[1];
436 if (result[2]) {
437 const secondDirection = result[2];
438 const value = cornerDirections[firstDirection][secondDirection];
439
440 return value === undefined ? null : { start, end, value };
441 } else {
442 return { start, end, value: sideDirections[firstDirection] };
443 }
444}
445
446const openingBracketRegEx = /\s*\(\s*/gy;
447const closingBracketRegEx = /\s*\)\s*/gy;

Callers 1

parseLinearGradientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected