From 5fa6cb111b5efa8e2abec8ced82e5c3cc664aafa Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sun, 16 Aug 2015 03:15:18 +0500 Subject: [PATCH] lodash: added _.isTypedArray() method --- lodash/lodash-tests.ts | 4 ++++ lodash/lodash.d.ts | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 9d87e2a37..e5918cafb 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1075,6 +1075,10 @@ result = _({}).isMatch({}, testIsMatchCustiomizerFn, {}); result = _.isNative(Array.prototype.push); result = _(Array.prototype.push).isNative(); +// _.isTypedArray +result = _.isTypedArray([]); +result = _([]).isTypedArray(); + // _.lt result = _.lt(1, 2); result = _(1).lt(2); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index b2603ee95..e63970b5b 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -5905,6 +5905,23 @@ declare module _ { isNative(): boolean; } + //_.isTypedArray + interface LoDashStatic { + /** + * Checks if value is classified as a typed array. + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isTypedArray(value: any): boolean; + } + + interface LoDashWrapperBase { + /** + * see _.isTypedArray + */ + isTypedArray(): boolean; + } + //_.lt interface LoDashStatic { /**