From 79407fcf5e382150372c62a20aa53636a7a7e1b9 Mon Sep 17 00:00:00 2001 From: rosston Date: Thu, 9 Feb 2017 22:09:42 -0500 Subject: [PATCH] Remove lodash.isarray (use native Array.isArray). Other code was already depending on Object.keys() and Array.prototype.filter(), which are also ES5 along with Array.isArray(). --- lib/po.js | 5 ++--- package.json | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/po.js b/lib/po.js index 6407079..d0aed37 100644 --- a/lib/po.js +++ b/lib/po.js @@ -1,5 +1,4 @@ var fs = require('fs'); -var isArray = require('lodash.isarray'); function trim(string) { return string.replace(/^\s+|\s+$/g, ''); @@ -317,12 +316,12 @@ PO.Item.prototype.toString = function () { ['msgctxt', 'msgid', 'msgid_plural', 'msgstr'].forEach(function (keyword) { var text = self[keyword]; if (text != null) { - if (isArray(text) && text.length > 1) { + if (Array.isArray(text) && text.length > 1) { text.forEach(function (t, i) { lines = lines.concat(mkObsolete + _process(keyword, t, i)); }); } else { - text = isArray(text) ? text.join() : text; + text = Array.isArray(text) ? text.join() : text; var processed = _process(keyword, text); //handle \n in single-line texts (can not be handled in _escape) for (var i = 1; i < processed.length - 1; i++) { diff --git a/package.json b/package.json index 8e1651d..04cf97d 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,5 @@ "grunt-jscs": "~3.0.1", "grunt-mocha-cli": "~3.0.0" }, - "dependencies": { - "lodash.isarray": "~2.4.1" - } + "dependencies": {} }