UNPKG

pixi.js

Version:

<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">

24 lines (23 loc) 780 B
/** * Extracts the ID from an SVG url() reference. * * This function handles all valid SVG url() formats including: * - url(#id) * - url('#id') * - url("#id") * - url( #id ) * - url( '#id' ) * - url( "#id" ) * * The regex pattern matches: * - url followed by optional whitespace * - opening parenthesis followed by optional whitespace * - optional single or double quotes with optional whitespace * - # followed by the ID (any chars except quotes, whitespace, or closing paren) * - optional single or double quotes with optional whitespace * - closing parenthesis * @param url - The SVG url() string to parse * @returns The extracted ID string, or empty string if no valid ID found * @internal */ export declare function extractSvgUrlId(url: string): string;