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

cross-var

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-var - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

12

package.json
{
"name": "cross-var",
"version": "1.0.3",
"version": "1.1.0",
"description": "",

@@ -17,2 +17,12 @@ "main": "index.js",

},
"keywords": [
"npm-scripts"
],
"repository": {
"type": "git",
"url": "https://github.com/elijahmanor/cross-var"
},
"bugs": {
"url": "https://github.com/elijahmanor/cross-var/issues"
},
"dependencies": {

@@ -19,0 +29,0 @@ "babel-preset-es2015": "^6.18.0",

10

src/index.js

@@ -10,6 +10,8 @@ #!/usr/bin/env node --harmony

return args.map( arg => {
Object.keys( process.env ).forEach( key => {
const regex = new RegExp( `\\$${ key }|%${ key }%`, "i" );
arg = arg.replace( regex, process.env[ key ] );
} );
Object.keys( process.env )
.sort( ( x, y ) => x.length < y.length ) // sort by descending length to prevent partial replacement
.forEach( key => {
const regex = new RegExp( `\\$${ key }|%${ key }%`, "ig" );
arg = arg.replace( regex, process.env[ key ] );
} );
return arg;

@@ -16,0 +18,0 @@ } )

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