UNPKG

@zsnout/ithkuil

Version:

A set of tools which can generate and parse romanized Ithkuil text and which can generate Ithkuil script from text and JSON data.

10 lines (9 loc) 265 B
/** * Flips X and Y coordinates in an SVG path, ignoring capital M commands. * * @param path The path to be modified. * @returns The resulting path. */ export function flipXY(path) { return path.replace(/(?<!M[\s\d.-]+)([\d.-]+)\s+([\d.-]+)/g, "$2 $1"); }