-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into hotswap_inline_lambda
- Loading branch information
Showing
304 changed files
with
4,940 additions
and
760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { filterLogicalId, formatFailure, matchSection } from './section'; | ||
import { Template } from './template'; | ||
|
||
export function findParameters(template: Template, logicalId: string, props: any = {}): { [key: string]: { [key: string]: any } } { | ||
const section: { [key: string] : {} } = template.Parameters; | ||
const result = matchSection(filterLogicalId(section, logicalId), props); | ||
|
||
if (!result.match) { | ||
return {}; | ||
} | ||
|
||
return result.matches; | ||
} | ||
|
||
export function hasParameter(template: Template, logicalId: string, props: any): string | void { | ||
const section: { [key: string] : {} } = template.Parameters; | ||
const result = matchSection(filterLogicalId(section, logicalId), props); | ||
if (result.match) { | ||
return; | ||
} | ||
|
||
if (result.closestResult === undefined) { | ||
return 'No parameters found in the template'; | ||
} | ||
|
||
return [ | ||
`Template has ${result.analyzedCount} parameters, but none match as expected.`, | ||
formatFailure(result.closestResult), | ||
].join('\n'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.