X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Fform-data%2Fnode_modules%2Flodash%2Fcompact.js;fp=node_modules%2Funcss%2Fnode_modules%2Fform-data%2Fnode_modules%2Flodash%2Fcompact.js;h=031fab4e6d5915caa188c714a115985a22acd9c1;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/form-data/node_modules/lodash/compact.js b/node_modules/uncss/node_modules/form-data/node_modules/lodash/compact.js new file mode 100644 index 000000000..031fab4e6 --- /dev/null +++ b/node_modules/uncss/node_modules/form-data/node_modules/lodash/compact.js @@ -0,0 +1,31 @@ +/** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ +function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = compact;