{"ast":null,"code":"'use strict';\n\nmodule.exports = asyncForEach;\n/**\n * Simultaneously processes all items in the given array.\n *\n * @param {array} array - The array to iterate over\n * @param {function} iterator - The function to call for each item in the array\n * @param {function} done - The function to call when all iterators have completed\n */\n\nfunction asyncForEach(array, iterator, done) {\n  if (array.length === 0) {\n    // NOTE: Normally a bad idea to mix sync and async, but it's safe here because\n    // of the way that this method is currently used by DirectoryReader.\n    done();\n    return;\n  } // Simultaneously process all items in the array.\n\n\n  let pending = array.length;\n  array.forEach(item => {\n    iterator(item, () => {\n      if (--pending === 0) {\n        done();\n      }\n    });\n  });\n}","map":{"version":3,"sources":["D:/Development/Work/CENOS/cenos-ui/node_modules/@mrmlnc/readdir-enhanced/lib/async/for-each.js"],"names":["module","exports","asyncForEach","array","iterator","done","length","pending","forEach","item"],"mappings":"AAAA;;AAEAA,MAAM,CAACC,OAAP,GAAiBC,YAAjB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASA,YAAT,CAAuBC,KAAvB,EAA8BC,QAA9B,EAAwCC,IAAxC,EAA8C;AAC5C,MAAIF,KAAK,CAACG,MAAN,KAAiB,CAArB,EAAwB;AACtB;AACA;AACAD,IAAAA,IAAI;AACJ;AACD,GAN2C,CAQ5C;;;AACA,MAAIE,OAAO,GAAGJ,KAAK,CAACG,MAApB;AACAH,EAAAA,KAAK,CAACK,OAAN,CAAcC,IAAI,IAAI;AACpBL,IAAAA,QAAQ,CAACK,IAAD,EAAO,MAAM;AACnB,UAAI,EAAEF,OAAF,KAAc,CAAlB,EAAqB;AACnBF,QAAAA,IAAI;AACL;AACF,KAJO,CAAR;AAKD,GAND;AAOD","sourcesContent":["'use strict';\n\nmodule.exports = asyncForEach;\n\n/**\n * Simultaneously processes all items in the given array.\n *\n * @param {array} array - The array to iterate over\n * @param {function} iterator - The function to call for each item in the array\n * @param {function} done - The function to call when all iterators have completed\n */\nfunction asyncForEach (array, iterator, done) {\n  if (array.length === 0) {\n    // NOTE: Normally a bad idea to mix sync and async, but it's safe here because\n    // of the way that this method is currently used by DirectoryReader.\n    done();\n    return;\n  }\n\n  // Simultaneously process all items in the array.\n  let pending = array.length;\n  array.forEach(item => {\n    iterator(item, () => {\n      if (--pending === 0) {\n        done();\n      }\n    });\n  });\n}\n"]},"metadata":{},"sourceType":"script"}