From b2a83616344f682049a918eb07fea6609506367e Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Sun, 20 Oct 2013 20:22:02 -0400 Subject: [PATCH] added _.uniqueId definition --- lodash/lodash-tests.ts | 2 ++ lodash/lodash.d.ts | 20 +++++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 30fd3477e..9e0370295 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -771,6 +771,8 @@ result = _.times(3, function(n: number) { this.cast(n); }, mage); result = _.unescape('Moe, Larry & Curly'); +result = _.uniqueId('contact_'); +result = _.uniqueId(); ////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 8f65399ef..158968948 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2844,24 +2844,14 @@ declare module _ { * @return The unescaped string. **/ export function unescape( - string: string): string; - - - - + string: string): string; /** - * Generate a globally-unique id for client-side models or DOM elements that need one. - * If prefix is passed, the id will be appended to it. Without prefix, returns an integer. - * @param prefix A prefix string to start the unique ID with. - * @return Unique string ID beginning with `prefix`. + * Generates a unique ID. If prefix is provided the ID will be appended to it. + * @param prefix The value to prefix the ID with. + * @return Returns the unique ID. **/ - export function uniqueId(prefix: string): string; - - /** - * @see _.uniqueId - **/ - export function uniqueId(): number; + export function uniqueId(prefix?: string): string;