forked from dawidd6/action-download-artifact
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
148 lines (119 loc) · 3.1 KB
/
Copy pathindex.js
File metadata and controls
148 lines (119 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
function isBuffer (value) {
return Buffer.isBuffer(value) || value instanceof Uint8Array
}
function isEncoding (encoding) {
return Buffer.isEncoding(encoding)
}
function alloc (size, fill, encoding) {
return Buffer.alloc(size, fill, encoding)
}
function allocUnsafe (size) {
return Buffer.allocUnsafe(size)
}
function allocUnsafeSlow (size) {
return Buffer.allocUnsafeSlow(size)
}
function byteLength (string, encoding) {
return Buffer.byteLength(string, encoding)
}
function compare (a, b) {
return Buffer.compare(a, b)
}
function concat (buffers, totalLength) {
return Buffer.concat(buffers, totalLength)
}
function copy (source, target, targetStart, start, end) {
return toBuffer(source).copy(target, targetStart, start, end)
}
function equals (a, b) {
return toBuffer(a).equals(b)
}
function fill (buffer, value, offset, end, encoding) {
return toBuffer(buffer).fill(value, offset, end, encoding)
}
function from (value, encodingOrOffset, length) {
return Buffer.from(value, encodingOrOffset, length)
}
function includes (buffer, value, byteOffset, encoding) {
return toBuffer(buffer).includes(value, byteOffset, encoding)
}
function indexOf (buffer, value, byfeOffset, encoding) {
return toBuffer(buffer).indexOf(value, byfeOffset, encoding)
}
function lastIndexOf (buffer, value, byteOffset, encoding) {
return toBuffer(buffer).lastIndexOf(value, byteOffset, encoding)
}
function swap16 (buffer) {
return toBuffer(buffer).swap16()
}
function swap32 (buffer) {
return toBuffer(buffer).swap32()
}
function swap64 (buffer) {
return toBuffer(buffer).swap64()
}
function toBuffer (buffer) {
if (Buffer.isBuffer(buffer)) return buffer
return Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength)
}
function toString (buffer, encoding, start, end) {
return toBuffer(buffer).toString(encoding, start, end)
}
function write (buffer, string, offset, length, encoding) {
return toBuffer(buffer).write(string, offset, length, encoding)
}
function writeDoubleLE (buffer, value, offset) {
return toBuffer(buffer).writeDoubleLE(value, offset)
}
function writeFloatLE (buffer, value, offset) {
return toBuffer(buffer).writeFloatLE(value, offset)
}
function writeUInt32LE (buffer, value, offset) {
return toBuffer(buffer).writeUInt32LE(value, offset)
}
function writeInt32LE (buffer, value, offset) {
return toBuffer(buffer).writeInt32LE(value, offset)
}
function readDoubleLE (buffer, offset) {
return toBuffer(buffer).readDoubleLE(offset)
}
function readFloatLE (buffer, offset) {
return toBuffer(buffer).readFloatLE(offset)
}
function readUInt32LE (buffer, offset) {
return toBuffer(buffer).readUInt32LE(offset)
}
function readInt32LE (buffer, offset) {
return toBuffer(buffer).readInt32LE(offset)
}
module.exports = {
isBuffer,
isEncoding,
alloc,
allocUnsafe,
allocUnsafeSlow,
byteLength,
compare,
concat,
copy,
equals,
fill,
from,
includes,
indexOf,
lastIndexOf,
swap16,
swap32,
swap64,
toBuffer,
toString,
write,
writeDoubleLE,
writeFloatLE,
writeUInt32LE,
writeInt32LE,
readDoubleLE,
readFloatLE,
readUInt32LE,
readInt32LE
}