From f56544a530c729426ea6f61b28ef71f0ae8fe7de Mon Sep 17 00:00:00 2001 From: Jan Marsch Date: Fri, 10 Jun 2016 01:37:39 +0200 Subject: [PATCH] lint fixes --- Gruntfile.js | 2 ++ dist/Triangulate.js | 11 ++++++----- lib/earcut.custom.js | 5 +++-- package.json | 4 ++-- src/parseColor.js | 6 +++--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9e7b7a8..16f5ea9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,6 +9,8 @@ module.exports = function(grunt) { globals: {} }, all: [ + 'src/parseColor.js', + 'lib/earcut.custom.js', 'src/vec2.js', 'src/vec3.js', 'src/split.js', diff --git a/dist/Triangulate.js b/dist/Triangulate.js index ee225ec..f68c1b5 100644 --- a/dist/Triangulate.js +++ b/dist/Triangulate.js @@ -150,7 +150,7 @@ var w3cColors = { yellowgreen: '#9acd32' }; -var parseColor = exports = function(str) { +function parseColor(str) { str = str || ''; str = str.toLowerCase(); str = w3cColors[str] || str; @@ -168,9 +168,9 @@ var parseColor = exports = function(str) { parseInt(m[1], 10)/255, parseInt(m[2], 10)/255, parseInt(m[3], 10)/255 - ] + ]; } -}; +} var earcut = (function() { @@ -765,10 +765,11 @@ var earcut = (function() { earcut.deviation = function(data, holeIndices, dim, triangles) { var hasHoles = holeIndices && holeIndices.length; var outerLen = hasHoles ? holeIndices[0]*dim : data.length; + var i, len; var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim)); if (hasHoles) { - for (var i = 0, len = holeIndices.length; i