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

serverless-pseudo-parameters

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-pseudo-parameters - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

13

lib/index.js

@@ -85,6 +85,13 @@ 'use strict';

if (typeof value === 'string' && value.search(aws_regex) >= 0) {
dictionary[key] = {
"Fn::Sub": value.replace(aws_regex, '${$1}')
};
let replacedString = value.replace(aws_regex, '${$1}');
if (key === 'Fn::Sub') {
dictionary[key] = replacedString;
} else {
dictionary[key] = {
"Fn::Sub": replacedString
};
}
// do some fancy logging

@@ -91,0 +98,0 @@ let m = aws_regex.exec(value);

@@ -34,2 +34,5 @@ const Plugin = require('.');

Reference: "#{SomeResource}",
Substitution: {
"Fn::Sub": "#{SomeResource}"
}
}

@@ -42,7 +45,7 @@ }

resultTemplate = serverlessPseudoParamsPlugin.serverless.service.provider.compiledCloudFormationTemplate;
expect(Object.keys(resultTemplate.Resources.acmeResource.Properties).length).toEqual(9);
expect(Object.keys(resultTemplate.Resources.acmeResource.Properties).length).toEqual(10);
});
it('replaces #{AWS::[VAR]} with the correct CF pseudo parameter', () => {
expect(Object.keys(resultTemplate.Resources.acmeResource.Properties).length).toEqual(9);
expect(Object.keys(resultTemplate.Resources.acmeResource.Properties).length).toEqual(10);
});

@@ -77,2 +80,5 @@

});
it('should not add Fn::Sub to items with Fn::Sub already', () => {
expect(resultTemplate.Resources.acmeResource.Properties.Substitution).toEqual({ 'Fn::Sub': '${SomeResource}'});
});

@@ -79,0 +85,0 @@ });

{
"name": "serverless-pseudo-parameters",
"version": "2.1.0",
"version": "2.2.0",
"devDependencies": {

@@ -13,4 +13,4 @@ "jest": "^22.4.2"

"scripts": {
"test": "jest",
"test:watch": "jest --watch"
"test": "jest --env node",
"test:watch": "jest --env node --watch"
},

@@ -17,0 +17,0 @@ "main": "lib/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