@mapbox/cloudfriend
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -192,1 +192,17 @@ var intrinsic = module.exports = {}; | ||
}; | ||
/** | ||
* [The intrinsic function Fn::Split](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-split.html) | ||
* returns the value of an attribute from a resource in the template. | ||
* | ||
* @static | ||
* @memberof cloudfriend | ||
* @name split | ||
* @param {string} delimiter - The delimiter you would like to split the string on | ||
* @param {string} string - The string you would like to split | ||
* @returns The attribute value. | ||
*/ | ||
intrinsic.split = (delimiter, string) => { | ||
return { 'Fn::Split': [delimiter, string.toString()] }; | ||
}; |
{ | ||
"name": "@mapbox/cloudfriend", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "Helper functions for assembling CloudFormation templates in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,2 +18,3 @@ # cloudfriend | ||
join(delimiter, pieces) | [Fn::Join](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-join.html) | ||
split(delimiter, string) | [Fn::Split](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-split.html) | ||
select(index, list) | [Fn::Select](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-select.html) | ||
@@ -60,3 +61,3 @@ ref(name) | [Ref](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html) | ||
# ... or ... | ||
$ npm install -g cloudfriend | ||
$ npm install -g @mapbox/cloudfriend | ||
``` | ||
@@ -63,0 +64,0 @@ |
@@ -18,2 +18,3 @@ var test = require('tape'); | ||
assert.deepEqual(cloudfriend.ref('something'), { Ref: 'something' }, 'ref'); | ||
assert.deepEqual(cloudfriend.split(',', 'a,b,c,d'), { 'Fn::Split': [',', 'a,b,c,d'] }, 'split'); | ||
assert.deepEqual(cloudfriend.userData(['#!/usr/bin/env bash', 'set -e']), { 'Fn::Base64': { 'Fn::Join': ['\n', ['#!/usr/bin/env bash', 'set -e']] } }, 'userData'); | ||
@@ -20,0 +21,0 @@ assert.deepEqual(cloudfriend.sub('my ${thing}'), { 'Fn::Sub': 'my ${thing}' }, 'sub without variables'); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
45363
27
887
76
1