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

Function parseKeyword

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

Source from the content-addressed store, hash-verified

147
148const keywordRegEx = /\s*([a-z][\w\-]*)\s*/giy;
149function parseKeyword(text: string, start = 0): Parsed<Keyword> {
150 keywordRegEx.lastIndex = start;
151 const result = keywordRegEx.exec(text);
152 if (!result) {
153 return null;
154 }
155 const end = keywordRegEx.lastIndex;
156 const value = result[1];
157
158 return { start, end, value };
159}
160
161const backgroundRepeatKeywords = new Set(['repeat', 'repeat-x', 'repeat-y', 'no-repeat']);
162export function parseRepeat(value: string, start = 0, keyword = parseKeyword(value, start)): Parsed<BackgroundRepeat> {

Callers 6

parseColorKeywordFunction · 0.85
parseColorFunction · 0.85
parseRepeatFunction · 0.85
parseBackgroundSizeFunction · 0.85
parseBackgroundPositionFunction · 0.85
parseBackgroundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected