From 3c6375670f8d840c1e89a215ba5074f0cbc574f5 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 30 Jan 2025 13:15:45 +0100 Subject: [PATCH] remove dead code --- .../src/utils/third_party/tar/headers.js | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/packages/playwright-core/src/utils/third_party/tar/headers.js b/packages/playwright-core/src/utils/third_party/tar/headers.js index 8e03afc530..b748e22b30 100644 --- a/packages/playwright-core/src/utils/third_party/tar/headers.js +++ b/packages/playwright-core/src/utils/third_party/tar/headers.js @@ -9,19 +9,6 @@ exports.decodeLongPath = function decodeLongPath (buf, encoding) { return decodeStr(buf, 0, buf.length, encoding) } -exports.encodePax = function encodePax (opts) { // TODO: encode more stuff in pax - let result = '' - if (opts.name) result += addLength(' path=' + opts.name + '\n') - if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n') - const pax = opts.pax - if (pax) { - for (const key in pax) { - result += addLength(' ' + key + '=' + pax[key] + '\n') - } - } - return Buffer.from(result) -} - exports.decodePax = function decodePax (buf) { const result = {} @@ -215,11 +202,3 @@ function decodeOct (val, offset, length) { function decodeStr (val, offset, length, encoding) { return val.toString(encoding, offset, indexOf(val, 0, offset, offset + length)) } - -function addLength (str) { - const len = Buffer.byteLength(str) - let digits = Math.floor(Math.log(len) / Math.log(10)) + 1 - if (len + digits >= Math.pow(10, digits)) digits++ - - return (len + digits) + str -}