uuid-regexp
Advanced tools
Comparing version 0.2.0 to 0.3.0
# Change Log | ||
All notable changes to this project will be documented in this file (keepachangelog.com). | ||
## 0.3.0 - 2016-01-14 | ||
### Changed | ||
- Dropped global option in favor of general `flags` option. | ||
## 0.2.0 - 2016-01-14 | ||
@@ -5,0 +9,0 @@ ### Added |
10
index.js
@@ -22,4 +22,4 @@ 'use strict' | ||
* | ||
* @param {Boolean} [opts.global] | ||
* Whether the RegExp should test against all possible matches in a string, or only against the first. | ||
* @param {String} [opts.flags] | ||
* Additional RegExp flags ('i' is always set). | ||
* | ||
@@ -34,6 +34,8 @@ * @param {Boolean} [opts.nil] | ||
function re (opts) { | ||
opts = opts || {} | ||
return new RegExp( | ||
format('\\b(?:%s)\\b', regexp.versioned.source + ((opts || {}).nil ? '|' + regexp.nil.source : '')), | ||
(opts || {}).global ? 'gi' : 'i' | ||
format('\\b(?:%s)\\b', regexp.versioned.source + (opts.nil ? '|' + regexp.nil.source : '')), | ||
'i' + (opts.flags || '') | ||
) | ||
} |
{ | ||
"name": "uuid-regexp", | ||
"description": "RegExp for finding an RFC4122 compliant UUID in a string.", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"author": "Wil Moore III <wil.moore@wilmoore.com>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -41,3 +41,3 @@ # uuid-regexp | ||
'Secret UUID is: {4d36e96e-e325-11ce-bfc1-08002be10318}'.replace(uuid({ global: true }), '*****') | ||
'Secret UUID is: {4d36e96e-e325-11ce-bfc1-08002be10318}'.replace(uuid({ flags: 'g' }), '*****') | ||
//=> 'Secret UUID is: {*****}' | ||
@@ -65,3 +65,3 @@ ``` | ||
- `options.nil (Boolean)` Whether to include the nil/empty UUID pattern. (default: `false`) | ||
- `options.global (Boolean)` Whether the RegExp should test against all possible matches in a string, or only against the first. | ||
- `options.flags (String)` Additional RegExp flags ('i' is always set). | ||
@@ -68,0 +68,0 @@ ###### returns |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42
6827