We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 589b052 + 691bb59 commit d9e5c8cCopy full SHA for d9e5c8c
deploy.js
@@ -44,9 +44,10 @@ const getLatestVersion = lambdaMapping =>
44
getLastPageOfVersions(lambdaMapping)
45
.then(
46
res =>
47
- res.Versions.sort(
48
- (a, b) => (parseInt(a.Version) > parseInt(b.Version) ? -1 : 1)
49
- )[0]
+ res.Versions.reduce((prev, curr) => (
+ isNaN(curr.Version)
+ || parseInt(prev.Version) > parseInt(curr.Version) ? prev : curr
50
+ ))
51
)
52
.then(latest => ({
53
EventType: lambdaMapping.EventType,
0 commit comments