fixes #455
This commit is contained in:
parent
2929c77b3a
commit
1d582dccc9
2 changed files with 4 additions and 3 deletions
|
@ -109,6 +109,7 @@ describe('validateVSCodeTypesCompatibility', () => {
|
|||
|
||||
validateVSCodeTypesCompatibility('1.30.0', '1.30.0');
|
||||
validateVSCodeTypesCompatibility('1.30.0', '1.20.0');
|
||||
validateVSCodeTypesCompatibility('1.46.0', '1.45.1');
|
||||
|
||||
assert.throws(() => validateVSCodeTypesCompatibility('1.30.0', '1.40.0'));
|
||||
assert.throws(() => validateVSCodeTypesCompatibility('1.30.0', '^1.40.0'));
|
||||
|
|
|
@ -91,13 +91,13 @@ export function validateVSCodeTypesCompatibility(engineVersion: string, typeVers
|
|||
|
||||
const error = new Error(`@types/vscode ${typeVersion} greater than engines.vscode ${engineVersion}. Consider upgrade engines.vscode or use an older @types/vscode version`);
|
||||
|
||||
if (typeof typeMajor === 'number' && typeof engineMajor === 'number' && typeMajor > engineMajor) {
|
||||
if (typeMajor > engineMajor) {
|
||||
throw error;
|
||||
}
|
||||
if (typeof typeMinor === 'number' && typeof engineMinor === 'number' && typeMinor > engineMinor) {
|
||||
if (typeMajor === engineMajor && typeMinor > engineMinor) {
|
||||
throw error;
|
||||
}
|
||||
if (typeof typePatch === 'number' && typeof enginePatch === 'number' && typePatch > enginePatch) {
|
||||
if (typeMajor === engineMajor && typeMinor === engineMinor && typePatch > enginePatch) {
|
||||
throw error;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue