REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.43 KB
Close
/home/byroehnu/.trash/node_modules11/restructure/src/Array.js
Text
Base64
import {Base} from './Base.js'; import {Number as NumberT} from './Number.js'; import * as utils from './utils.js'; class ArrayT extends Base { constructor(type, length, lengthType = 'count') { super(); this.type = type; this.length = length; this.lengthType = lengthType; } decode(stream, parent) { let length; const { pos } = stream; const res = []; let ctx = parent; if (this.length != null) { length = utils.resolveLength(this.length, stream, parent); } if (this.length instanceof NumberT) { // define hidden properties Object.defineProperties(res, { parent: { value: parent }, _startOffset: { value: pos }, _currentOffset: { value: 0, writable: true }, _length: { value: length } }); ctx = res; } if ((length == null) || (this.lengthType === 'bytes')) { const target = (length != null) ? stream.pos + length : (parent != null ? parent._length : undefined) ? parent._startOffset + parent._length : stream.length; while (stream.pos < target) { res.push(this.type.decode(stream, ctx)); } } else { for (let i = 0, end = length; i < end; i++) { res.push(this.type.decode(stream, ctx)); } } return res; } size(array, ctx, includePointers = true) { if (!array) { return this.type.size(null, ctx) * utils.resolveLength(this.length, null, ctx); } let size = 0; if (this.length instanceof NumberT) { size += this.length.size(); ctx = {parent: ctx, pointerSize: 0}; } for (let item of array) { size += this.type.size(item, ctx); } if (ctx && includePointers && this.length instanceof NumberT) { size += ctx.pointerSize; } return size; } encode(stream, array, parent) { let ctx = parent; if (this.length instanceof NumberT) { ctx = { pointers: [], startOffset: stream.pos, parent }; ctx.pointerOffset = stream.pos + this.size(array, ctx, false); this.length.encode(stream, array.length); } for (let item of array) { this.type.encode(stream, item, ctx); } if (this.length instanceof NumberT) { let i = 0; while (i < ctx.pointers.length) { const ptr = ctx.pointers[i++]; ptr.type.encode(stream, ptr.val, ptr.parent); } } } } export {ArrayT as Array};
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 17
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Array.js
2.43 KB
lrw-r--r--
2026-02-14 19:19:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Base.js
412 B
lrw-r--r--
2026-02-14 19:19:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Bitfield.js
741 B
lrw-r--r--
2026-02-14 19:19:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Boolean.js
398 B
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Buffer.js
795 B
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DecodeStream.js
1.85 KB
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
EncodeStream.js
3.13 KB
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Enum.js
533 B
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LazyArray.js
1.62 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Number.js
2.23 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Optional.js
920 B
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Pointer.js
4.09 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Reserved.js
519 B
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
String.js
3.71 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Struct.js
2.33 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.js
723 B
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
VersionedStruct.js
3.01 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).