Skip to content

Commit

Permalink
remove withLongNumerals in HttpFetchOptions as it is deprecated in 3.0 (
Browse files Browse the repository at this point in the history
#9448)

* remove withLongNumerals in HttpFetchOptions as it is deprecated in 3.0

Signed-off-by: Justin Kim <jungkm@amazon.com>

* Changeset file for PR #9448 created/updated

---------

Signed-off-by: Justin Kim <jungkm@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
angle943 and opensearch-changeset-bot[bot] authored Feb 27, 2025
1 parent 14a6cfa commit 06748d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/9448.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
breaking:
- Remove `withLongNumerals` in `HttpFetchOptions`. ([#9448](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9448))
14 changes: 4 additions & 10 deletions src/core/public/http/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,14 @@ export class Fetch {
if (NDJSON_CONTENT.test(contentType)) {
body = await response.blob();
} else if (JSON_CONTENT.test(contentType)) {
// ToDo: [3.x] Remove withLongNumerals
body =
fetchOptions.withLongNumeralsSupport || fetchOptions.withLongNumerals
? parse(await response.text())
: await response.json();
body = fetchOptions.withLongNumeralsSupport
? parse(await response.text())
: await response.json();
} else {
const text = await response.text();

try {
// ToDo: [3.x] Remove withLongNumerals
body =
fetchOptions.withLongNumeralsSupport || fetchOptions.withLongNumerals
? parse(text)
: JSON.parse(text);
body = fetchOptions.withLongNumeralsSupport ? parse(text) : JSON.parse(text);
} catch (err) {
body = text;
}
Expand Down
3 changes: 0 additions & 3 deletions src/core/public/http/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@ export interface HttpFetchOptions extends HttpRequestInit {
*/
withLongNumeralsSupport?: boolean;

/** @deprecated use {@link withLongNumeralsSupport} instead */
withLongNumerals?: boolean;

prependOptions?: PrependOptions;
}

Expand Down

0 comments on commit 06748d2

Please sign in to comment.