Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const vm = require('vm'),
fs = require('fs'),
path = require('path'),
expandHomeDir = require('expand-home-dir'),
openwhiskComposer = require('@ibm-functions/composer'),
{ isValidFSM } = require('./composer')
//
// just in case, block any use of wsk from within sandboxed compilations
//
const nope = {
create: () => true,
update: () => true,
invoke: () => true
}
openwhiskComposer.wsk = {
actions: nope,
packages: nope,
rules: nope,
triggers: nope
}
const patterns = {
require: /(const [^\s]+)\s*=\s*require\('@ibm-functions\/composer'\)/,
constAppEquals: /.*const ([^\s]+)\s*=\s+composer(.*)/,
return: /^return\s+/
}
/** override values in A with those from B, returning any overwritten values */
const save = (A, B) => {
const overwritten = {}
for (let key in B) {