Comparing version 6.2.0 to 6.3.0
@@ -0,1 +1,5 @@ | ||
## 6.3.0 | ||
* Add `asRegExp` accessor (#136) | ||
* Add better TypeScript example for custom accessors (#133) | ||
## 6.2.0 (12/06/20) | ||
@@ -2,0 +6,0 @@ * Add `accessors` property to the public API for use in building `extraAccessors` (#121) |
@@ -205,2 +205,8 @@ | ||
asEnum: <T extends string>(validValues: T[]) => AlternateType extends undefined ? undefined|T : T; | ||
/** | ||
* Verifies that the variable is a valid regular expression and returns the | ||
* validated expression as a RegExp instance. | ||
*/ | ||
asRegExp: (flags?: string) => AlternateType extends undefined ? undefined|RegExp : RegExp; | ||
} | ||
@@ -207,0 +213,0 @@ |
@@ -22,2 +22,4 @@ module.exports = { | ||
asRegExp: require('./regexp'), | ||
asString: require('./string'), | ||
@@ -24,0 +26,0 @@ |
{ | ||
"name": "env-var", | ||
"version": "6.2.0", | ||
"description": "Verification, sanatization, and type coercion for environment variables in Node.js", | ||
"version": "6.3.0", | ||
"description": "Verification, sanitization, and type coercion for environment variables in Node.js", | ||
"main": "env-var.js", | ||
@@ -6,0 +6,0 @@ "typings": "env-var.d.ts", |
@@ -194,2 +194,3 @@ # env-var | ||
* [asUrlString()](#asurlstring) | ||
* [asRegExp()](#asregexp) | ||
* [EnvVarError()](#envvarerror) | ||
@@ -415,2 +416,7 @@ * [accessors](#accessors) | ||
#### asRegExp([flags: string]) | ||
Read in the variable and construct a [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) | ||
instance using its value. An optional `flags` argument is supported. The string | ||
passed for `flags` is passed as the second argument to the `RegExp` constructor. | ||
### EnvVarError() | ||
@@ -631,2 +637,3 @@ This is the error class used to represent errors raised by this module. Sample | ||
* @hhravn | ||
* @ineentho | ||
* @itavy | ||
@@ -633,0 +640,0 @@ * @joh-klein |
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
54560
28
670
644