JSPM

version-selector-type

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29368
  • Score
    100M100P100Q163169F
  • License MIT

Returns the type of a version selector

Package Exports

  • version-selector-type

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (version-selector-type) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

version-selector-type

Returns the type of a version selector

npm version Build Status

Installation

npm i -S version-selector-type

Usage

'use strict'
const getVersionSelectorType = require('version-selector-type')

console.log(getVersionSelectorType('1.0.0'))
//> version

console.log(getVersionSelectorType('^1.0.0'))
//> range

console.log(getVersionSelectorType('latest'))
//> tag

console.log(getVersionSelectorType('github:zkochan/foo'))
//> null

API

getVersionSelectorType(selector, [loose])

Returns the type of the version selector or null in case it is an unknow selector.

Arguments

  • selector - string - Required.
  • [loose] - boolean - Optional. False by default. If true, Interprets versions and ranges loosely.

License

MIT © Zoltan Kochan