Comparing version 2.0.2 to 2.0.3
@@ -296,9 +296,15 @@ "use strict"; | ||
} | ||
const path = "../../package.json"; | ||
const packageJson = await Promise.resolve(`${path}`).then(s => require(s)); | ||
const packageJson = await readPackageJson(); | ||
const tsProtoVersion = `v${packageJson?.version ?? "unknown"}`; | ||
return { | ||
protocVersion, | ||
tsProtoVersion, | ||
}; | ||
return { protocVersion, tsProtoVersion }; | ||
} | ||
/** Read from the distributed package.json file, or our local package.json when running ts-proto tests locally. */ | ||
async function readPackageJson() { | ||
try { | ||
// Use `as string` to disable hints that the path doesn't exist | ||
return await Promise.resolve(`${"../../package.json"}`).then(s => require(s)); | ||
} | ||
catch (e) { | ||
return await Promise.resolve(`${"../package.json"}`).then(s => require(s)); | ||
} | ||
} |
{ | ||
"name": "ts-proto", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/src/plugin.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
643718
12947
1106
3