@ms-cloudpack/config 0.25.1 → 0.26.1
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/lib/readGeneratedConfig.d.ts.map +1 -1
- package/lib/readGeneratedConfig.js +1 -23
- package/lib/readGeneratedConfig.js.map +1 -1
- package/lib/sortGeneratedConfig.d.ts.map +1 -1
- package/lib/sortGeneratedConfig.js +4 -4
- package/lib/sortGeneratedConfig.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/writeGeneratedConfig.d.ts +15 -2
- package/lib/writeGeneratedConfig.d.ts.map +1 -1
- package/lib/writeGeneratedConfig.js +25 -4
- package/lib/writeGeneratedConfig.js.map +1 -1
- package/package.json +4 -4
- package/lib/compareOverrides.d.ts +0 -3
- package/lib/compareOverrides.d.ts.map +0 -1
- package/lib/compareOverrides.js +0 -9
- package/lib/compareOverrides.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readGeneratedConfig.d.ts","sourceRoot":"","sources":["../src/readGeneratedConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"readGeneratedConfig.d.ts","sourceRoot":"","sources":["../src/readGeneratedConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAInF"}
|
|
@@ -8,28 +8,6 @@ import { getConfigPath } from './getConfigPath.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export async function readGeneratedConfig(appPath) {
|
|
10
10
|
const { generatedConfigPath } = getConfigPath(appPath);
|
|
11
|
-
return
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Delete deprecated values and convert them to the new format. Note that this function
|
|
15
|
-
* mutates the passed-in config object to avoid reallocation.
|
|
16
|
-
*/
|
|
17
|
-
function processDeprecatedValues(config) {
|
|
18
|
-
// eslint-disable-next-line etc/no-deprecated
|
|
19
|
-
const { packageOverrides } = config;
|
|
20
|
-
// Convert package overrides into settings to preserve the deprecated support.
|
|
21
|
-
if (packageOverrides) {
|
|
22
|
-
config.packageSettings = config.packageSettings || [];
|
|
23
|
-
for (const override of packageOverrides) {
|
|
24
|
-
const settings = {
|
|
25
|
-
match: { name: override.name, version: override.versionRequirement },
|
|
26
|
-
exports: override.overrides.exports,
|
|
27
|
-
};
|
|
28
|
-
config.packageSettings.push(settings);
|
|
29
|
-
}
|
|
30
|
-
// eslint-disable-next-line etc/no-deprecated
|
|
31
|
-
delete config.packageOverrides;
|
|
32
|
-
}
|
|
33
|
-
return config;
|
|
11
|
+
return (await readJson(generatedConfigPath, { throwOnError: true, mode: 'permissive' })) || {};
|
|
34
12
|
}
|
|
35
13
|
//# sourceMappingURL=readGeneratedConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readGeneratedConfig.js","sourceRoot":"","sources":["../src/readGeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACvD,MAAM,EAAE,mBAAmB,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAEvD,OAAO,
|
|
1
|
+
{"version":3,"file":"readGeneratedConfig.js","sourceRoot":"","sources":["../src/readGeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACvD,MAAM,EAAE,mBAAmB,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAEvD,OAAO,CAAC,MAAM,QAAQ,CAAC,mBAAmB,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACjG,CAAC","sourcesContent":["import { readJson } from '@ms-cloudpack/json-utilities';\nimport { getConfigPath } from './getConfigPath.js';\nimport type { GeneratedConfig } from '@ms-cloudpack/common-types';\n\n/**\n * Reads the generated config file asynchronously. This is only useful for the `init` verb generating or updated\n * the generated overrides. For a full merged representation of config, use `readConfig` instead.\n *\n * Throws an error if the config file exists but is not valid JSON (or there's some error reading it).\n */\nexport async function readGeneratedConfig(appPath: string): Promise<GeneratedConfig> {\n const { generatedConfigPath } = getConfigPath(appPath);\n\n return (await readJson(generatedConfigPath, { throwOnError: true, mode: 'permissive' })) || {};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortGeneratedConfig.d.ts","sourceRoot":"","sources":["../src/sortGeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAyC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"sortGeneratedConfig.d.ts","sourceRoot":"","sources":["../src/sortGeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAyC,MAAM,4BAA4B,CAAC;AAIzG;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,eAAe,QAoC7D"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { sortObjectKeys } from './sortObjectKeys.js';
|
|
2
2
|
import { compareSettings } from './compareSettings.js';
|
|
3
|
-
import { compareOverrides } from './compareOverrides.js';
|
|
4
3
|
/**
|
|
5
4
|
* Sorts the generated config so that we don't have unneeded changes due to differences in
|
|
6
5
|
* order of operations.
|
|
7
6
|
*/
|
|
8
7
|
export function sortGeneratedConfig(generated) {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const { packageSettings } = generated;
|
|
9
|
+
if (!packageSettings) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
11
12
|
// Ensure package overrides are sorted based on package name and version requirement.
|
|
12
|
-
packageOverrides?.sort(compareOverrides);
|
|
13
13
|
packageSettings.sort(compareSettings);
|
|
14
14
|
for (let i = 0; i < packageSettings.length; i++) {
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortGeneratedConfig.js","sourceRoot":"","sources":["../src/sortGeneratedConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"sortGeneratedConfig.js","sourceRoot":"","sources":["../src/sortGeneratedConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAA0B;IAC5D,MAAM,EAAE,eAAe,EAAE,GAAG,SAAS,CAAC;IACtC,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO;IACT,CAAC;IAED,qFAAqF;IACrF,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,8DAA8D;QAC9D,MAAM,eAAe,GAAG,eAAe,CAAC,CAAC,CAAwB,CAAC;QAClE,MAAM,gBAAgB,GAGlB;YACF,mEAAmE;YACnE,KAAK,EAAE,eAAe,CAAC,KAAK;SAC7B,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAA+B,EAAE,CAAC;YACnF,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;gBACpB,mEAAmE;gBACnE,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;gBACnC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;oBACzB,gBAAgB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;gBACvC,CAAC;qBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;oBACvD,gBAAgB,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;gBAChD,CAAC;qBAAM,CAAC;oBACN,gBAAgB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBAChC,CAAC;YACH,CAAC;QACH,CAAC;QAED,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACjD,CAAC;AACH,CAAC","sourcesContent":["import type { GeneratedConfig, PackageSettings, PackageSettingsMatch } from '@ms-cloudpack/common-types';\nimport { sortObjectKeys } from './sortObjectKeys.js';\nimport { compareSettings } from './compareSettings.js';\n\n/**\n * Sorts the generated config so that we don't have unneeded changes due to differences in\n * order of operations.\n */\nexport function sortGeneratedConfig(generated: GeneratedConfig) {\n const { packageSettings } = generated;\n if (!packageSettings) {\n return;\n }\n\n // Ensure package overrides are sorted based on package name and version requirement.\n packageSettings.sort(compareSettings);\n\n for (let i = 0; i < packageSettings.length; i++) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const originalSetting = packageSettings[i] as Record<string, any>;\n const formattedSetting: {\n match: PackageSettingsMatch;\n [key: string]: unknown;\n } = {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n match: originalSetting.match,\n };\n\n for (const key of Object.keys(originalSetting).sort() as (keyof PackageSettings)[]) {\n if (key !== 'match') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const value = originalSetting[key];\n if (Array.isArray(value)) {\n formattedSetting[key] = value.sort();\n } else if (typeof value === 'object' && value !== null) {\n formattedSetting[key] = sortObjectKeys(value);\n } else {\n formattedSetting[key] = value;\n }\n }\n }\n\n packageSettings.splice(i, 1, formattedSetting);\n }\n}\n"]}
|
package/lib/tsdoc-metadata.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { GeneratedConfig } from '@ms-cloudpack/common-types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Comment added to the top of the generated file (exported for testing only).
|
|
4
|
+
* @internal
|
|
4
5
|
*/
|
|
5
|
-
export declare
|
|
6
|
+
export declare const fileHeaderComment = "/**\n * THIS FILE IS AUTO-GENERATED.\n * DO NOT MANUALLY EDIT THIS FILE.\n */\n";
|
|
7
|
+
/**
|
|
8
|
+
* Clean up the generated config (sort it and remove empty settings) and write it to
|
|
9
|
+
* cloudpack.generated.json. This is used at the end of `init`.
|
|
10
|
+
*
|
|
11
|
+
* If the config file exists but is no longer needed, it will be deleted.
|
|
12
|
+
*
|
|
13
|
+
* @returns
|
|
14
|
+
* - `'written'` if the config was written
|
|
15
|
+
* - `'deleted'` if the config previously existed but is now empty and was deleted
|
|
16
|
+
* - `'no-op'` if the config didn't previously exist and is still empty
|
|
17
|
+
*/
|
|
18
|
+
export declare function writeGeneratedConfig(config: GeneratedConfig, appPath: string): Promise<'written' | 'deleted' | 'no-op'>;
|
|
6
19
|
//# sourceMappingURL=writeGeneratedConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeGeneratedConfig.d.ts","sourceRoot":"","sources":["../src/writeGeneratedConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeGeneratedConfig.d.ts","sourceRoot":"","sources":["../src/writeGeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAQlE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,oFAAoF,CAAC;AAEnH;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC,CAwB1C"}
|
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
import { writeJson } from '@ms-cloudpack/json-utilities';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { cleanGeneratedConfig } from './cleanGeneratedConfig.js';
|
|
2
4
|
import { getConfigPath } from './getConfigPath.js';
|
|
3
5
|
import { generatedAppConfigSchemaUrl } from './schemaUrls.js';
|
|
4
6
|
import { sortGeneratedConfig } from './sortGeneratedConfig.js';
|
|
5
|
-
import { cleanGeneratedConfig } from './cleanGeneratedConfig.js';
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Comment added to the top of the generated file (exported for testing only).
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export const fileHeaderComment = `/**\n * THIS FILE IS AUTO-GENERATED.\n * DO NOT MANUALLY EDIT THIS FILE.\n */\n`;
|
|
12
|
+
/**
|
|
13
|
+
* Clean up the generated config (sort it and remove empty settings) and write it to
|
|
14
|
+
* cloudpack.generated.json. This is used at the end of `init`.
|
|
15
|
+
*
|
|
16
|
+
* If the config file exists but is no longer needed, it will be deleted.
|
|
17
|
+
*
|
|
18
|
+
* @returns
|
|
19
|
+
* - `'written'` if the config was written
|
|
20
|
+
* - `'deleted'` if the config previously existed but is now empty and was deleted
|
|
21
|
+
* - `'no-op'` if the config didn't previously exist and is still empty
|
|
8
22
|
*/
|
|
9
23
|
export async function writeGeneratedConfig(config, appPath) {
|
|
10
24
|
const { generatedConfigPath } = getConfigPath(appPath);
|
|
11
|
-
const fileHeaderComment = `/**\n * THIS FILE IS AUTO-GENERATED.\n * DO NOT MANUALLY EDIT THIS FILE.\n */\n`;
|
|
12
25
|
sortGeneratedConfig(config);
|
|
13
26
|
cleanGeneratedConfig(config);
|
|
14
|
-
|
|
27
|
+
if (!config.packageSettings?.length) {
|
|
28
|
+
if (fs.existsSync(generatedConfigPath)) {
|
|
29
|
+
fs.unlinkSync(generatedConfigPath);
|
|
30
|
+
return 'deleted';
|
|
31
|
+
}
|
|
32
|
+
return 'no-op';
|
|
33
|
+
}
|
|
34
|
+
await writeJson(generatedConfigPath, {
|
|
15
35
|
$schema: generatedAppConfigSchemaUrl,
|
|
16
36
|
...config,
|
|
17
37
|
}, { fileHeaderComment });
|
|
38
|
+
return 'written';
|
|
18
39
|
}
|
|
19
40
|
//# sourceMappingURL=writeGeneratedConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeGeneratedConfig.js","sourceRoot":"","sources":["../src/writeGeneratedConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeGeneratedConfig.js","sourceRoot":"","sources":["../src/writeGeneratedConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,iFAAiF,CAAC;AAEnH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAuB,EACvB,OAAe;IAEf,MAAM,EAAE,mBAAmB,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAEvD,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAE5B,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAE7B,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;QACpC,IAAI,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;YACvC,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;YACnC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,SAAS,CACb,mBAAmB,EACnB;QACE,OAAO,EAAE,2BAA2B;QACpC,GAAG,MAAM;KACV,EACD,EAAE,iBAAiB,EAAE,CACtB,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { GeneratedConfig } from '@ms-cloudpack/common-types';\nimport { writeJson } from '@ms-cloudpack/json-utilities';\nimport fs from 'fs';\nimport { cleanGeneratedConfig } from './cleanGeneratedConfig.js';\nimport { getConfigPath } from './getConfigPath.js';\nimport { generatedAppConfigSchemaUrl } from './schemaUrls.js';\nimport { sortGeneratedConfig } from './sortGeneratedConfig.js';\n\n/**\n * Comment added to the top of the generated file (exported for testing only).\n * @internal\n */\nexport const fileHeaderComment = `/**\\n * THIS FILE IS AUTO-GENERATED.\\n * DO NOT MANUALLY EDIT THIS FILE.\\n */\\n`;\n\n/**\n * Clean up the generated config (sort it and remove empty settings) and write it to\n * cloudpack.generated.json. This is used at the end of `init`.\n *\n * If the config file exists but is no longer needed, it will be deleted.\n *\n * @returns\n * - `'written'` if the config was written\n * - `'deleted'` if the config previously existed but is now empty and was deleted\n * - `'no-op'` if the config didn't previously exist and is still empty\n */\nexport async function writeGeneratedConfig(\n config: GeneratedConfig,\n appPath: string,\n): Promise<'written' | 'deleted' | 'no-op'> {\n const { generatedConfigPath } = getConfigPath(appPath);\n\n sortGeneratedConfig(config);\n\n cleanGeneratedConfig(config);\n\n if (!config.packageSettings?.length) {\n if (fs.existsSync(generatedConfigPath)) {\n fs.unlinkSync(generatedConfigPath);\n return 'deleted';\n }\n return 'no-op';\n }\n\n await writeJson(\n generatedConfigPath,\n {\n $schema: generatedAppConfigSchemaUrl,\n ...config,\n },\n { fileHeaderComment },\n );\n return 'written';\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "Configuration handling for cloudpack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@ms-cloudpack/common-types": "^0.
|
|
17
|
+
"@ms-cloudpack/common-types": "^0.16.0",
|
|
18
18
|
"@ms-cloudpack/json-utilities": "^0.1.7",
|
|
19
|
-
"@ms-cloudpack/package-utilities": "^9.0.
|
|
20
|
-
"@ms-cloudpack/path-utilities": "^2.7.
|
|
19
|
+
"@ms-cloudpack/package-utilities": "^9.0.2",
|
|
20
|
+
"@ms-cloudpack/path-utilities": "^2.7.33",
|
|
21
21
|
"import-meta-resolve": "^4.0.0",
|
|
22
22
|
"semver": "^7.6.0"
|
|
23
23
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compareOverrides.d.ts","sourceRoot":"","sources":["../src/compareOverrides.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,GAAG,MAAM,CAS/E"}
|
package/lib/compareOverrides.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function compareOverrides(a, b) {
|
|
2
|
-
const { name: aName = '', versionRequirement: aVersion = '*' } = a;
|
|
3
|
-
const { name: bName = '', versionRequirement: bVersion = '*' } = b;
|
|
4
|
-
if (aName === bName) {
|
|
5
|
-
return aVersion.localeCompare(bVersion);
|
|
6
|
-
}
|
|
7
|
-
return aName.localeCompare(bName);
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=compareOverrides.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compareOverrides.js","sourceRoot":"","sources":["../src/compareOverrides.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAAC,CAAkB,EAAE,CAAkB;IACrE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,kBAAkB,EAAE,QAAQ,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;IACnE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,kBAAkB,EAAE,QAAQ,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;IAEnE,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACpB,OAAO,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import type { PackageOverride } from '@ms-cloudpack/common-types';\n\nexport function compareOverrides(a: PackageOverride, b: PackageOverride): number {\n const { name: aName = '', versionRequirement: aVersion = '*' } = a;\n const { name: bName = '', versionRequirement: bVersion = '*' } = b;\n\n if (aName === bName) {\n return aVersion.localeCompare(bVersion);\n }\n\n return aName.localeCompare(bName);\n}\n"]}
|