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.4.0 to 2.5.0

LICENSE

7

lib/index.js

@@ -111,2 +111,9 @@ 'use strict';

var escaped_regex = /#@{([^}]+)}/g;
if (typeof value === 'string' && value.search(escaped_regex) >= 0) {
let replacedString = value.replace(escaped_regex, '#{$1}');
dictionary[key] = replacedString;
}
// dicts and arrays need to be looped through

@@ -113,0 +120,0 @@ if (isDict(value) || isArray(value)) {

11

lib/index.spec.js

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

"Fn::Sub": "#{SomeResource}"
},
Escaping: {
StringValue: "#@{myOutputS3Loc}/#@{format(@scheduledStartTime, 'YYYY-MM-dd-HH-mm-ss')}"
}

@@ -45,7 +48,7 @@ }

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

@@ -83,3 +86,5 @@

});
it('should not replace escaped items', () => {
expect(resultTemplate.Resources.acmeResource.Properties.Escaping).toEqual({ 'StringValue': '#{myOutputS3Loc}/#{format(@scheduledStartTime, \'YYYY-MM-dd-HH-mm-ss\')}'});
});
});

@@ -86,0 +91,0 @@

{
"name": "serverless-pseudo-parameters",
"version": "2.4.0",
"version": "2.5.0",
"devDependencies": {
"jest": "^22.4.4"
"jest": "^24.9.0"
},

@@ -7,0 +7,0 @@ "license": "MIT",

@@ -100,1 +100,13 @@ Serverless AWS Pseudo Parameters

```
Escaping tokens
-----------------------------------
You can prevent tokens from being replaced by escaping with the `@` character after the token's hash character
```yaml
DynamoDBInputS3OutputHive:
Type: AWS::DataPipeline::Pipeline
Properties:
PipelineObjects:
- Key: "directoryPath"
StringValue: "#@{myOutputS3Loc}/#@{format(@scheduledStartTime, 'YYYY-MM-dd-HH-mm-ss')}"
```
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