Extracts Path#simplify() from Paper.js
npm install @santigp258/simplify
or
yarn add @santigp258/simplify
simplifySvgPath(
points: [x: number, y: number][], // `{ x: number, y: number }[]` is also acceptable
{
tolerance: number = 2.5,
precision: number = 5,
} = {}
): string
// SVG path command string such as
// "M10,10c0,3.33333 -2.35702,7.64298 0,10c2.35702,2.35702 6.66667,0 10,0"
This repo is a fork of @luncheon/simplify-svg-path
Also The logic is a copy of Paper.js v0.12.11.