MCPcopy Index your code
hub / github.com/dataease/SQLBot / sliceFactory

Function sliceFactory

frontend/public/swagger-ui-bundle.js:3297–3351  ·  view source on GitHub ↗
(s, o, i, a)

Source from the content-addressed store, hash-verified

3295 })
3296 }
3297 function sliceFactory(s, o, i, a) {
3298 var u = s.size
3299 if (
3300 (void 0 !== o && (o |= 0),
3301 void 0 !== i && (i === 1 / 0 ? (i = u) : (i |= 0)),
3302 wholeSlice(o, i, u))
3303 )
3304 return s
3305 var _ = resolveBegin(o, u),
3306 w = resolveEnd(i, u)
3307 if (_ != _ || w != w) return sliceFactory(s.toSeq().cacheResult(), o, i, a)
3308 var x,
3309 C = w - _
3310 C == C && (x = C < 0 ? 0 : C)
3311 var j = makeSequence(s)
3312 return (
3313 (j.size = 0 === x ? x : (s.size && x) || void 0),
3314 !a &&
3315 isSeq(s) &&
3316 x >= 0 &&
3317 (j.get = function (o, i) {
3318 return (o = wrapIndex(this, o)) >= 0 && o < x ? s.get(o + _, i) : i
3319 }),
3320 (j.__iterateUncached = function (o, i) {
3321 var u = this
3322 if (0 === x) return 0
3323 if (i) return this.cacheResult().__iterate(o, i)
3324 var w = 0,
3325 C = !0,
3326 j = 0
3327 return (
3328 s.__iterate(function (s, i) {
3329 if (!C || !(C = w++ < _))
3330 return (j++, !1 !== o(s, a ? i : j - 1, u) && j !== x)
3331 }),
3332 j
3333 )
3334 }),
3335 (j.__iteratorUncached = function (o, i) {
3336 if (0 !== x && i) return this.cacheResult().__iterator(o, i)
3337 var u = 0 !== x && s.__iterator(o, i),
3338 w = 0,
3339 C = 0
3340 return new Iterator(function () {
3341 for (; w++ < _; ) u.next()
3342 if (++C > x) return iteratorDone()
3343 var s = u.next()
3344 return a || o === U
3345 ? s
3346 : iteratorValue(o, C - 1, o === $ ? void 0 : s.value[1], s)
3347 })
3348 }),
3349 j
3350 )
3351 }
3352 function takeWhileFactory(s, o, i) {
3353 var a = makeSequence(s)
3354 return (

Callers 1

Calls 11

wholeSliceFunction · 0.85
resolveBeginFunction · 0.85
resolveEndFunction · 0.85
makeSequenceFunction · 0.85
isSeqFunction · 0.85
wrapIndexFunction · 0.85
iteratorDoneFunction · 0.85
iteratorValueFunction · 0.85
nextMethod · 0.80
oFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected