"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/concat-map/index.js" (7 Feb 2017, 345 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 module.exports = function (xs, fn) {
    2     var res = [];
    3     for (var i = 0; i < xs.length; i++) {
    4         var x = fn(xs[i], i);
    5         if (isArray(x)) res.push.apply(res, x);
    6         else res.push(x);
    7     }
    8     return res;
    9 };
   10 
   11 var isArray = Array.isArray || function (xs) {
   12     return Object.prototype.toString.call(xs) === '[object Array]';
   13 };