diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3a857f040..23c2f3798 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -6932,6 +6932,37 @@ module TestIsSafeInteger { } } +// _.isSet +module TestIsSet { + { + let value: number|Set; + + if (_.isSet(value)) { + let result: Set = value; + } + else { + let result: number = value; + } + } + + { + let result: boolean; + + result = _.isSet(any); + result = _(1).isSet(); + result = _([]).isSet(); + result = _({}).isSet(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isSet(); + result = _([]).chain().isSet(); + result = _({}).chain().isSet(); + } +} + // _.isString module TestIsString { { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 903497617..00fe9f2dd 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -11958,6 +11958,31 @@ declare module _ { isSafeInteger(): LoDashExplicitWrapper; } + //_.isSet + interface LoDashStatic { + /** + * Checks if value is classified as a Set object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isSet(value?: any): value is Set; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isSet + */ + isSet(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isSet + */ + isSet(): LoDashExplicitWrapper; + } + //_.isString interface LoDashStatic { /** @@ -18286,4 +18311,5 @@ declare module "lodash" { } // Backward compatibility with --target es5 +interface Set {} interface Map {}