diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d2ab258f8..daf6ab099 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -7050,6 +7050,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 ca523aad8..5285b0e6f 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -12132,6 +12132,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 { /** @@ -18460,4 +18485,5 @@ declare module "lodash" { } // Backward compatibility with --target es5 +interface Set {} interface Map {}