Skip to content

Commit 7ea947d

Browse files
committed
Remove deprecated isFileLike() utility and FormDataEncoder.getContentLength() method
1 parent 3038cd4 commit 7ea947d

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

src/FormDataEncoder.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable no-restricted-globals */
2+
23
import type {RawHeaders, FormDataEncoderHeaders} from "./util/Headers.js"
34
import {getStreamIterator} from "./util/getStreamIterator.js"
45
import {createBoundary} from "./util/createBoundary.js"
@@ -253,16 +254,6 @@ export class FormDataEncoder {
253254
return String(length + this.#footer.byteLength)
254255
}
255256

256-
/**
257-
* Returns form-data content length
258-
*
259-
* @deprecated Use FormDataEncoder.contentLength or FormDataEncoder.headers["Content-Length"] instead
260-
*/
261-
/* c8 ignore next 3 */
262-
getContentLength(): number | undefined {
263-
return this.contentLength == null ? undefined : Number(this.contentLength)
264-
}
265-
266257
/**
267258
* Creates an iterator allowing to go through form-data parts (with metadata).
268259
* This method **will not** read the files and **will not** split values big into smaller chunks.

src/util/isFile.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {FileLike} from "../FileLike.js"
2+
23
import {isFunction} from "./isFunction.js"
34

45
/**
@@ -38,8 +39,3 @@ export const isFile = (value: unknown): value is FileLike => Boolean(
3839
&& isFunction((value as FileLike).stream)
3940
&& (value as FileLike).name != null
4041
)
41-
42-
/**
43-
* @deprecated use `isFile` instead
44-
*/
45-
export const isFileLike = isFile

0 commit comments

Comments
 (0)