added _.mixin definition

This commit is contained in:
Brian Zengel
2013-10-20 18:19:46 -04:00
parent 0f2cffa18e
commit a00e1937b3
2 changed files with 21 additions and 15 deletions
+8
View File
@@ -714,6 +714,14 @@ result = <any[]>_.values({ 'one': 1, 'two': 2, 'three': 3 });
result = <string>_.escape('Moe, Larry & Curly');
result = <{ name: string }>_.identity({ 'name': 'moe' });
_.mixin({
'capitalize': function(string) {
return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
}
});
//////////////////////////////////////////////////////////////////////////////////////////////////
var iceCream = { flavor: "chocolate" };
+13 -15
View File
@@ -2714,8 +2714,18 @@ declare module _ {
**/
export function escape(str: string): string;
/**
* This method returns the first argument provided to it.
* @param value Any value.
* @return value.
**/
export function identity<T>(value: T): T;
/**
* Adds function properties of a source object to the lodash function and chainable wrapper.
* @param object The object of function properties to add to lodash.
**/
export function mixin(object: Dictionary<(value: any) => any>): void;
@@ -2733,13 +2743,7 @@ declare module _ {
**/
export function noConflict(): any;
/**
* Returns the same value that is used as the argument. In math: f(x) = x
* This function looks useless, but is used throughout Lo-Dash as a default iterator.
* @param value Identity of this object.
* @return `value`.
**/
export function identity<T>(value: T): T;
/**
* Invokes the given iterator function n times.
@@ -2765,13 +2769,7 @@ declare module _ {
**/
export function random(min: number, max: number): number;
/**
* Allows you to extend Lo-Dash with your own utility functions. Pass a hash of
* {name: function} definitions to have your functions added to the Lo-Dash object,
* as well as the OOP wrapper.
* @param object Mixin object containing key/function pairs to add to the Lo-Dash object.
**/
export function mixin(object: any): void;
/**
* Generate a globally-unique id for client-side models or DOM elements that need one.