UNPKG

mountain-generator

Version:
13 lines (12 loc) 446 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function default_1(width, height, pointsArray) { const staringPoint = pointsArray.shift(); let svgPath = `M ${staringPoint[0]} ${staringPoint[1]}`; pointsArray.forEach((point) => { svgPath += ` L ${point[0]} ${point[1]}`; }); svgPath += ` L ${width} ${height} L 0 ${height} Z`; return svgPath; } exports.default = default_1;