mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
fix types based on tests
This commit is contained in:
+79
-79
@@ -80,46 +80,46 @@ Dog.prototype.bark = function() {
|
||||
console.log('Woof, woof!');
|
||||
};
|
||||
|
||||
var result;
|
||||
var result : any;
|
||||
|
||||
/*************
|
||||
* Chaining *
|
||||
*************/
|
||||
result = <LoDash.LoDashWrapper<string>>_('test');
|
||||
result = <LoDash.LoDashWrapper<number>>_(1);
|
||||
result = <LoDash.LoDashWrapper<boolean>>_(true);
|
||||
result = <LoDash.LoDashArrayWrapper<string>>_(['test1', 'test2']);
|
||||
result = <LoDash.LoDashObjectWrapper<LoDash.Dictionary<string>>>_({'key1': 'test1', 'key2': 'test2'});
|
||||
result = <_.LoDashWrapper<string>>_('test');
|
||||
result = <_.LoDashWrapper<number>>_(1);
|
||||
result = <_.LoDashWrapper<boolean>>_(true);
|
||||
result = <_.LoDashArrayWrapper<string>>_(['test1', 'test2']);
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<string>>>_({'key1': 'test1', 'key2': 'test2'});
|
||||
|
||||
result = <LoDash.LoDashWrapper<string>>_.chain('test');
|
||||
result = <LoDash.LoDashWrapper<string>>_('test').chain();
|
||||
result = <LoDash.LoDashWrapper<number>>_.chain(1);
|
||||
result = <LoDash.LoDashWrapper<number>>_(1).chain();
|
||||
result = <LoDash.LoDashWrapper<boolean>>_.chain(true);
|
||||
result = <LoDash.LoDashWrapper<boolean>>_(true).chain();
|
||||
result = <LoDash.LoDashArrayWrapper<string>>_.chain(['test1', 'test2']);
|
||||
result = <LoDash.LoDashArrayWrapper<string>>_(['test1', 'test2']).chain();
|
||||
result = <LoDash.LoDashObjectWrapper<LoDash.Dictionary<string>>>_.chain({'key1': 'test1', 'key2': 'test2'});
|
||||
result = <LoDash.LoDashObjectWrapper<LoDash.Dictionary<string>>>_({'key1': 'test1', 'key2': 'test2'}).chain();
|
||||
result = <_.LoDashWrapper<string>>_.chain('test');
|
||||
result = <_.LoDashWrapper<string>>_('test').chain();
|
||||
result = <_.LoDashWrapper<number>>_.chain(1);
|
||||
result = <_.LoDashWrapper<number>>_(1).chain();
|
||||
result = <_.LoDashWrapper<boolean>>_.chain(true);
|
||||
result = <_.LoDashWrapper<boolean>>_(true).chain();
|
||||
result = <_.LoDashArrayWrapper<string>>_.chain(['test1', 'test2']);
|
||||
result = <_.LoDashArrayWrapper<string>>_(['test1', 'test2']).chain();
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<string>>>_.chain({'key1': 'test1', 'key2': 'test2'});
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<string>>>_({'key1': 'test1', 'key2': 'test2'}).chain();
|
||||
|
||||
//Wrapped array shortcut methods
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).concat(5, 6);
|
||||
result = <LoDash.LoDashWrapper<string>>_([1, 2, 3, 4]).join(',');
|
||||
result = <LoDash.LoDashWrapper<number>>_([1, 2, 3, 4]).pop();
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).concat(5, 6);
|
||||
result = <_.LoDashWrapper<string>>_([1, 2, 3, 4]).join(',');
|
||||
result = <_.LoDashWrapper<number>>_([1, 2, 3, 4]).pop();
|
||||
_([1, 2, 3, 4]).push(5, 6, 7);
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).reverse();
|
||||
result = <LoDash.LoDashWrapper<number>>_([1, 2, 3, 4]).shift();
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).slice(1, 2);
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).slice(2);
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).sort((a, b) => 1);
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).splice(1);
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).splice(1, 2, 5, 6);
|
||||
result = <LoDash.LoDashWrapper<number>>_([1, 2, 3, 4]).unshift(5, 6);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).reverse();
|
||||
result = <_.LoDashWrapper<number>>_([1, 2, 3, 4]).shift();
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).slice(1, 2);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).slice(2);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).sort((a, b) => 1);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).splice(1);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).splice(1, 2, 5, 6);
|
||||
result = <_.LoDashWrapper<number>>_([1, 2, 3, 4]).unshift(5, 6);
|
||||
|
||||
result = <number[]>_.tap([1, 2, 3, 4], function(array) { console.log(array); });
|
||||
result = <LoDash.LoDashWrapper<string>>_('test').tap(function(value) { console.log(value); });
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).tap(function(array) { console.log(array); });
|
||||
result = <LoDash.LoDashObjectWrapper<LoDash.Dictionary<string>>>_({'key1': 'test1', 'key2': 'test2'}).tap(function(array) { console.log(array); });
|
||||
result = <_.LoDashWrapper<string>>_('test').tap(function(value) { console.log(value); });
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4]).tap(function(array) { console.log(array); });
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<string>>>_({'key1': 'test1', 'key2': 'test2'}).tap(function(array) { console.log(array); });
|
||||
|
||||
result = <string>_('test').toString();
|
||||
result = <string>_([1, 2, 3]).toString();
|
||||
@@ -127,20 +127,20 @@ result = <string>_({'key1': 'test1', 'key2': 'test2'}).toString();
|
||||
|
||||
result = <string>_('test').valueOf();
|
||||
result = <number[]>_([1, 2, 3]).valueOf();
|
||||
result = <LoDash.Dictionary<string>>_({'key1': 'test1', 'key2': 'test2'}).valueOf();
|
||||
result = <_.Dictionary<string>>_({'key1': 'test1', 'key2': 'test2'}).valueOf();
|
||||
|
||||
result = <string>_('test').value();
|
||||
result = <number[]>_([1, 2, 3]).value();
|
||||
result = <LoDash.Dictionary<string>>_({'key1': 'test1', 'key2': 'test2'}).value();
|
||||
result = <_.Dictionary<string>>_({'key1': 'test1', 'key2': 'test2'}).value();
|
||||
|
||||
// /*************
|
||||
// * Arrays *
|
||||
// *************/
|
||||
result = <any[]>_.compact([0, 1, false, 2, '', 3]);
|
||||
result = <LoDash.LoDashArrayWrapper<any>>_([0, 1, false, 2, '', 3]).compact();
|
||||
result = <_.LoDashArrayWrapper<any>>_([0, 1, false, 2, '', 3]).compact();
|
||||
|
||||
result = <number[]>_.difference([1, 2, 3, 4, 5], [5, 2, 10]);
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3, 4, 5]).difference([5, 2, 10]);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3, 4, 5]).difference([5, 2, 10]);
|
||||
|
||||
result = <number[]>_.rest([1, 2, 3]);
|
||||
result = <number[]>_.rest([1, 2, 3], 2);
|
||||
@@ -148,6 +148,7 @@ result = <number[]>_.rest([1, 2, 3], function(num) {
|
||||
return num < 3;
|
||||
});
|
||||
result = <IFoodOrganic[]>_.rest(foodsOrganic, 'test');
|
||||
var result : any;
|
||||
result = <IFoodType[]>_.rest(foodsType, { 'test': 'value' });
|
||||
|
||||
result = <number[]>_.drop([1, 2, 3]);
|
||||
@@ -196,9 +197,7 @@ result = <IFoodType[]>_.first(foodsType, { 'type': 'fruit' });
|
||||
|
||||
result = <number>_.take([1, 2, 3]);
|
||||
result = <number[]>_.take([1, 2, 3], 2);
|
||||
result = <number[]>_.take([1, 2, 3], function(num) {
|
||||
return num < 3;
|
||||
});
|
||||
result = <number[]>_.take([1, 2, 3], (num) => num < 3);
|
||||
result = <IFoodOrganic[]>_.take(foodsOrganic, 'organic');
|
||||
result = <IFoodType[]>_.take(foodsType, { 'type': 'fruit' });
|
||||
|
||||
@@ -206,9 +205,10 @@ result = <number[]>_.flatten([1, [2], [3, [[4]]]]);
|
||||
result = <any[]>_.flatten([1, [2], [3, [[4]]]], true);
|
||||
result = <string[]>_.flatten(stoogesQuotes, 'quotes');
|
||||
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, [2], [3, [[4]]]]).flatten();
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, [2], [3, [[4]]]]).flatten(true);
|
||||
result = <LoDash.LoDashArrayWrapper<string>>_(stoogesQuotes).flatten('quotes');
|
||||
var result: any
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, [2], [3, [[4]]]]).flatten();
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, [2], [3, [[4]]]]).flatten(true);
|
||||
result = <_.LoDashArrayWrapper<string>>_(stoogesQuotes).flatten('quotes');
|
||||
|
||||
result = <number>_.indexOf([1, 2, 3, 1, 2, 3], 2);
|
||||
result = <number>_.indexOf([1, 2, 3, 1, 2, 3], 2, 3);
|
||||
@@ -303,13 +303,13 @@ result = <boolean>_.contains('curly', 'ur');
|
||||
result = <boolean>_.include({ 'name': 'moe', 'age': 40 }, 'moe');
|
||||
result = <boolean>_.include('curly', 'ur');
|
||||
|
||||
result = <LoDash.Dictionary<number>>_.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); });
|
||||
result = <LoDash.Dictionary<number>>_.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
|
||||
result = <LoDash.Dictionary<number>>_.countBy(['one', 'two', 'three'], 'length');
|
||||
result = <_.Dictionary<number>>_.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); });
|
||||
result = <_.Dictionary<number>>_.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
|
||||
result = <_.Dictionary<number>>_.countBy(['one', 'two', 'three'], 'length');
|
||||
|
||||
result = <LoDash.LoDashObjectWrapper<LoDash.Dictionary<number>>>_([4.3, 6.1, 6.4]).countBy(function(num) { return Math.floor(num); });
|
||||
result = <LoDash.LoDashObjectWrapper<LoDash.Dictionary<number>>>_([4.3, 6.1, 6.4]).countBy(function(num) { return this.floor(num); }, Math);
|
||||
result = <LoDash.LoDashObjectWrapper<LoDash.Dictionary<number>>>_(['one', 'two', 'three']).countBy('length');
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<number>>>_([4.3, 6.1, 6.4]).countBy(function(num) { return Math.floor(num); });
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<number>>>_([4.3, 6.1, 6.4]).countBy(function(num) { return this.floor(num); }, Math);
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<number>>>_(['one', 'two', 'three']).countBy('length');
|
||||
|
||||
result = <boolean>_.every([true, 1, null, 'yes'], Boolean);
|
||||
result = <boolean>_.every(stoogesAges, 'age');
|
||||
@@ -360,30 +360,30 @@ result = <IFoodCombined>_.findLast(foodsCombined, { 'type': 'vegetable' });
|
||||
result = <IFoodCombined>_.findLast(foodsCombined, 'organic');
|
||||
|
||||
result = <number[]>_.forEach([1, 2, 3], function(num) { console.log(num); });
|
||||
result = <LoDash.Dictionary<number>>_.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
result = <_.Dictionary<number>>_.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
|
||||
result = <number[]>_.each([1, 2, 3], function(num) { console.log(num); });
|
||||
result = <LoDash.Dictionary<number>>_.each({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
result = <_.Dictionary<number>>_.each({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3]).forEach(function(num) { console.log(num); });
|
||||
result = <LoDash.LoDashObjectWrapper<LoDash.Dictionary<number>>>_({ 'one': 1, 'two': 2, 'three': 3 }).forEach(function(num) { console.log(num); });
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3]).forEach(function(num) { console.log(num); });
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<number>>>_({ 'one': 1, 'two': 2, 'three': 3 }).forEach(function(num) { console.log(num); });
|
||||
|
||||
result = <LoDash.LoDashArrayWrapper<number>>_([1, 2, 3]).each(function(num) { console.log(num); });
|
||||
result = <LoDash.LoDashObjectWrapper<LoDash.Dictionary<number>>>_({ 'one': 1, 'two': 2, 'three': 3 }).each(function(num) { console.log(num); });
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3]).each(function(num) { console.log(num); });
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<number>>>_({ 'one': 1, 'two': 2, 'three': 3 }).each(function(num) { console.log(num); });
|
||||
|
||||
result = <number[]>_.forEachRight([1, 2, 3], function(num) { console.log(num); });
|
||||
result = <LoDash.Dictionary<number>>_.forEachRight({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
result = <_.Dictionary<number>>_.forEachRight({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
|
||||
result = <number[]>_.eachRight([1, 2, 3], function(num) { console.log(num); });
|
||||
result = <LoDash.Dictionary<number>>_.eachRight({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
result = <_.Dictionary<number>>_.eachRight({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
|
||||
result = <LoDash.Dictionary<number[]>>_.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); });
|
||||
result = <LoDash.Dictionary<number[]>>_.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
|
||||
result = <LoDash.Dictionary<string[]>>_.groupBy(['one', 'two', 'three'], 'length');
|
||||
result = <_.Dictionary<number[]>>_.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); });
|
||||
result = <_.Dictionary<number[]>>_.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
|
||||
result = <_.Dictionary<string[]>>_.groupBy(['one', 'two', 'three'], 'length');
|
||||
|
||||
result = <LoDash.Dictionary<IKey>>_.indexBy(keys, 'dir');
|
||||
result = <LoDash.Dictionary<IKey>>_.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
|
||||
result = <LoDash.Dictionary<IKey>>_.indexBy(keys, function(key) { this.fromCharCode(key.code); }, String);
|
||||
result = <_.Dictionary<IKey>>_.indexBy(keys, 'dir');
|
||||
result = <_.Dictionary<IKey>>_.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
|
||||
result = <_.Dictionary<IKey>>_.indexBy(keys, function(key) { this.fromCharCode(key.code); }, String);
|
||||
|
||||
result = <any[]>_.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
|
||||
result = <any[]>_.invoke([123, 456], String.prototype.split, '');
|
||||
@@ -537,19 +537,19 @@ var greet = function(formatted) {
|
||||
};
|
||||
|
||||
result = <Function>_.compose(greet, format);
|
||||
result = <LoDash.LoDashObjectWrapper<Function>>_(greet).compose(format);
|
||||
result = <_.LoDashObjectWrapper<Function>>_(greet).compose(format);
|
||||
|
||||
var createCallbackObj = { name: 'Joe' };
|
||||
result = <() => any>_.createCallback('name');
|
||||
result = <() => boolean>_.createCallback(createCallbackObj);
|
||||
result = <LoDash.LoDashObjectWrapper<() => any>>_('name').createCallback();
|
||||
result = <LoDash.LoDashObjectWrapper<() => boolean>>_(createCallbackObj).createCallback();
|
||||
result = <_.LoDashObjectWrapper<() => any>>_('name').createCallback();
|
||||
result = <_.LoDashObjectWrapper<() => boolean>>_(createCallbackObj).createCallback();
|
||||
|
||||
result = <Function>_.curry(function(a, b, c) {
|
||||
console.log(a + b + c);
|
||||
});
|
||||
|
||||
result = <LoDash.LoDashObjectWrapper<Function>>_(function(a, b, c) {
|
||||
result = <_.LoDashObjectWrapper<Function>>_(function(a, b, c) {
|
||||
console.log(a + b + c);
|
||||
}).curry();
|
||||
|
||||
@@ -565,23 +565,23 @@ source.addEventListener('message', <Function>_.debounce(function() {}, 250, {
|
||||
'maxWait': 1000
|
||||
}), false);
|
||||
|
||||
result = <LoDash.LoDashObjectWrapper<Function>>_(function() {}).debounce(150);
|
||||
result = <_.LoDashObjectWrapper<Function>>_(function() {}).debounce(150);
|
||||
|
||||
jQuery('#postbox').on('click', <LoDash.LoDashObjectWrapper<Function>>_(function() {}).debounce(300, {
|
||||
jQuery('#postbox').on('click', <_.LoDashObjectWrapper<Function>>_(function() {}).debounce(300, {
|
||||
'leading': true,
|
||||
'trailing': false
|
||||
}));
|
||||
|
||||
source.addEventListener('message', <LoDash.LoDashObjectWrapper<Function>>_(function() {}).debounce(250, {
|
||||
source.addEventListener('message', <_.LoDashObjectWrapper<Function>>_(function() {}).debounce(250, {
|
||||
'maxWait': 1000
|
||||
}), false);
|
||||
|
||||
result = <number>_.defer(function() { console.log('deferred'); });
|
||||
result = <LoDash.LoDashWrapper<number>>_(function() { console.log('deferred'); }).defer();
|
||||
result = <_.LoDashWrapper<number>>_(function() { console.log('deferred'); }).defer();
|
||||
|
||||
var log = _.bind(console.log, console);
|
||||
result = <number>_.delay(log, 1000, 'logged later');
|
||||
result = <LoDash.LoDashWrapper<number>>_(log).delay(1000, 'logged later');
|
||||
result = <_.LoDashWrapper<number>>_(log).delay(1000, 'logged later');
|
||||
|
||||
var fibonacci = <Function>_.memoize(function(n) {
|
||||
return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
|
||||
@@ -636,8 +636,8 @@ result = <any>_.assign({ 'name': 'moe' }, { 'age': 40 }, function(a, b) {
|
||||
return typeof a == 'undefined' ? b : a;
|
||||
});
|
||||
|
||||
result = <LoDash.LoDashObjectWrapper<any>>_({ 'name': 'moe' }).assign({ 'age': 40 });
|
||||
result = <LoDash.LoDashObjectWrapper<any>>_({ 'name': 'moe' }).assign({ 'age': 40 }, function(a, b) {
|
||||
result = <_.LoDashObjectWrapper<any>>_({ 'name': 'moe' }).assign({ 'age': 40 });
|
||||
result = <_.LoDashObjectWrapper<any>>_({ 'name': 'moe' }).assign({ 'age': 40 }, function(a, b) {
|
||||
return typeof a == 'undefined' ? b : a;
|
||||
});
|
||||
|
||||
@@ -646,8 +646,8 @@ result = <LoDash.LoDashObjectWrapper<any>>_({ 'name': 'moe' }).assign({ 'age': 4
|
||||
return typeof a == 'undefined' ? b : a;
|
||||
});
|
||||
|
||||
result = <LoDash.LoDashObjectWrapper<any>>_({ 'name': 'moe' }).extend({ 'age': 40 });
|
||||
result = <LoDash.LoDashObjectWrapper<any>>_({ 'name': 'moe' }).extend({ 'age': 40 }, function(a, b) {
|
||||
result = <_.LoDashObjectWrapper<any>>_({ 'name': 'moe' }).extend({ 'age': 40 });
|
||||
result = <_.LoDashObjectWrapper<any>>_({ 'name': 'moe' }).extend({ 'age': 40 }, function(a, b) {
|
||||
return typeof a == 'undefined' ? b : a;
|
||||
});
|
||||
|
||||
@@ -861,7 +861,7 @@ result = <any>_.result(object, 'stuff');
|
||||
var tempObject = {};
|
||||
result = <typeof _>_.runInContext(tempObject);
|
||||
|
||||
result = <LoDash.TemplateExecutor>_.template('hello <%= name %>');
|
||||
result = <_.TemplateExecutor>_.template('hello <%= name %>');
|
||||
result = <string>_.template('<b><%- value %></b>', { 'value': '<script>' });
|
||||
|
||||
var listTemplate = '<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
@@ -871,10 +871,10 @@ result = <string>_.template('<% print("hello " + name); %>!', { 'name': 'larry'
|
||||
|
||||
var listTemplate = '<% $.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
result = <string>_.template(listTemplate, { 'people': ['moe', 'larry'] }, { 'imports': { '$': jQuery } });
|
||||
result = <LoDash.TemplateExecutor>_.template('hello <%= name %>', null, { 'sourceURL': '/basic/greeting.jst' });
|
||||
result = <_.TemplateExecutor>_.template('hello <%= name %>', null, { 'sourceURL': '/basic/greeting.jst' });
|
||||
|
||||
result = <LoDash.TemplateExecutor>_.template('hi <%= data.name %>!', null, { 'variable': 'data' });
|
||||
result = <string>(<LoDash.TemplateExecutor>result).source;
|
||||
result = <_.TemplateExecutor>_.template('hi <%= data.name %>!', null, { 'variable': 'data' });
|
||||
result = <string>(<_.TemplateExecutor>result).source;
|
||||
|
||||
function Mage() {
|
||||
this.castSpell = (n:number) => n;
|
||||
@@ -895,5 +895,5 @@ result = <string>_.uniqueId();
|
||||
***********/
|
||||
|
||||
result = <string>_.VERSION;
|
||||
result = <LoDash.Support>_.support;
|
||||
result = <LoDash.TemplateSettings>_.templateSettings;
|
||||
result = <_.Support>_.support;
|
||||
result = <_.TemplateSettings>_.templateSettings;
|
||||
|
||||
Vendored
+158
-93
@@ -268,16 +268,14 @@ declare module _ {
|
||||
**/
|
||||
findIndex<T>(
|
||||
array: List<T>,
|
||||
pluckValue: string,
|
||||
thisArg?: any): number;
|
||||
pluckValue: string): number;
|
||||
|
||||
/**
|
||||
* @see _.findIndex
|
||||
**/
|
||||
findIndex<T>(
|
||||
findIndex<W, T extends W>(
|
||||
array: List<T>,
|
||||
whereDictionary: Dictionary<any>,
|
||||
thisArg?: any): number;
|
||||
whereDictionary: W): number;
|
||||
}
|
||||
|
||||
//_.findLastIndex
|
||||
@@ -448,21 +446,66 @@ declare module _ {
|
||||
* @param shallow If true then only flatten one level, optional, default = false.
|
||||
* @return `array` flattened.
|
||||
**/
|
||||
flatten<T>(array: List<any>, isShallow?: boolean): T[]
|
||||
|
||||
flatten<T>(
|
||||
array: List<T>,
|
||||
isShallow?: boolean,
|
||||
callback?: ListIterator<T, any>,
|
||||
thisArg?: any): any[];
|
||||
array: List<any>,
|
||||
isShallow: boolean,
|
||||
callback: ListIterator<any, T>,
|
||||
thisArg?: any): T[];
|
||||
|
||||
flatten<T>(
|
||||
array: List<any>,
|
||||
callback: ListIterator<any, T>,
|
||||
thisArg?: any): T[];
|
||||
|
||||
flatten<W, T extends W>(
|
||||
array: List<any>,
|
||||
isShallow: boolean,
|
||||
whereValue: W): T[];
|
||||
|
||||
flatten<W, T extends W>(
|
||||
array: List<any>,
|
||||
whereValue: W): T[];
|
||||
|
||||
flatten<T>(
|
||||
array: List<any>,
|
||||
isShallow: boolean,
|
||||
pluckValue: string): T[];
|
||||
|
||||
flatten<T>(
|
||||
array: List<any>,
|
||||
pluckValue: string): T[];
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.flatten
|
||||
**/
|
||||
flatten(
|
||||
isShallow?: boolean,
|
||||
callback?: ListIterator<T, any>,
|
||||
thisArg?: any): LoDashArrayWrapper<any>;
|
||||
flatten<Flat>(isShallow?: boolean): LoDashArrayWrapper<Flat>;
|
||||
|
||||
flatten<Flat>(
|
||||
isShallow: boolean,
|
||||
callback: ListIterator<T, Flat>,
|
||||
thisArg?: any): LoDashArrayWrapper<Flat>;
|
||||
|
||||
flatten<Flat>(
|
||||
callback: ListIterator<T, Flat>,
|
||||
thisArg?: any): LoDashArrayWrapper<Flat>;
|
||||
|
||||
flatten<Flat>(
|
||||
isShallow: boolean,
|
||||
pluckValue: string): LoDashArrayWrapper<Flat>;
|
||||
|
||||
flatten<Flat>(
|
||||
pluckValue: string): LoDashArrayWrapper<Flat>;
|
||||
|
||||
flatten<Flat, W extends Flat>(
|
||||
isShallow: boolean,
|
||||
whereValue: W): LoDashArrayWrapper<Flat>;
|
||||
|
||||
flatten<Flat, W extends Flat>(
|
||||
whereValue: W): LoDashArrayWrapper<Flat>;
|
||||
}
|
||||
|
||||
//_.indexOf
|
||||
@@ -730,9 +773,14 @@ declare module _ {
|
||||
* @param {*} [thisArg] The this binding of callback.
|
||||
* @return Returns a slice of array.
|
||||
**/
|
||||
rest<T>(array: List<T>): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
rest<T>(
|
||||
array: List<T>,
|
||||
callback: (num: number) => boolean,
|
||||
callback: (elem: T) => boolean,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
@@ -740,88 +788,83 @@ declare module _ {
|
||||
**/
|
||||
rest<T>(
|
||||
array: List<T>,
|
||||
n?: number,
|
||||
thisArg?: any): T[];
|
||||
n: number): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
rest<T>(
|
||||
array: List<T>,
|
||||
pluckValue: string,
|
||||
thisArg?: any): T[];
|
||||
pluckValue: string): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
rest<W, T extends W>(
|
||||
array: List<T>,
|
||||
whereValue: W,
|
||||
thisArg?: any): T[];
|
||||
whereValue: W): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
drop<T>(
|
||||
array: List<T>,
|
||||
callback: (num: number) => boolean,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
drop<T>(
|
||||
array: List<T>,
|
||||
n?: number,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
drop<T>(
|
||||
array: List<T>,
|
||||
pluckValue: string,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
drop<W, T extends W>(
|
||||
array: List<T>,
|
||||
whereValue: W,
|
||||
thisArg?: any): T[];
|
||||
drop<T>(array: List<T>): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
tail<T>(
|
||||
array: List<T>,
|
||||
callback: (num: number) => boolean,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
tail<T>(
|
||||
array: List<T>,
|
||||
n?: number,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
tail<T>(
|
||||
array: List<T>,
|
||||
pluckValue: string,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
tail<W, T extends W>(
|
||||
array: List<T>,
|
||||
whereValue: W,
|
||||
thisArg?: any): T[];
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
drop<T>(
|
||||
array: List<T>,
|
||||
callback: (elem: T) => boolean,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
drop<T>(
|
||||
array: List<T>,
|
||||
n: number): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
drop<T>(
|
||||
array: List<T>,
|
||||
pluckValue: string): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
drop<W, T extends W>(
|
||||
array: List<T>,
|
||||
whereValue: W): T[];
|
||||
|
||||
tail<T>(array: List<T>): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
tail<T>(
|
||||
array: List<T>,
|
||||
callback: (elem: T) => boolean,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
tail<T>(
|
||||
array: List<T>,
|
||||
n: number): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
tail<T>(
|
||||
array: List<T>,
|
||||
pluckValue: string): T[];
|
||||
|
||||
/**
|
||||
* @see _.rest
|
||||
**/
|
||||
tail<W, T extends W>(
|
||||
array: List<T>,
|
||||
whereValue: W): T[];
|
||||
}
|
||||
|
||||
//_.sortedIndex
|
||||
@@ -898,10 +941,12 @@ declare module _ {
|
||||
* @param context 'this' object in `iterator`, optional.
|
||||
* @return Copy of `array` where all elements are unique.
|
||||
**/
|
||||
uniq<T, TSort>(array: List<T>, isSorted?: boolean): T[];
|
||||
|
||||
uniq<T, TSort>(
|
||||
array: List<T>,
|
||||
isSorted?: boolean,
|
||||
callback?: ListIterator<T, TSort>,
|
||||
isSorted: boolean,
|
||||
callback: ListIterator<T, TSort>,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
@@ -909,7 +954,7 @@ declare module _ {
|
||||
**/
|
||||
uniq<T, TSort>(
|
||||
array: List<T>,
|
||||
callback?: ListIterator<T, TSort>,
|
||||
callback: ListIterator<T, TSort>,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
@@ -918,8 +963,12 @@ declare module _ {
|
||||
**/
|
||||
uniq<T>(
|
||||
array: List<T>,
|
||||
isSorted?: boolean,
|
||||
pluckValue?: string): T[];
|
||||
isSorted: boolean,
|
||||
pluckValue: string): T[];
|
||||
|
||||
uniq<T>(
|
||||
array: List<T>,
|
||||
pluckValue: string): T[];
|
||||
|
||||
/**
|
||||
* @see _.uniq
|
||||
@@ -927,14 +976,21 @@ declare module _ {
|
||||
**/
|
||||
uniq<W, T extends W>(
|
||||
array: List<T>,
|
||||
whereValue?: W): T[];
|
||||
isSorted: boolean,
|
||||
whereValue: W): T[];
|
||||
|
||||
uniq<W, T extends W>(
|
||||
array: List<T>,
|
||||
whereValue: W): T[];
|
||||
|
||||
/**
|
||||
* @see _.uniq
|
||||
**/
|
||||
unique<T>(array: List<T>, isSorted?: boolean): T[];
|
||||
|
||||
unique<T, TSort>(
|
||||
array: List<T>,
|
||||
callback?: ListIterator<T, TSort>,
|
||||
callback: ListIterator<T, TSort>,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
@@ -942,8 +998,8 @@ declare module _ {
|
||||
**/
|
||||
unique<T, TSort>(
|
||||
array: List<T>,
|
||||
isSorted?: boolean,
|
||||
callback?: ListIterator<T, TSort>,
|
||||
isSorted: boolean,
|
||||
callback: ListIterator<T, TSort>,
|
||||
thisArg?: any): T[];
|
||||
|
||||
/**
|
||||
@@ -952,8 +1008,12 @@ declare module _ {
|
||||
**/
|
||||
unique<T>(
|
||||
array: List<T>,
|
||||
isSorted?: boolean,
|
||||
pluckValue?: string): T[];
|
||||
isSorted: boolean,
|
||||
pluckValue: string): T[];
|
||||
|
||||
unique<T>(
|
||||
array: List<T>,
|
||||
pluckValue: string): T[];
|
||||
|
||||
/**
|
||||
* @see _.uniq
|
||||
@@ -962,6 +1022,11 @@ declare module _ {
|
||||
unique<W, T extends W>(
|
||||
array: List<T>,
|
||||
whereValue?: W): T[];
|
||||
|
||||
unique<W, T extends W>(
|
||||
array: List<T>,
|
||||
isSorted: boolean,
|
||||
whereValue?: W): T[];
|
||||
}
|
||||
|
||||
//_.without
|
||||
|
||||
Reference in New Issue
Block a user