Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: JMESPath / FlatMap Middleware [Needs +1s] #798

Closed
willfarrell opened this issue Feb 1, 2022 · 1 comment
Closed

Proposal: JMESPath / FlatMap Middleware [Needs +1s] #798

willfarrell opened this issue Feb 1, 2022 · 1 comment

Comments

@willfarrell
Copy link
Member

willfarrell commented Feb 1, 2022

Give a thumbs up if this would have value to you.

aws-powertools/powertools-lambda-typescript#508
https://jmespath.org/
https://www.npmjs.com/package/jmespath

PoC

import { search } from 'jmespath'

const defaults = {
  expression: undefined
}

const jmespathMiddleware = (opts) => {
  const {expression} = {...defaults, ...opts}
  
  const jmespathBeforeMiddleware = (request) => {
    request.event = search(request.event, expression)
  }
  
  return {
    before: jmespathBeforeMiddleware
  }
}

export default jmespathMiddleware

Questions

@willfarrell willfarrell changed the title Proposal: JMESPath Middleware Proposal: JMESPath / FlatMap Middleware Feb 9, 2022
@willfarrell willfarrell changed the title Proposal: JMESPath / FlatMap Middleware Proposal: JMESPath / FlatMap Middleware [Needs +1s] Feb 9, 2022
@willfarrell
Copy link
Member Author

Closing due to lack of interest. Please comment if you'd like us to revisit including this as a core middleware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant