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

@znemz/cfn-include

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@znemz/cfn-include - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

lib/include/query.js

2

bin/cli.js

@@ -98,3 +98,3 @@ #!/usr/bin/env node

template = opts.doEnv ? replaceEnv(template) : template;
template = opts.enable === 'env' ? replaceEnv(template) : template;

@@ -101,0 +101,0 @@ return include({

@@ -14,3 +14,3 @@ var _ = require('lodash'),

yaml = require('./lib/yaml'),
jmespath = require('jmespath'),
{ getParser } = require('./lib/include/query'),
deepMerge = require('deepmerge'),

@@ -234,2 +234,3 @@ parseLocation = require('./lib/parselocation'),

async function include(base, scope, args, doEnv) {
const procTemplate = args.doEnv? replaceEnv : passThrough;
args = _.defaults(_.isPlainObject(args) ? { ...args, doEnv } : {

@@ -243,3 +244,3 @@ location: args,

absolute = location.relative ? path.join(path.dirname(base.path), location.host, location.path || '') : [location.host, location.path].join('');
body = readFile(absolute);
body = readFile(absolute).then(procTemplate);
absolute = location.protocol + '://' + absolute;

@@ -255,7 +256,7 @@ } else if (location.protocol === 's3') {

Key: key,
}).promise().then(res => res['Body'].toString());
}).promise().then(res => res['Body'].toString()).then(procTemplate);
} else if (location.protocol && location.protocol.match(/^https?$/)) {
var basepath = pathParse(base.path).dir + '/';
absolute = location.relative ? url.resolve(location.protocol + '://' + base.host + basepath, location.raw) : location.raw;
body = request(absolute);
body = request(absolute).then(procTemplate);
}

@@ -265,3 +266,3 @@ return handleIncludeBody({scope, args, body, absolute });

function passThrough(template) { return template; }
function passThrough(template) { return template; }

@@ -277,3 +278,3 @@ async function handleIncludeBody({ scope, args, body, absolute }) {

const query = _.isString(args.query) ? args.query : await recurse(parseLocation(absolute), scope, args.query, args.doEnv);
template = jmespath.search(template, query);
template = getParser(args.parser)(template, query);
}

@@ -280,0 +281,0 @@ return recurse(parseLocation(absolute), scope, template, args.doEnv);

var _ = require('lodash'),
AWS = require('aws-sdk-proxy'),
jmespath = require('jmespath');
jmespath = require('jmespath')
{ getParser } = require('./query');

@@ -8,4 +9,4 @@ module.exports = function(args) {

return service[args.action](args.parameters ? args.parameters : {}).promise().then(function(res) {
return args.query ? jmespath.search(res, args.query) : res;
return args.query ? getParser(args.parser)(res, args.query) : res;
});
}
{
"name": "@znemz/cfn-include",
"version": "1.6.1",
"version": "1.6.2",
"description": "Preprocessor for CloudFormation templates with support for loops and flexible include statements",

@@ -5,0 +5,0 @@ "main": "index.js",

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