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

Function parseURL

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

Source from the content-addressed store, hash-verified

57const urlRegEx = /\s*url\((?:(['"])(.*?)\1|([^)]*))\)\s*/gy;
58// const urlRegEx = /(?:^|\s*#[a-fA-F0-9]{3,6}\s*|^\s*)url\((['"]?)(.*?)\1\)\s*/gi;
59export function parseURL(text: string, start = 0): Parsed<URL> {
60 urlRegEx.lastIndex = start;
61 const result = urlRegEx.exec(text);
62 if (!result) {
63 return null;
64 }
65 const end = urlRegEx.lastIndex;
66 const value: URL = result[2] || result[3];
67
68 return { start, end, value };
69}
70
71const hexColorRegEx = /\s*#((?:[0-9A-F]{8})|(?:[0-9A-F]{6})|(?:[0-9A-F]{4})|(?:[0-9A-F]{3}))\s*/giy;
72export function parseHexColor(text: string, start = 0): Parsed<Color> {

Callers 1

parseBackgroundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected