fix(dependencies): update to latest standards
This commit is contained in:
53
ts/index.ts
53
ts/index.ts
@ -1,59 +1,58 @@
|
||||
import * as plugins from './smartversion.plugins'
|
||||
import * as plugins from './smartversion.plugins';
|
||||
|
||||
import { SemVer } from 'semver'
|
||||
import { SemVer } from 'semver';
|
||||
|
||||
export class SmartVersion {
|
||||
semver: SemVer
|
||||
versionString: string
|
||||
semver: SemVer;
|
||||
versionString: string;
|
||||
update = {
|
||||
patch: () => {
|
||||
this.semver.patch = this.semver.patch + 1
|
||||
this.semver.patch = this.semver.patch + 1;
|
||||
},
|
||||
minor: () => {
|
||||
this.semver.minor = this.semver.minor + 1
|
||||
this.semver.minor = this.semver.minor + 1;
|
||||
},
|
||||
major: () => {
|
||||
this.semver.major = this.semver.major + 1
|
||||
this.semver.major = this.semver.major + 1;
|
||||
}
|
||||
};
|
||||
|
||||
constructor(semVerStringArg: string) {
|
||||
this.semver = new plugins.semver.SemVer(semVerStringArg);
|
||||
this.versionString = this.semver.version;
|
||||
}
|
||||
|
||||
constructor (semVerStringArg: string) {
|
||||
this.semver = new plugins.semver.SemVer(semVerStringArg)
|
||||
this.versionString = this.semver.version
|
||||
get major() {
|
||||
return this.semver.major;
|
||||
}
|
||||
|
||||
get major () {
|
||||
return this.semver.major
|
||||
get minor() {
|
||||
return this.semver.minor;
|
||||
}
|
||||
|
||||
get minor () {
|
||||
return this.semver.minor
|
||||
get patch() {
|
||||
return this.semver.patch;
|
||||
}
|
||||
|
||||
get patch () {
|
||||
return this.semver.patch
|
||||
}
|
||||
|
||||
greaterThan (smartVersionArg: SmartVersion) {
|
||||
return this.greaterThanString(smartVersionArg.versionString)
|
||||
greaterThan(smartVersionArg: SmartVersion) {
|
||||
return this.greaterThanString(smartVersionArg.versionString);
|
||||
}
|
||||
|
||||
/**
|
||||
* compares the version of this against a string
|
||||
*/
|
||||
greaterThanString (versionStringArg) {
|
||||
return plugins.semver.gt(this.versionString, versionStringArg)
|
||||
greaterThanString(versionStringArg) {
|
||||
return plugins.semver.gt(this.versionString, versionStringArg);
|
||||
}
|
||||
|
||||
lessThan (smartVersionArg: SmartVersion) {
|
||||
return this.lessThanString(smartVersionArg.versionString)
|
||||
lessThan(smartVersionArg: SmartVersion) {
|
||||
return this.lessThanString(smartVersionArg.versionString);
|
||||
}
|
||||
|
||||
/**
|
||||
* compares the version of this against a string
|
||||
*/
|
||||
lessThanString (versionStringArg) {
|
||||
return plugins.semver.lt(this.versionString, versionStringArg)
|
||||
lessThanString(versionStringArg) {
|
||||
return plugins.semver.lt(this.versionString, versionStringArg);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,3 @@
|
||||
import 'typings-global'
|
||||
import * as semver from 'semver'
|
||||
import * as semver from 'semver';
|
||||
|
||||
export {
|
||||
semver
|
||||
}
|
||||
export { semver };
|
||||
|
Reference in New Issue
Block a user