lodash: changed _.uniqueId() method

This commit is contained in:
Ilya Mochalov
2015-09-02 02:14:27 +05:00
parent b895e5a452
commit b4d8e49d56
2 changed files with 16 additions and 7 deletions

View File

@@ -1735,9 +1735,6 @@ class Mage {
}
}
result = <string>_.uniqueId('contact_');
result = <string>_.uniqueId();
/*********
* String
*********/
@@ -1940,6 +1937,11 @@ result = <number>(_.methodOf<number>(TestMethodOfObject, 1, 2))(['a', '0']);
result = <number>(_(TestMethodOfObject).methodOf<number>(1, 2).value())('a[0]');
result = <number>(_(TestMethodOfObject).methodOf<number>(1, 2).value())(['a', '0']);
// _.uniqueId
result = <string>_.uniqueId();
result = <string>_.uniqueId('');
result = <string>_('').uniqueId();
result = <string>_.VERSION;
result = <_.Support>_.support;
result = <_.TemplateSettings>_.templateSettings;

15
lodash/lodash.d.ts vendored
View File

@@ -8338,13 +8338,20 @@ declare module _ {
//_.uniqueId
interface LoDashStatic {
/**
* 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.
**/
* Generates a unique ID. If prefix is provided the ID is appended to it.
* @param prefix The value to prefix the ID with.
* @return Returns the unique ID.
*/
uniqueId(prefix?: string): string;
}
interface LoDashWrapper<T> {
/**
* @see _.uniqueId
*/
uniqueId(): string;
}
//_.constant
interface LoDashStatic {
/**