Skip to content

Commit

Permalink
Update Lints
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Sep 4, 2024
1 parent 6c8cc02 commit 0c10a65
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 114 deletions.
28 changes: 21 additions & 7 deletions lib/merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export default function() {
if (arg.Metadata) Object.keys(arg.Metadata).forEach((key) => {
if (names.Metadata.has(key)) {
try { assert.deepEqual(template.Metadata[key], arg.Metadata[key]); }
catch (err) { throw new Error('Metadata name used more than once: ' + key); }
catch (err) { throw new Error('Metadata name used more than once: ' + key, {
cause: err
}); }
}

template.Metadata[key] = arg.Metadata[key];
Expand All @@ -60,7 +62,9 @@ export default function() {
if (arg.Parameters) Object.keys(arg.Parameters).forEach((key) => {
if (names.Parameters.has(key)) {
try { assert.deepEqual(template.Parameters[key], arg.Parameters[key]); }
catch (err) { throw new Error('Parameters name used more than once: ' + key); }
catch (err) { throw new Error('Parameters name used more than once: ' + key, {
cause: err
}); }
}

template.Parameters[key] = arg.Parameters[key];
Expand All @@ -70,7 +74,9 @@ export default function() {
if (arg.Rules) Object.keys(arg.Rules).forEach((key) => {
if (names.Rules.has(key)) {
try { assert.deepEqual(template.Rules[key], arg.Rules[key]); }
catch (err) { throw new Error('Rules name used more than once: ' + key); }
catch (err) { throw new Error('Rules name used more than once: ' + key, {
cause: err
}); }
}

template.Rules[key] = arg.Rules[key];
Expand All @@ -80,7 +86,9 @@ export default function() {
if (arg.Mappings) Object.keys(arg.Mappings).forEach((key) => {
if (names.Mappings.has(key)) {
try { assert.deepEqual(template.Mappings[key], arg.Mappings[key]); }
catch (err) { throw new Error('Mappings name used more than once: ' + key); }
catch (err) { throw new Error('Mappings name used more than once: ' + key, {
cause: err
}); }
}

template.Mappings[key] = arg.Mappings[key];
Expand All @@ -90,7 +98,9 @@ export default function() {
if (arg.Conditions) Object.keys(arg.Conditions).forEach((key) => {
if (names.Conditions.has(key)) {
try { assert.deepEqual(template.Conditions[key], arg.Conditions[key]); }
catch (err) { throw new Error('Conditions name used more than once: ' + key); }
catch (err) { throw new Error('Conditions name used more than once: ' + key, {
cause: err
}); }
}

template.Conditions[key] = arg.Conditions[key];
Expand All @@ -100,7 +110,9 @@ export default function() {
if (arg.Resources) Object.keys(arg.Resources).forEach((key) => {
if (names.Resources.has(key)) {
try { assert.deepEqual(template.Resources[key], arg.Resources[key]); }
catch (err) { throw new Error('Resources name used more than once: ' + key); }
catch (err) { throw new Error('Resources name used more than once: ' + key, {
cause: err
}); }
}

template.Resources[key] = arg.Resources[key];
Expand All @@ -110,7 +122,9 @@ export default function() {
if (arg.Outputs) Object.keys(arg.Outputs).forEach((key) => {
if (names.Outputs.has(key)) {
try { assert.deepEqual(template.Outputs[key], arg.Outputs[key]); }
catch (err) { throw new Error('Outputs name used more than once: ' + key); }
catch (err) { throw new Error('Outputs name used more than once: ' + key, {
cause: err
}); }
}

template.Outputs[key] = arg.Outputs[key];
Expand Down
Loading

0 comments on commit 0c10a65

Please sign in to comment.