Tests if argument is valid semver
Basic usage example:
const semver = require('stringman').semver; // or `import {semver} from 'stringman'`;
const valid = semver.isValid('0.1.0');
const invalid = semver.isValid('0,1.0-rt');
console.log(valid); // true
console.log(invalid); // false
Removes semver from string, trims, and returns result
Basic usage example:
const semver = require('stringman').semver; // or `import {semver} from 'stringman'`;
const removed = semver.remove('this project started on version 0.1.0');
console.log(removed); // 'this project started on version'
returns semver from string if present
Basic usage example:
const semver = require('stringman').semver; // or `import {semver} from 'stringman'`;
const justSemver = semver.retrieve('this project started on version 0.1.0');
console.log(justSemver); // ['0.1.0']
Takes a string with a semver, a second string, returns first string with semver swapped for second string
Basic usage example:
const semver = require('stringman').semver; // or `import {semver} from 'stringman'`;
const swapped = semver.swapped('this project started on version 0.1.0', '1.5.8');
console.log(removed); // 'this project started on version 1.5.8'
Generated using TypeDoc
Returns RegExp variable used to test for semver