PHP 7.4.33
Preview: uint8array-helpers.js.map Size: 3.04 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/next/dist/server/stream-utils/uint8array-helpers.js.map
{"version":3,"sources":["../../../src/server/stream-utils/uint8array-helpers.ts"],"sourcesContent":["/**\n * Find the starting index of Uint8Array `b` within Uint8Array `a`.\n */\nexport function indexOfUint8Array(a: Uint8Array, b: Uint8Array) {\n  if (b.length === 0) return 0\n  if (a.length === 0 || b.length > a.length) return -1\n\n  // start iterating through `a`\n  for (let i = 0; i <= a.length - b.length; i++) {\n    let completeMatch = true\n    // from index `i`, iterate through `b` and check for mismatch\n    for (let j = 0; j < b.length; j++) {\n      // if the values do not match, then this isn't a complete match, exit `b` iteration early and iterate to next index of `a`.\n      if (a[i + j] !== b[j]) {\n        completeMatch = false\n        break\n      }\n    }\n\n    if (completeMatch) {\n      return i\n    }\n  }\n\n  return -1\n}\n\n/**\n * Check if two Uint8Arrays are strictly equivalent.\n */\nexport function isEquivalentUint8Arrays(a: Uint8Array, b: Uint8Array) {\n  if (a.length !== b.length) return false\n\n  for (let i = 0; i < a.length; i++) {\n    if (a[i] !== b[i]) return false\n  }\n\n  return true\n}\n\n/**\n * Remove Uint8Array `b` from Uint8Array `a`.\n *\n * If `b` is not in `a`, `a` is returned unchanged.\n *\n * Otherwise, the function returns a new Uint8Array instance with size `a.length - b.length`\n */\nexport function removeFromUint8Array(a: Uint8Array, b: Uint8Array) {\n  const tagIndex = indexOfUint8Array(a, b)\n  if (tagIndex === 0) return a.subarray(b.length)\n  if (tagIndex > -1) {\n    const removed = new Uint8Array(a.length - b.length)\n    removed.set(a.slice(0, tagIndex))\n    removed.set(a.slice(tagIndex + b.length), tagIndex)\n    return removed\n  } else {\n    return a\n  }\n}\n"],"names":["indexOfUint8Array","isEquivalentUint8Arrays","removeFromUint8Array","a","b","length","i","completeMatch","j","tagIndex","subarray","removed","Uint8Array","set","slice"],"mappings":"AAAA;;CAEC;;;;;;;;;;;;;;;;IACeA,i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AAK,CAACL,WAAWL,EAAEC,MAAM,GAAGI;QAC1C,OAAOE;IACT,OAAO;QACL,OAAOR;IACT;AACF"}

Directory Contents

Dirs: 0 × Files: 9
Name Size Perms Modified Actions
398 B lrw-r--r-- 2025-03-28 11:04:45
Edit Download
1.52 KB lrw-r--r-- 2025-03-28 11:04:40
Edit Download
1.42 KB lrw-r--r-- 2025-03-28 11:04:44
Edit Download
3.03 KB lrw-r--r-- 2025-03-28 11:04:45
Edit Download
21.93 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
32.62 KB lrw-r--r-- 2025-03-28 11:04:44
Edit Download
616 B lrw-r--r-- 2025-03-28 11:04:45
Edit Download
1.99 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
3.04 KB lrw-r--r-- 2025-03-28 11:04:44
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).