mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* rename @elastic/* packages to @kbn/* * update yarn.lock * [CI] Auto-commit changed files from 'node scripts/generate packages_build_manifest' * update lint task * review feedback Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
25 lines
1,001 B
TypeScript
25 lines
1,001 B
TypeScript
/*
|
|
* Elasticsearch B.V licenses this file to you under the MIT License.
|
|
* See `packages/kbn-safer-lodash-set/LICENSE` for more information.
|
|
*/
|
|
|
|
import { expectType } from 'tsd';
|
|
import set from '../fp/set';
|
|
|
|
const someObj: object = {};
|
|
const anyValue: any = 'any value';
|
|
|
|
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));
|