335c4n0r

elasticsearch/8/unify-return-value

No description available

Legacy
elasticsearch8migration
Public
0 downloads
0 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

This codemod updates the API response structure for search calls, replacing the previous body-only return with an object containing additional fields like statusCode, headers, and warnings

What Changed

Previously, the return value of search calls differed based on whether a callback or promise was used:

  • For promises, only the body was returned.
  • For callbacks, body, statusCode, and headers were returned separately.

Now, both callbacks and promises return an object containing body, statusCode, headers, warnings, and meta.

Before

jsx

After

jsx

Ready to contribute?

Build your own codemod and share it with the community.