Kargi-Sitesi/.angular/cache/16.2.16/babel-webpack/fd4c03b891293b5092711144556723050be7de4cc91d4c8f7086dbb3785e763b.json

1 line
6.8 KiB
JSON
Raw Normal View History

2024-10-31 19:07:58 +00:00
{"ast":null,"code":"import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { map } from '../operators/map';\nimport { isObject } from '../util/isObject';\nimport { from } from './from';\nexport function forkJoin(...sources) {\n if (sources.length === 1) {\n const first = sources[0];\n if (isArray(first)) {\n return forkJoinInternal(first, null);\n }\n if (isObject(first) && Object.getPrototypeOf(first) === Object.prototype) {\n const keys = Object.keys(first);\n return forkJoinInternal(keys.map(key => first[key]), keys);\n }\n }\n if (typeof sources[sources.length - 1] === 'function') {\n const resultSelector = sources.pop();\n sources = sources.length === 1 && isArray(sources[0]) ? sources[0] : sources;\n return forkJoinInternal(sources, null).pipe(map(args => resultSelector(...args)));\n }\n return forkJoinInternal(sources, null);\n}\nfunction forkJoinInternal(sources, keys) {\n return new Observable(subscriber => {\n const len = sources.length;\n if (len === 0) {\n subscriber.complete();\n return;\n }\n const values = new Array(len);\n let completed = 0;\n let emitted = 0;\n for (let i = 0; i < len; i++) {\n const source = from(sources[i]);\n let hasValue = false;\n subscriber.add(source.subscribe({\n next: value => {\n if (!hasValue) {\n hasValue = true;\n emitted++;\n }\n values[i] = value;\n },\n error: err => subscriber.error(err),\n complete: () => {\n completed++;\n if (completed === len || !hasValue) {\n if (emitted === len) {\n subscriber.next(keys ? keys.reduce((result, key, i) => (result[key] = values[i], result), {}) : values);\n }\n subscriber.complete();\n }\n }\n }));\n }\n });\n}","map":{"version":3,"names":["Observable","isArray","map","isObject","from","forkJoin","sources","length","first","forkJoinInternal","Object","getPrototypeOf","prototype","keys","key","resultSelector","pop","pipe","args","subscriber","len","complete","values","Array","completed","emitted","i","source","hasValue","add","subscribe","next","value","error","err","reduce","result"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/observable/forkJoin.js"],"sourcesContent":["import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { map } from '../operators/map';\nimport { isObject } from '../util/isObject';\nimport { from } from './from';\nexport function forkJoin(...sources) {\n if (sources.length === 1) {\n const first = sources[0];\n if (isArray(first)) {\n return forkJoinInternal(first, null);\n }\n if (isObject(first) && Object.getPrototypeOf(first) === Object.prototype) {\n const keys = Object.keys(first);\n return forkJoinInternal(keys.map(key => first[key]), keys);\n }\n }\n if (typeof sources[sources.length - 1] === 'function') {\n const resultSelector = sources.pop();\n sources = (sources.length === 1 && isArray(sources[0])) ? sources[0] : sources;\n return forkJoinInternal(sources, null).pipe(map((args) => resultSelector(...args)));\n }\n return forkJoinInternal(sources, null);\n}\nfunction forkJoinInternal(sources, keys) {\n return new Observable(subscriber => {\n const len = sources.length;\n if (len === 0) {\n subscriber.complete();\n return;\n }\n const values = new Array(len);\n let completed = 0;\n let emitted = 0;\n for (let i = 0; i < len; i++) {\n const source = from(sources[i]);\n let hasValue = false;\n subscriber.add(source.subscribe({\n next: value => {\n if (!hasValue) {\n hasValue = true;\n emitted++;\n }\n