diff --git a/check-npm-versions.ts b/check-npm-versions.ts index 1ade61f..80f31bb 100644 --- a/check-npm-versions.ts +++ b/check-npm-versions.ts @@ -23,11 +23,11 @@ const compatibleVersionIsInstalled = (name: string, range: string | semver.Range } else { return installedVersion; } - } catch (e) { + } catch (e: any) { // XXX add something to the tool to make this more reliable const message = e.toString(); - // One message comes out of the install npm package the other from npm directly - if (message.includes('Cannot find module') === true || message.includes("Can't find npm module") === true) { + // One message comes out of the installation npm package the other from npm directly + if (message.includes('Cannot find module') || message.includes("Can't find npm module")) { return false; } else { throw e; diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..d74c215 --- /dev/null +++ b/index.d.ts @@ -0,0 +1 @@ +export * from './check-npm-versions'; diff --git a/package.js b/package.js index d1d0b29..e067166 100644 --- a/package.js +++ b/package.js @@ -1,17 +1,16 @@ /* global Package:readonly, Npm:readonly */ Package.describe({ name: 'tmeasday:check-npm-versions', - version: '1.0.2', + version: '1.0.3', summary: 'Check that required npm packages are installed at the app level', git: 'https://github.com/tmeasday/check-npm-versions.git', documentation: 'README.md', }); -Npm.depends({ semver: '6.3.0' }); // 7.x versions are incompatible with Internet Explorer +Npm.depends({ semver: '7.5.4' }); Package.onUse(function (api) { - api.versionsFrom('2.0'); api.use('typescript'); - api.use('zodern:types@1.0.7'); + api.mainModule('check-npm-versions.ts'); });