mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-30 23:30:06 +00:00
Merge pull request #7999 from chrootsu/lodash-unset
lodash: changed _.unset
This commit is contained in:
@@ -9379,6 +9379,34 @@ module TestTransform {
|
||||
}
|
||||
}
|
||||
|
||||
// _.unset
|
||||
namespace TestUnset {
|
||||
type SampleObject = {a: {b: string; c: boolean}};
|
||||
|
||||
let object: SampleObject;
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
_.unset<SampleObject>(object, 'a.b');
|
||||
_.unset<SampleObject>(object, ['a', 'b']);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitWrapper<boolean>;
|
||||
|
||||
result = _(object).unset('a.b');
|
||||
result = _(object).unset(['a', 'b']);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(object).chain().unset('a.b');
|
||||
result = _(object).chain().unset(['a', 'b']);
|
||||
}
|
||||
}
|
||||
|
||||
// _.values
|
||||
module TestValues {
|
||||
let object: _.Dictionary<TResult>;
|
||||
|
||||
46
lodash/lodash.d.ts
vendored
46
lodash/lodash.d.ts
vendored
@@ -5295,21 +5295,6 @@ declare module _ {
|
||||
): any[];
|
||||
}
|
||||
|
||||
//_.unset
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Removes the property at path of object.
|
||||
*
|
||||
* @param object The object to modify.
|
||||
* @param path The path of the property to unset.
|
||||
* @return Returns true if the property is deleted, else false.
|
||||
*/
|
||||
unset<T>(
|
||||
object: T,
|
||||
path: StringRepresentable | StringRepresentable[]
|
||||
): boolean;
|
||||
}
|
||||
|
||||
//_.unzip
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
@@ -15922,6 +15907,37 @@ declare module _ {
|
||||
): LoDashImplicitArrayWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.unset
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Removes the property at path of object.
|
||||
*
|
||||
* Note: This method mutates object.
|
||||
*
|
||||
* @param object The object to modify.
|
||||
* @param path The path of the property to unset.
|
||||
* @return Returns true if the property is deleted, else false.
|
||||
*/
|
||||
unset<T>(
|
||||
object: T,
|
||||
path: StringRepresentable|StringRepresentable[]
|
||||
): boolean;
|
||||
}
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.unset
|
||||
*/
|
||||
unset(path: StringRepresentable|StringRepresentable[]): LoDashImplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.unset
|
||||
*/
|
||||
unset(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.values
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user