nfroidure / svg-pathdata

Parse SVG PathDatas
MIT License
183 stars 18 forks source link

Functional streams #31

Closed nfroidure closed 6 years ago

nfroidure commented 7 years ago

Streams are nice but introduce an overhead for sync APIs would be great to rewrite the streams paser/stringifyer that way:

function parseSVGPathData(stateObject, chunk) {

  // Parsing

  return [
    newStateObject,
    commands
  ];
}

This would reduce this to a single function call: https://github.com/nfroidure/svg-pathdata/blob/master/src/SVGPathData.js#L122-L136

And allow to create non-NodeJS stream (browser streams for example).