app-builder-lib 26.0.0-alpha.2 → 26.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/appInfo.js +1 -1
- package/out/appInfo.js.map +1 -1
- package/out/asar/asarUtil.js +1 -1
- package/out/asar/asarUtil.js.map +1 -1
- package/out/codeSign/windowsCodeSign.js +19 -2
- package/out/codeSign/windowsCodeSign.js.map +1 -1
- package/out/codeSign/windowsSignAzureManager.js +7 -4
- package/out/codeSign/windowsSignAzureManager.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.js.map +1 -1
- package/out/linuxPackager.js +1 -1
- package/out/linuxPackager.js.map +1 -1
- package/out/options/CommonWindowsInstallerConfiguration.js +1 -1
- package/out/options/CommonWindowsInstallerConfiguration.js.map +1 -1
- package/out/options/PlatformSpecificBuildOptions.d.ts +3 -0
- package/out/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/out/options/winOptions.d.ts +17 -1
- package/out/options/winOptions.js.map +1 -1
- package/out/publish/PublishManager.d.ts +1 -1
- package/out/publish/PublishManager.js +10 -16
- package/out/publish/PublishManager.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/out/winPackager.d.ts +1 -2
- package/out/winPackager.js +12 -22
- package/out/winPackager.js.map +1 -1
- package/package.json +7 -9
- package/scheme.json +29 -6
- package/out/publish/BitbucketPublisher.d.ts +0 -16
- package/out/publish/BitbucketPublisher.js +0 -60
- package/out/publish/BitbucketPublisher.js.map +0 -1
- package/out/publish/KeygenPublisher.d.ts +0 -101
- package/out/publish/KeygenPublisher.js +0 -165
- package/out/publish/KeygenPublisher.js.map +0 -1
- package/out/publish/SnapStorePublisher.d.ts +0 -9
- package/out/publish/SnapStorePublisher.js +0 -35
- package/out/publish/SnapStorePublisher.js.map +0 -1
- package/out/publish/s3/BaseS3Publisher.d.ts +0 -10
- package/out/publish/s3/BaseS3Publisher.js +0 -64
- package/out/publish/s3/BaseS3Publisher.js.map +0 -1
- package/out/publish/s3/s3Publisher.d.ts +0 -12
- package/out/publish/s3/s3Publisher.js +0 -66
- package/out/publish/s3/s3Publisher.js.map +0 -1
- package/out/publish/s3/spacesPublisher.d.ts +0 -11
- package/out/publish/s3/spacesPublisher.js +0 -44
- package/out/publish/s3/spacesPublisher.js.map +0 -1
- package/out/util/filename.d.ts +0 -2
- package/out/util/filename.js +0 -39
- package/out/util/filename.js.map +0 -1
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const builder_util_1 = require("builder-util");
|
|
4
|
-
const BaseS3Publisher_1 = require("./BaseS3Publisher");
|
|
5
|
-
class S3Publisher extends BaseS3Publisher_1.BaseS3Publisher {
|
|
6
|
-
constructor(context, info) {
|
|
7
|
-
super(context, info);
|
|
8
|
-
this.info = info;
|
|
9
|
-
this.providerName = "s3";
|
|
10
|
-
}
|
|
11
|
-
static async checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot) {
|
|
12
|
-
const bucket = options.bucket;
|
|
13
|
-
if (bucket == null) {
|
|
14
|
-
throw new builder_util_1.InvalidConfigurationError(`Please specify "bucket" for "s3" publish provider`);
|
|
15
|
-
}
|
|
16
|
-
if (options.endpoint == null && bucket.includes(".") && options.region == null) {
|
|
17
|
-
// on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.
|
|
18
|
-
try {
|
|
19
|
-
options.region = await (0, builder_util_1.executeAppBuilder)(["get-bucket-location", "--bucket", bucket]);
|
|
20
|
-
}
|
|
21
|
-
catch (e) {
|
|
22
|
-
if (errorIfCannot) {
|
|
23
|
-
throw e;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
builder_util_1.log.warn(`cannot compute region for bucket (required because on dotted bucket names, we need to use a path-based endpoint URL): ${e}`);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (options.channel == null && channelFromAppVersion != null) {
|
|
31
|
-
options.channel = channelFromAppVersion;
|
|
32
|
-
}
|
|
33
|
-
if (options.endpoint != null && options.endpoint.endsWith("/")) {
|
|
34
|
-
;
|
|
35
|
-
options.endpoint = options.endpoint.slice(0, -1);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
getBucketName() {
|
|
39
|
-
return this.info.bucket;
|
|
40
|
-
}
|
|
41
|
-
configureS3Options(args) {
|
|
42
|
-
super.configureS3Options(args);
|
|
43
|
-
if (this.info.endpoint != null) {
|
|
44
|
-
args.push("--endpoint", this.info.endpoint);
|
|
45
|
-
}
|
|
46
|
-
if (this.info.region != null) {
|
|
47
|
-
args.push("--region", this.info.region);
|
|
48
|
-
}
|
|
49
|
-
if (this.info.storageClass != null) {
|
|
50
|
-
args.push("--storageClass", this.info.storageClass);
|
|
51
|
-
}
|
|
52
|
-
if (this.info.encryption != null) {
|
|
53
|
-
args.push("--encryption", this.info.encryption);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
toString() {
|
|
57
|
-
const result = super.toString();
|
|
58
|
-
const endpoint = this.info.endpoint;
|
|
59
|
-
if (endpoint != null) {
|
|
60
|
-
return result.substring(0, result.length - 1) + `, endpoint: ${endpoint})`;
|
|
61
|
-
}
|
|
62
|
-
return result;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.default = S3Publisher;
|
|
66
|
-
//# sourceMappingURL=s3Publisher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"s3Publisher.js","sourceRoot":"","sources":["../../../src/publish/s3/s3Publisher.ts"],"names":[],"mappings":"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","sourcesContent":["import { executeAppBuilder, InvalidConfigurationError, log } from \"builder-util\"\nimport { S3Options } from \"builder-util-runtime\"\nimport { PublishContext } from \"electron-publish\"\nimport { BaseS3Publisher } from \"./BaseS3Publisher\"\n\nexport default class S3Publisher extends BaseS3Publisher {\n readonly providerName = \"s3\"\n\n constructor(\n context: PublishContext,\n private readonly info: S3Options\n ) {\n super(context, info)\n }\n\n static async checkAndResolveOptions(options: S3Options, channelFromAppVersion: string | null, errorIfCannot: boolean) {\n const bucket = options.bucket\n if (bucket == null) {\n throw new InvalidConfigurationError(`Please specify \"bucket\" for \"s3\" publish provider`)\n }\n\n if (options.endpoint == null && bucket.includes(\".\") && options.region == null) {\n // on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.\n try {\n options.region = await executeAppBuilder([\"get-bucket-location\", \"--bucket\", bucket])\n } catch (e: any) {\n if (errorIfCannot) {\n throw e\n } else {\n log.warn(`cannot compute region for bucket (required because on dotted bucket names, we need to use a path-based endpoint URL): ${e}`)\n }\n }\n }\n\n if (options.channel == null && channelFromAppVersion != null) {\n options.channel = channelFromAppVersion\n }\n\n if (options.endpoint != null && options.endpoint.endsWith(\"/\")) {\n ;(options as any).endpoint = options.endpoint.slice(0, -1)\n }\n }\n\n protected getBucketName(): string {\n return this.info.bucket\n }\n\n protected configureS3Options(args: Array<string>): void {\n super.configureS3Options(args)\n\n if (this.info.endpoint != null) {\n args.push(\"--endpoint\", this.info.endpoint)\n }\n if (this.info.region != null) {\n args.push(\"--region\", this.info.region)\n }\n\n if (this.info.storageClass != null) {\n args.push(\"--storageClass\", this.info.storageClass)\n }\n if (this.info.encryption != null) {\n args.push(\"--encryption\", this.info.encryption)\n }\n }\n\n toString() {\n const result = super.toString()\n const endpoint = this.info.endpoint\n if (endpoint != null) {\n return result.substring(0, result.length - 1) + `, endpoint: ${endpoint})`\n }\n return result\n }\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SpacesOptions } from "builder-util-runtime";
|
|
2
|
-
import { PublishContext } from "electron-publish";
|
|
3
|
-
import { BaseS3Publisher } from "./BaseS3Publisher";
|
|
4
|
-
export default class SpacesPublisher extends BaseS3Publisher {
|
|
5
|
-
private readonly info;
|
|
6
|
-
readonly providerName = "spaces";
|
|
7
|
-
constructor(context: PublishContext, info: SpacesOptions);
|
|
8
|
-
static checkAndResolveOptions(options: SpacesOptions, channelFromAppVersion: string | null, errorIfCannot: boolean): Promise<void>;
|
|
9
|
-
protected getBucketName(): string;
|
|
10
|
-
protected configureS3Options(args: Array<string>): void;
|
|
11
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const builder_util_1 = require("builder-util");
|
|
4
|
-
const BaseS3Publisher_1 = require("./BaseS3Publisher");
|
|
5
|
-
class SpacesPublisher extends BaseS3Publisher_1.BaseS3Publisher {
|
|
6
|
-
constructor(context, info) {
|
|
7
|
-
super(context, info);
|
|
8
|
-
this.info = info;
|
|
9
|
-
this.providerName = "spaces";
|
|
10
|
-
}
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12
|
-
static checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot) {
|
|
13
|
-
if (options.name == null) {
|
|
14
|
-
throw new builder_util_1.InvalidConfigurationError(`Please specify "name" for "spaces" publish provider (see https://www.electron.build/publish#spacesoptions)`);
|
|
15
|
-
}
|
|
16
|
-
if (options.region == null) {
|
|
17
|
-
throw new builder_util_1.InvalidConfigurationError(`Please specify "region" for "spaces" publish provider (see https://www.electron.build/publish#spacesoptions)`);
|
|
18
|
-
}
|
|
19
|
-
if (options.channel == null && channelFromAppVersion != null) {
|
|
20
|
-
options.channel = channelFromAppVersion;
|
|
21
|
-
}
|
|
22
|
-
return Promise.resolve();
|
|
23
|
-
}
|
|
24
|
-
getBucketName() {
|
|
25
|
-
return this.info.name;
|
|
26
|
-
}
|
|
27
|
-
configureS3Options(args) {
|
|
28
|
-
super.configureS3Options(args);
|
|
29
|
-
args.push("--endpoint", `${this.info.region}.digitaloceanspaces.com`);
|
|
30
|
-
args.push("--region", this.info.region);
|
|
31
|
-
const accessKey = process.env.DO_KEY_ID;
|
|
32
|
-
const secretKey = process.env.DO_SECRET_KEY;
|
|
33
|
-
if ((0, builder_util_1.isEmptyOrSpaces)(accessKey)) {
|
|
34
|
-
throw new builder_util_1.InvalidConfigurationError("Please set env DO_KEY_ID (see https://www.electron.build/publish#spacesoptions)");
|
|
35
|
-
}
|
|
36
|
-
if ((0, builder_util_1.isEmptyOrSpaces)(secretKey)) {
|
|
37
|
-
throw new builder_util_1.InvalidConfigurationError("Please set env DO_SECRET_KEY (see https://www.electron.build/publish#spacesoptions)");
|
|
38
|
-
}
|
|
39
|
-
args.push("--accessKey", accessKey);
|
|
40
|
-
args.push("--secretKey", secretKey);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.default = SpacesPublisher;
|
|
44
|
-
//# sourceMappingURL=spacesPublisher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spacesPublisher.js","sourceRoot":"","sources":["../../../src/publish/s3/spacesPublisher.ts"],"names":[],"mappings":";;AAAA,+CAAyE;AAGzE,uDAAmD;AAEnD,MAAqB,eAAgB,SAAQ,iCAAe;IAG1D,YACE,OAAuB,EACN,IAAmB;QAEpC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QAFH,SAAI,GAAJ,IAAI,CAAe;QAJ7B,iBAAY,GAAG,QAAQ,CAAA;IAOhC,CAAC;IAED,6DAA6D;IAC7D,MAAM,CAAC,sBAAsB,CAAC,OAAsB,EAAE,qBAAoC,EAAE,aAAsB;QAChH,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YACzB,MAAM,IAAI,wCAAyB,CAAC,4GAA4G,CAAC,CAAA;QACnJ,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;YAC3B,MAAM,IAAI,wCAAyB,CAAC,8GAA8G,CAAC,CAAA;QACrJ,CAAC;QAED,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,IAAI,qBAAqB,IAAI,IAAI,EAAE,CAAC;YAC7D,OAAO,CAAC,OAAO,GAAG,qBAAqB,CAAA;QACzC,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;IACvB,CAAC;IAES,kBAAkB,CAAC,IAAmB;QAC9C,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAE9B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,yBAAyB,CAAC,CAAA;QACrE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAEvC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAA;QACvC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAA;QAC3C,IAAI,IAAA,8BAAe,EAAC,SAAS,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,wCAAyB,CAAC,iFAAiF,CAAC,CAAA;QACxH,CAAC;QACD,IAAI,IAAA,8BAAe,EAAC,SAAS,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,wCAAyB,CAAC,qFAAqF,CAAC,CAAA;QAC5H,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;QACnC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;IACrC,CAAC;CACF;AA9CD,kCA8CC","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces } from \"builder-util\"\nimport { SpacesOptions } from \"builder-util-runtime\"\nimport { PublishContext } from \"electron-publish\"\nimport { BaseS3Publisher } from \"./BaseS3Publisher\"\n\nexport default class SpacesPublisher extends BaseS3Publisher {\n readonly providerName = \"spaces\"\n\n constructor(\n context: PublishContext,\n private readonly info: SpacesOptions\n ) {\n super(context, info)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static checkAndResolveOptions(options: SpacesOptions, channelFromAppVersion: string | null, errorIfCannot: boolean) {\n if (options.name == null) {\n throw new InvalidConfigurationError(`Please specify \"name\" for \"spaces\" publish provider (see https://www.electron.build/publish#spacesoptions)`)\n }\n if (options.region == null) {\n throw new InvalidConfigurationError(`Please specify \"region\" for \"spaces\" publish provider (see https://www.electron.build/publish#spacesoptions)`)\n }\n\n if (options.channel == null && channelFromAppVersion != null) {\n options.channel = channelFromAppVersion\n }\n return Promise.resolve()\n }\n\n protected getBucketName(): string {\n return this.info.name\n }\n\n protected configureS3Options(args: Array<string>): void {\n super.configureS3Options(args)\n\n args.push(\"--endpoint\", `${this.info.region}.digitaloceanspaces.com`)\n args.push(\"--region\", this.info.region)\n\n const accessKey = process.env.DO_KEY_ID\n const secretKey = process.env.DO_SECRET_KEY\n if (isEmptyOrSpaces(accessKey)) {\n throw new InvalidConfigurationError(\"Please set env DO_KEY_ID (see https://www.electron.build/publish#spacesoptions)\")\n }\n if (isEmptyOrSpaces(secretKey)) {\n throw new InvalidConfigurationError(\"Please set env DO_SECRET_KEY (see https://www.electron.build/publish#spacesoptions)\")\n }\n args.push(\"--accessKey\", accessKey)\n args.push(\"--secretKey\", secretKey)\n }\n}\n"]}
|
package/out/util/filename.d.ts
DELETED
package/out/util/filename.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sanitizeFileName = sanitizeFileName;
|
|
4
|
-
exports.getCompleteExtname = getCompleteExtname;
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
const _sanitizeFileName = require("sanitize-filename");
|
|
7
|
-
const path = require("path");
|
|
8
|
-
function sanitizeFileName(s, normalizeNfd = false) {
|
|
9
|
-
const sanitized = _sanitizeFileName(s);
|
|
10
|
-
return normalizeNfd ? sanitized.normalize("NFD") : sanitized;
|
|
11
|
-
}
|
|
12
|
-
// Get the filetype from a filename. Returns a string of one or more file extensions,
|
|
13
|
-
// e.g. .zip, .dmg, .tar.gz, .tar.bz2, .exe.blockmap. We'd normally use `path.extname()`,
|
|
14
|
-
// but it doesn't support multiple extensions, e.g. Foo-1.0.0.dmg.blockmap should be
|
|
15
|
-
// .dmg.blockmap, not .blockmap.
|
|
16
|
-
function getCompleteExtname(filename) {
|
|
17
|
-
let extname = path.extname(filename);
|
|
18
|
-
switch (extname) {
|
|
19
|
-
// Append leading extension for blockmap filetype
|
|
20
|
-
case ".blockmap": {
|
|
21
|
-
extname = path.extname(filename.replace(extname, "")) + extname;
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
// Append leading extension for known compressed tar formats
|
|
25
|
-
case ".bz2":
|
|
26
|
-
case ".gz":
|
|
27
|
-
case ".lz":
|
|
28
|
-
case ".xz":
|
|
29
|
-
case ".7z": {
|
|
30
|
-
const ext = path.extname(filename.replace(extname, ""));
|
|
31
|
-
if (ext === ".tar") {
|
|
32
|
-
extname = ext + extname;
|
|
33
|
-
}
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return extname;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=filename.js.map
|
package/out/util/filename.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filename.js","sourceRoot":"","sources":["../../src/util/filename.ts"],"names":[],"mappings":";;AAIA,4CAGC;AAMD,gDA0BC;AAvCD,aAAa;AACb,uDAAsD;AACtD,6BAA4B;AAE5B,SAAgB,gBAAgB,CAAC,CAAS,EAAE,YAAY,GAAG,KAAK;IAC9D,MAAM,SAAS,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAA;IACtC,OAAO,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAC9D,CAAC;AAED,qFAAqF;AACrF,yFAAyF;AACzF,oFAAoF;AACpF,gCAAgC;AAChC,SAAgB,kBAAkB,CAAC,QAAgB;IACjD,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAEpC,QAAQ,OAAO,EAAE,CAAC;QAChB,iDAAiD;QACjD,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,GAAG,OAAO,CAAA;YAE/D,MAAK;QACP,CAAC;QACD,4DAA4D;QAC5D,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;YACvD,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;gBACnB,OAAO,GAAG,GAAG,GAAG,OAAO,CAAA;YACzB,CAAC;YAED,MAAK;QACP,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["// @ts-ignore\nimport * as _sanitizeFileName from \"sanitize-filename\"\nimport * as path from \"path\"\n\nexport function sanitizeFileName(s: string, normalizeNfd = false): string {\n const sanitized = _sanitizeFileName(s)\n return normalizeNfd ? sanitized.normalize(\"NFD\") : sanitized\n}\n\n// Get the filetype from a filename. Returns a string of one or more file extensions,\n// e.g. .zip, .dmg, .tar.gz, .tar.bz2, .exe.blockmap. We'd normally use `path.extname()`,\n// but it doesn't support multiple extensions, e.g. Foo-1.0.0.dmg.blockmap should be\n// .dmg.blockmap, not .blockmap.\nexport function getCompleteExtname(filename: string): string {\n let extname = path.extname(filename)\n\n switch (extname) {\n // Append leading extension for blockmap filetype\n case \".blockmap\": {\n extname = path.extname(filename.replace(extname, \"\")) + extname\n\n break\n }\n // Append leading extension for known compressed tar formats\n case \".bz2\":\n case \".gz\":\n case \".lz\":\n case \".xz\":\n case \".7z\": {\n const ext = path.extname(filename.replace(extname, \"\"))\n if (ext === \".tar\") {\n extname = ext + extname\n }\n\n break\n }\n }\n\n return extname\n}\n"]}
|