mirror of
https://github.com/pezkuwichain/pezkuwi-api.git
synced 2026-12-03 18:17:12 +00:00
chore(papi): keep the upstream sources in upstream-src/
The pezkuwi-dev build treats any package with a src/ directory as its own: it requires our license header on every file and builds it. These are upstream files that must stay byte-identical to the source embedded in dist/, so they live in upstream-src/ instead, which neither the build nor the root tsconfig picks up.
This commit is contained in:
1 parent
ea8cb96cea
commit
a9d1026736
65 files changed
+15
-18
No files matched your search
@@ -0,0 +1,25 @@
|
||||
// TODO: deprecate spread overload in papi v2
|
||||
|
||||
interface MergeUint8 {
|
||||
/**
|
||||
* @deprecated This overload will be removed in PAPI v2. Migrate as
|
||||
* follows:
|
||||
* mergeUint8(arr1, arr2) => mergeUint8([arr1, arr2])
|
||||
*/
|
||||
(...inputs: Array<Uint8Array>): Uint8Array
|
||||
(inputs: Array<Uint8Array>): Uint8Array
|
||||
}
|
||||
|
||||
export const mergeUint8: MergeUint8 = (...i) => {
|
||||
const inputs = (Array.isArray(i[0]) ? i[0] : i) as Uint8Array[]
|
||||
const totalLen = inputs.reduce((acc, a) => acc + a.byteLength, 0)
|
||||
const result = new Uint8Array(totalLen)
|
||||
|
||||
for (let idx = 0, at = 0; idx < inputs.length; idx++) {
|
||||
const current = inputs[idx]
|
||||
result.set(current, at)
|
||||
at += current.byteLength
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
Reference in new issue
Block a user