Skip to main content

Function: parseSchemaUrl()

parseSchemaUrl(url): SchemaName | undefined

Defined in: src/lib/schemas/index.ts:40

The name and version of a schema from its URL, or undefined if it isn't one of PaintCanvas's published schemas.

Parameters​

url​

unknown

Returns​

SchemaName | undefined

Example​

parseSchemaUrl("https://lvl99.github.io/paintcanvas/schemas/brush-preset-1.0.0.json"); // { name: "brush-preset", version: "1.0.0" }
parseSchemaUrl("https://example.com/other.json"); // undefined