@thisismanta/semantic-version 11.4.0 → 11.5.0

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/index.d.ts CHANGED
@@ -15,7 +15,7 @@ interface GitCommit {
15
15
  subject: string;
16
16
  }
17
17
  export declare function getReleaseType(commits: Array<GitCommit>): string | null;
18
- export declare function getCurrentPackageVersion(): Promise<any>;
18
+ export declare function getCurrentPackageVersion(): Promise<string>;
19
19
  export declare function getGitHistory(version: string): Promise<Array<GitCommit>>;
20
20
  export declare function getReleaseNote(commits: Array<GitCommit>): string;
21
21
  export {};
package/lib/src.js CHANGED
@@ -510,7 +510,8 @@ function getReleaseType(commits) {
510
510
  return null;
511
511
  }
512
512
  async function getCurrentPackageVersion() {
513
- if ((0, import_valid.default)(packageJSON.version)) return packageJSON.version;
513
+ const version = (await run(`${npm} pkg get version`)).trim().replace(/^"/, "").replace(/"$/, "");
514
+ if ((0, import_valid.default)(version)) return version;
514
515
  else throw new Error("Expected a valid version field in package.json.");
515
516
  }
516
517
  async function getGitHistory(version) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisismanta/semantic-version",
3
- "version": "11.4.0",
3
+ "version": "11.5.0",
4
4
  "license": "ISC",
5
5
  "author": "Anantachai Saothong <thisismanta@gmail.com>",
6
6
  "repository": {