e832b8d29cf04747cbab5b3f05563249.json
7.09 KB
{"ast":null,"code":"var anObject = require('../internals/an-object');\n\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\n\nvar toLength = require('../internals/to-length');\n\nvar bind = require('../internals/function-bind-context');\n\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nvar iteratorClose = require('../internals/iterator-close');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n }\n\n return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable'); // optimisation for array iterators\n\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && result instanceof Result) return result;\n }\n\n return new Result(false);\n }\n\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n\n while (!(step = next.call(iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator);\n throw error;\n }\n\n if (typeof result == 'object' && result && result instanceof Result) return result;\n }\n\n return new Result(false);\n};","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/core-js-pure/internals/iterate.js"],"names":["anObject","require","isArrayIteratorMethod","toLength","bind","getIteratorMethod","iteratorClose","Result","stopped","result","module","exports","iterable","unboundFunction","options","that","AS_ENTRIES","IS_ITERATOR","INTERRUPTED","fn","iterator","iterFn","index","length","next","step","stop","condition","callFn","value","TypeError","call","done","error"],"mappings":"AAAA,IAAIA,QAAQ,GAAGC,OAAO,CAAC,wBAAD,CAAtB;;AACA,IAAIC,qBAAqB,GAAGD,OAAO,CAAC,uCAAD,CAAnC;;AACA,IAAIE,QAAQ,GAAGF,OAAO,CAAC,wBAAD,CAAtB;;AACA,IAAIG,IAAI,GAAGH,OAAO,CAAC,oCAAD,CAAlB;;AACA,IAAII,iBAAiB,GAAGJ,OAAO,CAAC,kCAAD,CAA/B;;AACA,IAAIK,aAAa,GAAGL,OAAO,CAAC,6BAAD,CAA3B;;AAEA,IAAIM,MAAM,GAAG,UAAUC,OAAV,EAAmBC,MAAnB,EAA2B;AACtC,OAAKD,OAAL,GAAeA,OAAf;AACA,OAAKC,MAAL,GAAcA,MAAd;AACD,CAHD;;AAKAC,MAAM,CAACC,OAAP,GAAiB,UAAUC,QAAV,EAAoBC,eAApB,EAAqCC,OAArC,EAA8C;AAC7D,MAAIC,IAAI,GAAGD,OAAO,IAAIA,OAAO,CAACC,IAA9B;AACA,MAAIC,UAAU,GAAG,CAAC,EAAEF,OAAO,IAAIA,OAAO,CAACE,UAArB,CAAlB;AACA,MAAIC,WAAW,GAAG,CAAC,EAAEH,OAAO,IAAIA,OAAO,CAACG,WAArB,CAAnB;AACA,MAAIC,WAAW,GAAG,CAAC,EAAEJ,OAAO,IAAIA,OAAO,CAACI,WAArB,CAAnB;AACA,MAAIC,EAAE,GAAGf,IAAI,CAACS,eAAD,EAAkBE,IAAlB,EAAwB,IAAIC,UAAJ,GAAiBE,WAAzC,CAAb;AACA,MAAIE,QAAJ,EAAcC,MAAd,EAAsBC,KAAtB,EAA6BC,MAA7B,EAAqCd,MAArC,EAA6Ce,IAA7C,EAAmDC,IAAnD;;AAEA,MAAIC,IAAI,GAAG,UAAUC,SAAV,EAAqB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nB,QAAZ,CAAX;AACD;;AAEDY,EAAAA,IAAI,GAAGJ,QAAQ,CAACI,IAAhB;;AACA,SAAO,CAAC,CAACC,IAAI,GAAGD,IAAI,CAACO,IAAL,CAAUX,QAAV,CAAR,EAA6BY,IAArC,EAA2C;AACzC,QAAI;AACFvB,MAAAA,MAAM,GAAGmB,MAAM,CAACH,IAAI,CAACI,KAAN,CAAf;AACD,KAFD,CAEE,OAAOI,KAAP,EAAc;AACd3B,MAAAA,aAAa,CAACc,QAAD,CAAb;AACA,YAAMa,KAAN;AACD;;AACD,QAAI,OAAOxB,MAAP,IAAiB,QAAjB,IAA6BA,MAA7B,IAAuCA,MAAM,YAAYF,MAA7D,EAAqE,OAAOE,MAAP;AACtE;;AAAC,SAAO,IAAIF,MAAJ,CAAW,KAAX,CAAP;AACH,CA7CD","sourcesContent":["var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator);\n throw error;\n }\n if (typeof result == 'object' && result && result instanceof Result) return result;\n } return new Result(false);\n};\n"]},"metadata":{},"sourceType":"script"}