cher-tools
Advanced tools
Comparing version 0.4.1 to 0.4.2
'use strict'; | ||
exports.pluckMatching = (collection, regex) => { | ||
return Object.keys(collection) | ||
.filter((item) => { | ||
return (item.match(regex)); | ||
}) | ||
.map((key) => { | ||
const obj = {}; | ||
obj[ key ] = collection[ key ]; | ||
return obj; | ||
}) | ||
.map((credsMap) => { | ||
const key = Object.keys(credsMap)[ 0 ]; | ||
const valParts = credsMap[key].split(':'); | ||
const obj = {}; | ||
obj[key] = valParts; | ||
return obj; | ||
}); | ||
}; | ||
exports.pluck = ( collection, keys ) => { | ||
@@ -5,0 +24,0 @@ return Object.keys( collection ) |
@@ -10,4 +10,7 @@ | ||
exports.fetch = (extras) => { | ||
const cherCredsRegex = /^CHER_(.){1,}_CREDS$/; | ||
const resolver = P.pending(); | ||
const credsArray = helpers.pluckMatching(process.env, cherCredsRegex); | ||
const envArray = helpers.pluck(process.env, requiredEnv); | ||
@@ -14,0 +17,0 @@ const env = helpers.arrayToObj(envArray); |
{ | ||
"name": "cher-tools", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Tools and utilities for the Cher platform", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
20125
22
617
8