From 34a25f6aef4f9b6e921412d89906c4e9fd15f8c1 Mon Sep 17 00:00:00 2001 From: DomiR Date: Fri, 15 Jan 2016 02:04:36 +0100 Subject: [PATCH] (feature) Add _.isSymbol --- lodash/lodash-tests.ts | 21 +++++++++++++++++++++ lodash/lodash.d.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8a14db2d3..3a748e852 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -6368,6 +6368,27 @@ module TestIsString { } } +// _.isSymbol +module TestIsSymbol { + { + let result: boolean; + + result = _.isSymbol(any); + + result = _(1).isSymbol(); + result = _([]).isSymbol(); + result = _({}).isSymbol(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isSymbol(); + result = _([]).chain().isSymbol(); + result = _({}).chain().isSymbol(); + } +} + // _.isTypedArray module TestIsTypedArray { { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 24bb866a0..56b21f99c 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10251,6 +10251,41 @@ declare module _ { isString(): LoDashExplicitWrapper; } + //_.isSymbol + interface LoDashStatic { + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + isSymbol(value: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isSymbol + */ + isSymbol(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isSymbol + */ + isSymbol(): LoDashExplicitWrapper; + } + //_.isTypedArray interface LoDashStatic { /**