From 7cf533e6d7ab1033d5df7852441adb21240ee0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?= Date: Fri, 21 May 2021 15:00:02 +0200 Subject: [PATCH] Simplify example in README --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7f1f737..df33511 100644 --- a/README.md +++ b/README.md @@ -143,14 +143,9 @@ per segment, which contain next properties: const svgpath = require("svgpath"); const parsePath = require("svg-path-segments"); -const segmentsSVGPath = (iconPath) => { - const segments = parsePath(iconPath); - const SVGPath = svgpath(""); - SVGPath.segments = segments.map(segment => segment.params); - return {segments, SVGPath}; -} - -const {segments, SVGPath} = segmentsSVGPath("M5 6 7 8l3 4z"); +const segments = parsePath(iconPath); +const SVGPath = svgpath(""); +SVGPath.segments = segments.map(segment => segment.params); ``` [npm-link]: https://www.npmjs.com/package/svg-path-segments