UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

1 lines 1.96 kB
{"version":3,"file":"regex.min.mjs","sources":["../../../../src/util/path/regex.ts"],"sourcesContent":["import { reNum } from '../../parser/constants';\n\nconst commaWsp = `\\\\s*,?\\\\s*`;\n\n/**\n * p for param\n * using \"bad naming\" here because it makes the regex much easier to read\n * p is a number that is preceded by an arbitary number of spaces, maybe 0,\n * a comma or not, and then possibly more spaces or not.\n */\nconst p = `${commaWsp}(${reNum})`;\n\n// const reMoveToCommand = `(M) ?(?:${p}${p} ?)+`;\n\n// const reLineCommand = `(L) ?(?:${p}${p} ?)+`;\n\n// const reHorizontalLineCommand = `(H) ?(?:${p} ?)+`;\n\n// const reVerticalLineCommand = `(V) ?(?:${p} ?)+`;\n\n// const reClosePathCommand = String.raw`(Z)\\s*`;\n\n// const reCubicCurveCommand = `(C) ?(?:${p}${p}${p}${p}${p}${p} ?)+`;\n\n// const reCubicCurveShortcutCommand = `(S) ?(?:${p}${p}${p}${p} ?)+`;\n\n// const reQuadraticCurveCommand = `(Q) ?(?:${p}${p}${p}${p} ?)+`;\n\n// const reQuadraticCurveShortcutCommand = `(T) ?(?:${p}${p} ?)+`;\n\nexport const reArcCommandPoints = `${p}${p}${p}${commaWsp}([01])${commaWsp}([01])${p}${p}`;\n// const reArcCommand = `(A) ?(?:${reArcCommandPoints} ?)+`;\n\n// export const rePathCommandGroups =\n// `(?:(?:${reMoveToCommand})` +\n// `|(?:${reLineCommand})` +\n// `|(?:${reHorizontalLineCommand})` +\n// `|(?:${reVerticalLineCommand})` +\n// `|(?:${reClosePathCommand})` +\n// `|(?:${reCubicCurveCommand})` +\n// `|(?:${reCubicCurveShortcutCommand})` +\n// `|(?:${reQuadraticCurveCommand})` +\n// `|(?:${reQuadraticCurveShortcutCommand})` +\n// `|(?:${reArcCommand}))`;\n\nexport const rePathCommand = '[mzlhvcsqta][^mzlhvcsqta]*';\n"],"names":["commaWsp","p","concat","reNum","reArcCommandPoints","rePathCommand"],"mappings":"uDAEA,MAAMA,EAAuB,aAQvBC,KAACC,OAAMF,EAAQE,KAAAA,OAAIC,EAAQ,KAoBpBC,EAAkBF,GAAAA,OAAMD,GAACC,OAAGD,GAACC,OAAGD,GAACC,OAAGF,EAAQ,UAAAE,OAASF,EAAQ,UAAAE,OAASD,GAACC,OAAGD,GAe1EI,EAAgB"}