Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

env-var

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-var - npm Package Compare versions

Comparing version 6.2.0 to 6.3.0

lib/accessors/regexp.js

4

CHANGELOG.md

@@ -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 @@

4

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc