MCPcopy
hub / github.com/npm/node-semver / createToken

Function createToken

internal/re.js:42–51  ·  view source on GitHub ↗
(name, value, isGlobal)

Source from the content-addressed store, hash-verified

40}
41
42const createToken = (name, value, isGlobal) => {
43 const safe = makeSafeRegex(value)
44 const index = R++
45 debug(name, index, value)
46 t[name] = index
47 src[index] = value
48 safeSrc[index] = safe
49 re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
50 safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
51}
52
53// The following Regular Expressions can be used for tokenizing,
54// validating, and parsing SemVer version strings.

Callers 1

re.jsFile · 0.85

Calls 1

makeSafeRegexFunction · 0.85

Tested by

no test coverage detected