UNPKG

vega-schema-url-parser

Version:

A parser to get the library and version from Vega and Vega-Lite schema URLs.

1 lines 573 B
{"version":3,"file":"parser.cjs","sources":["../parser.ts"],"sourcesContent":["/**\n * Parse a vega schema url into library and version.\n */\nexport default function(url: string) {\n const regex = /schema\\/([\\w-]+)\\/([\\w\\.\\-]+)\\.json$/g;\n const [library, version] = regex.exec(url)!.slice(1, 3);\n return {library: library as 'vega' | 'vega-lite', version};\n}\n"],"names":["url","_regex$exec$slice","exec","slice","library","version"],"mappings":"eAGc,SAAUA,GACpB,IACAC,EADc,wCACmBC,KAAKF,GAAMG,MAAM,EAAG,GACrD,MAAO,CAACC,QADMH,EAAA,GACoCI,QAD3BJ,KAE3B"}