import { expectType } from 'tsd' ; import { set , setWith , assoc , assocPath } from '../fp' ; const someObj = { } ; const anyValue = 'any value' ; function customizer ( value , key , obj ) { expectType < any > ( value ) ; expectType < string > ( key ) ; expectType < object > ( obj ) ; } expectType < object > ( set ( 'a.b.c' , anyValue , someObj ) ) ; expectType < object > ( set ( 'a.b.c' ) ( anyValue , someObj ) ) ; expectType < object > ( set ( 'a.b.c' ) ( anyValue ) ( someObj ) ) ; expectType < object > ( set ( 'a.b.c' , anyValue ) ( someObj ) ) ; expectType < object > ( set ( [ 'a.b.c' ] , anyValue , someObj ) ) ; expectType < object > ( set ( [ 'a.b.c' ] ) ( anyValue , someObj ) ) ; expectType < object > ( set ( [ 'a.b.c' ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( set ( [ 'a.b.c' ] , anyValue ) ( someObj ) ) ; expectType < object > ( set ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue , someObj ) ) ; expectType < object > ( set ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue , someObj ) ) ; expectType < object > ( set ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( set ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue ) ( someObj ) ) ; expectType < object > ( assoc ( 'a.b.c' , anyValue , someObj ) ) ; expectType < object > ( assoc ( 'a.b.c' ) ( anyValue , someObj ) ) ; expectType < object > ( assoc ( 'a.b.c' ) ( anyValue ) ( someObj ) ) ; expectType < object > ( assoc ( 'a.b.c' , anyValue ) ( someObj ) ) ; expectType < object > ( assoc ( [ 'a.b.c' ] , anyValue , someObj ) ) ; expectType < object > ( assoc ( [ 'a.b.c' ] ) ( anyValue , someObj ) ) ; expectType < object > ( assoc ( [ 'a.b.c' ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( assoc ( [ 'a.b.c' ] , anyValue ) ( someObj ) ) ; expectType < object > ( assoc ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue , someObj ) ) ; expectType < object > ( assoc ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue , someObj ) ) ; expectType < object > ( assoc ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( assoc ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue ) ( someObj ) ) ; expectType < object > ( assocPath ( 'a.b.c' , anyValue , someObj ) ) ; expectType < object > ( assocPath ( 'a.b.c' ) ( anyValue , someObj ) ) ; expectType < object > ( assocPath ( 'a.b.c' ) ( anyValue ) ( someObj ) ) ; expectType < object > ( assocPath ( 'a.b.c' , anyValue ) ( someObj ) ) ; expectType < object > ( assocPath ( [ 'a.b.c' ] , anyValue , someObj ) ) ; expectType < object > ( assocPath ( [ 'a.b.c' ] ) ( anyValue , someObj ) ) ; expectType < object > ( assocPath ( [ 'a.b.c' ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( assocPath ( [ 'a.b.c' ] , anyValue ) ( someObj ) ) ; expectType < object > ( assocPath ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue , someObj ) ) ; expectType < object > ( assocPath ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue , someObj ) ) ; expectType < object > ( assocPath ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( assocPath ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , 'a.b.c' , anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer ) ( 'a.b.c' , anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer ) ( 'a.b.c' ) ( anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer ) ( 'a.b.c' ) ( anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , 'a.b.c' ) ( anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , 'a.b.c' , anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , 'a.b.c' ) ( anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer , [ 'a.b.c' ] , anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer ) ( [ 'a.b.c' ] ) ( anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer ) ( [ 'a.b.c' ] , anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer ) ( [ 'a.b.c' ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , [ 'a.b.c' ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , [ 'a.b.c' ] , anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , [ 'a.b.c' ] ) ( anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer , [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer ) ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer ) ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue , someObj ) ) ; expectType < object > ( setWith ( customizer ) ( [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] , anyValue ) ( someObj ) ) ; expectType < object > ( setWith ( customizer , [ 'a.b.c' , 2 , Symbol ( 'hep' ) ] ) ( anyValue , someObj ) ) ;