@aws-cf-builder/utils
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "flat"], factory); | ||
define(["require", "exports", "tslib", "./patch-utils"], factory); | ||
} | ||
@@ -15,3 +15,3 @@ })(function (require, exports) { | ||
var tslib_1 = require("tslib"); | ||
var flat_1 = require("flat"); | ||
var patch_utils_1 = require("./patch-utils"); | ||
var addParameter = function (parameterInfo, template) { | ||
@@ -49,14 +49,25 @@ var _a, _b; | ||
exports.addParameters = addParameters; | ||
var FLATTEN_OPTIONS = { | ||
delimiter: '/', | ||
maxDepth: Infinity, | ||
safe: false, | ||
overwrite: true, | ||
transformKey: function (key) { return encodeURIComponent(key); }, | ||
}; | ||
var UNFLATTEN_OPTIONS = tslib_1.__assign(tslib_1.__assign({}, FLATTEN_OPTIONS), { transformKey: function (key) { return decodeURIComponent(key); } }); | ||
var patchTemplate = function (patch, template) { | ||
var flatTemplate = flat_1.flatten(template, FLATTEN_OPTIONS); | ||
var flatPatchTemplate = flat_1.flatten(patch, FLATTEN_OPTIONS); | ||
return flat_1.unflatten(tslib_1.__assign(tslib_1.__assign({}, flatTemplate), flatPatchTemplate), UNFLATTEN_OPTIONS); | ||
var _a; | ||
return patch_utils_1.mergeValues([], template, patch, (_a = {}, | ||
_a[patch_utils_1.getValuePathString([ | ||
// Parameter Groups | ||
'Metadata', | ||
'AWS::CloudFormation::Interface', | ||
'ParameterGroups', | ||
])] = { | ||
strategy: 'accumulate-unique-by', | ||
data: function (pG) { var _a; return (_a = pG === null || pG === void 0 ? void 0 : pG.Label) === null || _a === void 0 ? void 0 : _a.default; }, | ||
}, | ||
_a[patch_utils_1.getValuePathString([ | ||
// Parameter Group Parameter Ids | ||
'Metadata', | ||
'AWS::CloudFormation::Interface', | ||
'ParameterGroups', | ||
'#', | ||
'Parameters', | ||
])] = { | ||
strategy: 'accumulate-unique', | ||
}, | ||
_a)); | ||
}; | ||
@@ -63,0 +74,0 @@ exports.patchTemplate = patchTemplate; |
{ | ||
"name": "@aws-cf-builder/utils", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"main": "dist/index.js", | ||
@@ -24,5 +24,3 @@ "files": [ | ||
"dependencies": { | ||
"@aws-cf-builder/types": "^1.5.2", | ||
"@types/flat": "^5.0.2", | ||
"flat": "^5.0.2", | ||
"@aws-cf-builder/types": "^1.5.3", | ||
"tslib": "^2.3.0", | ||
@@ -29,0 +27,0 @@ "typescript": "^4.3.5" |
Sorry, the diff of this file is not supported yet
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
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
22796
3
8
244
- Removed@types/flat@^5.0.2
- Removedflat@^5.0.2
- Removed@types/flat@5.0.5(transitive)
- Removedflat@5.0.2(transitive)
Updated@aws-cf-builder/types@^1.5.3