File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ export function objectToFormData(
22 object ,
33 formData = new FormData ( ) ,
44 parent = null ,
5- ) {
5+ ) : FormData | void {
66 if ( object === null || object === 'undefined' || object . length === 0 ) {
77 return formData . append ( parent , object )
88 }
Original file line number Diff line number Diff line change 11import { isMatch } from './matcher'
22
3- export function isArray ( object : any ) {
3+ export function isArray ( object : any ) : boolean {
44 return Object . prototype . toString . call ( object ) === '[object Array]'
55}
66
7- export function isFile ( object : any ) {
7+ export function isFile ( object : any ) : boolean {
8+ if ( typeof File !== 'function' || typeof FileList !== 'function' ) {
9+ return false
10+ }
811 return object instanceof File || object instanceof FileList
912}
1013
11- export function merge ( a : string | any , b : string | any ) {
14+ export function merge ( a : string | any , b : string | any ) : void {
1215 for ( const key in b ) {
16+ if ( ! b . hasOwnProperty ( key ) ) {
17+ continue
18+ }
1319 a [ key ] = cloneDeep ( b [ key ] )
1420 }
1521}
1622
17- export function cloneDeep ( object : any ) {
23+ export function cloneDeep ( object : any ) : any {
1824 if ( object === null ) {
1925 return null
2026 }
You can’t perform that action at this time.
0 commit comments