@@ -9,16 +9,16 @@ import * as utils from './utils';
99 * can create three kinds of headers: FILE, DIRECTORY, and EXTENDED. The file and
1010 * directory is expected, but the extended header is able to store additional
1111 * metadata that does not fit in the standard header.
12- *
12+ *
1313 * This class can also be used to generate data chunks padded to 512 bytes. Note
1414 * that the chunk size shouldn't exceed 512 bytes.
15- *
15+ *
1616 * Note that the generator maintains an internal state and must be used for
1717 * operations like generating data chunks, end chunks, or headers, otherwise an
1818 * error will be thrown.
19- *
19+ *
2020 * For reference, this is the structure of a tar header.
21- *
21+ *
2222 * | Start | Size | Description |
2323 * |--------|------|-----------------------------------------------------------|
2424 * | 0 | 100 | File name (first 100 bytes) |
@@ -51,17 +51,17 @@ import * as utils from './utils';
5151 * The device major and minor are specific to linux kernel, which is not
5252 * relevant to this virtual tar implementation. This is the reason these fields
5353 * have been left blank.
54- *
54+ *
5555 * The data for extended headers is formatted slightly differently, with the
5656 * general format following this structure.
5757 * <size> <key>=<value>\n
58- *
58+ *
5959 * Here, the <size> stands for the byte length of the entire line (including the
6060 * size number itself, the space, the equals, and the \n). Unlike in regular
6161 * strings, the end marker for a key-value pair is the \n (newline) character.
6262 * Moreover, unlike the USTAR header, the numbers are written in stringified
6363 * decimal format.
64- *
64+ *
6565 * The key can be any supported metadata key, and the value is binary data
6666 * storing the actual value. These are the currently supported keys for
6767 * the extended metadata:
@@ -135,13 +135,13 @@ class Generator {
135135 * If the file path is longer than 255 characters, then an error will be
136136 * thrown. An extended header needs to be generated first, then the file path
137137 * can be set to an empty string.
138- *
138+ *
139139 * The content of the file must follow this header in separate chunks.
140- *
140+ *
141141 * @param filePath the path of the file relative to the tar root
142142 * @param stat the stats of the file
143143 * @returns one 512-byte chunk corresponding to the header
144- *
144+ *
145145 * @see {@link generateExtended } for generating headers with extended metadata
146146 * @see {@link generateDirectory } for generating directory headers instead
147147 * @see {@link generateData } for generating data chunks
@@ -178,11 +178,11 @@ class Generator {
178178 * the size is ignored and set to 0 for directories. If the file path is longer
179179 * than 255 characters, then an error will be thrown. An extended header needs
180180 * to be generated first, then the file path can be set to an empty string.
181- *
181+ *
182182 * @param filePath the path of the file relative to the tar root
183183 * @param stat the stats of the file
184184 * @returns one 512-byte chunk corresponding to the header
185- *
185+ *
186186 * @see {@link generateExtended } for generating headers with extended metadata
187187 * @see {@link generateFile } for generating file headers instead
188188 */
@@ -207,7 +207,7 @@ class Generator {
207207 * Generates an extended metadata header based on the total size of the data
208208 * following the header. If there is no need for extended metadata, then avoid
209209 * using this, as it would just waste space.
210- *
210+ *
211211 * @param size the size of the binary data block containing the metadata
212212 * @returns one 512-byte chunk corresponding to the header
213213 */
@@ -230,13 +230,13 @@ class Generator {
230230 * file size is 1023 bytes, then you need to provide a 512-byte chunk first,
231231 * then provide the remaining 511-byte chunk later. You can not chunk it up
232232 * like sending over the first 100 bytes, then sending over the next 512.
233- *
233+ *
234234 * This method is used to generate blocks for both a file and the exnteded
235235 * header.
236- *
236+ *
237237 * @param data a block of binary data (512-bytes at largest)
238238 * @returns one 512-byte padded chunk corresponding to the data block
239- *
239+ *
240240 * @see {@link generateExtended } for generating headers with extended metadata
241241 * @see {@link generateFile } for generating file headers preceeding data block
242242 */
@@ -282,7 +282,7 @@ class Generator {
282282 * Generates a null chunk. Two invocations are needed to create a valid
283283 * archive end marker. After two invocations, the generator state will be
284284 * set to ENDED and no further data can be fed through the generator.
285- *
285+ *
286286 * @returns one 512-byte null chunk
287287 */
288288 generateEnd ( ) : Uint8Array {
0 commit comments