diff --git a/types/lodash-es/cond.d.ts b/types/lodash-es/cond.d.ts new file mode 100644 index 0000000000..b7e8fc00e0 --- /dev/null +++ b/types/lodash-es/cond.d.ts @@ -0,0 +1,2 @@ +import { cond } from "lodash"; +export default cond; diff --git a/types/lodash-es/divide.d.ts b/types/lodash-es/divide.d.ts new file mode 100644 index 0000000000..ee3e0b78b3 --- /dev/null +++ b/types/lodash-es/divide.d.ts @@ -0,0 +1,2 @@ +import { divide } from "lodash"; +export default divide; diff --git a/types/lodash-es/entries.d.ts b/types/lodash-es/entries.d.ts new file mode 100644 index 0000000000..621e793fa4 --- /dev/null +++ b/types/lodash-es/entries.d.ts @@ -0,0 +1,2 @@ +import { entries } from "lodash"; +export default entries; diff --git a/types/lodash-es/entriesIn.d.ts b/types/lodash-es/entriesIn.d.ts new file mode 100644 index 0000000000..3f0ad390cb --- /dev/null +++ b/types/lodash-es/entriesIn.d.ts @@ -0,0 +1,2 @@ +import { entriesIn } from "lodash"; +export default entriesIn; diff --git a/types/lodash-es/flatMapDeep.d.ts b/types/lodash-es/flatMapDeep.d.ts new file mode 100644 index 0000000000..762fece30a --- /dev/null +++ b/types/lodash-es/flatMapDeep.d.ts @@ -0,0 +1,2 @@ +import { flatMapDeep } from "lodash"; +export default flatMapDeep; diff --git a/types/lodash-es/flatMapDepth.d.ts b/types/lodash-es/flatMapDepth.d.ts new file mode 100644 index 0000000000..79aecba162 --- /dev/null +++ b/types/lodash-es/flatMapDepth.d.ts @@ -0,0 +1,2 @@ +import { flatMapDepth } from "lodash"; +export default flatMapDepth; diff --git a/types/lodash-es/index.d.ts b/types/lodash-es/index.d.ts index 08964fa17f..7389fc7900 100644 --- a/types/lodash-es/index.d.ts +++ b/types/lodash-es/index.d.ts @@ -33,6 +33,7 @@ export { cloneWith, compact, concat, + cond, constant, countBy, create, @@ -47,6 +48,7 @@ export { difference, differenceBy, differenceWith, + divide, drop, dropRight, dropRightWhile, @@ -54,6 +56,8 @@ export { each, eachRight, endsWith, + entries, + entriesIn, eq, escape, escapeRegExp, @@ -70,6 +74,8 @@ export { findLastKey, first, flatMap, + flatMapDeep, + flatMapDepth, flatten, flattenDeep, flattenDepth, @@ -94,10 +100,10 @@ export { hasIn, head, identity, - inRange, includes, indexOf, initial, + inRange, intersection, intersectionBy, intersectionWith, @@ -175,6 +181,7 @@ export { noConflict, noop, now, + nth, nthArg, omit, omitBy, @@ -198,6 +205,7 @@ export { pull, pullAll, pullAllBy, + pullAllWith, pullAt, random, range, @@ -250,6 +258,7 @@ export { thru, times, toArray, + toFinite, toInteger, toLength, toLower, @@ -273,12 +282,13 @@ export { unionWith, uniq, uniqBy, - uniqWith, uniqueId, + uniqWith, unset, unzip, unzipWith, update, + updateWith, upperCase, upperFirst, values, @@ -291,5 +301,6 @@ export { xorWith, zip, zipObject, + zipObjectDeep, zipWith } from "lodash"; diff --git a/types/lodash-es/nth.d.ts b/types/lodash-es/nth.d.ts new file mode 100644 index 0000000000..e6366a47a0 --- /dev/null +++ b/types/lodash-es/nth.d.ts @@ -0,0 +1,2 @@ +import { nth } from "lodash"; +export default nth; diff --git a/types/lodash-es/pullAllWith.d.ts b/types/lodash-es/pullAllWith.d.ts new file mode 100644 index 0000000000..c8fcf06645 --- /dev/null +++ b/types/lodash-es/pullAllWith.d.ts @@ -0,0 +1,2 @@ +import { pullAllWith } from "lodash"; +export default pullAllWith; diff --git a/types/lodash-es/toFinite.d.ts b/types/lodash-es/toFinite.d.ts new file mode 100644 index 0000000000..e3b9171da5 --- /dev/null +++ b/types/lodash-es/toFinite.d.ts @@ -0,0 +1,2 @@ +import { toFinite } from "lodash"; +export default toFinite; diff --git a/types/lodash-es/tsconfig.json b/types/lodash-es/tsconfig.json index 4cb568cb78..3a7ac3575b 100644 --- a/types/lodash-es/tsconfig.json +++ b/types/lodash-es/tsconfig.json @@ -44,6 +44,7 @@ "cloneWith.d.ts", "compact.d.ts", "concat.d.ts", + "cond.d.ts", "constant.d.ts", "countBy.d.ts", "create.d.ts", @@ -58,6 +59,7 @@ "difference.d.ts", "differenceBy.d.ts", "differenceWith.d.ts", + "divide.d.ts", "drop.d.ts", "dropRight.d.ts", "dropRightWhile.d.ts", @@ -65,6 +67,8 @@ "each.d.ts", "eachRight.d.ts", "endsWith.d.ts", + "entries.d.ts", + "entriesIn.d.ts", "eq.d.ts", "escape.d.ts", "escapeRegExp.d.ts", @@ -81,6 +85,8 @@ "findLastKey.d.ts", "first.d.ts", "flatMap.d.ts", + "flatMapDeep.d.ts", + "flatMapDepth.d.ts", "flatten.d.ts", "flattenDeep.d.ts", "flattenDepth.d.ts", @@ -105,10 +111,10 @@ "hasIn.d.ts", "head.d.ts", "identity.d.ts", - "inRange.d.ts", "includes.d.ts", "indexOf.d.ts", "initial.d.ts", + "inRange.d.ts", "intersection.d.ts", "intersectionBy.d.ts", "intersectionWith.d.ts", @@ -186,6 +192,7 @@ "noConflict.d.ts", "noop.d.ts", "now.d.ts", + "nth.d.ts", "nthArg.d.ts", "omit.d.ts", "omitBy.d.ts", @@ -209,6 +216,7 @@ "pull.d.ts", "pullAll.d.ts", "pullAllBy.d.ts", + "pullAllWith.d.ts", "pullAt.d.ts", "random.d.ts", "range.d.ts", @@ -261,6 +269,7 @@ "thru.d.ts", "times.d.ts", "toArray.d.ts", + "toFinite.d.ts", "toInteger.d.ts", "toLength.d.ts", "toLower.d.ts", @@ -284,12 +293,13 @@ "unionWith.d.ts", "uniq.d.ts", "uniqBy.d.ts", - "uniqWith.d.ts", "uniqueId.d.ts", + "uniqWith.d.ts", "unset.d.ts", "unzip.d.ts", "unzipWith.d.ts", "update.d.ts", + "updateWith.d.ts", "upperCase.d.ts", "upperFirst.d.ts", "values.d.ts", @@ -302,6 +312,7 @@ "xorWith.d.ts", "zip.d.ts", "zipObject.d.ts", + "zipObjectDeep.d.ts", "zipWith.d.ts" ] } \ No newline at end of file diff --git a/types/lodash-es/updateWith.d.ts b/types/lodash-es/updateWith.d.ts new file mode 100644 index 0000000000..e203c530e4 --- /dev/null +++ b/types/lodash-es/updateWith.d.ts @@ -0,0 +1,2 @@ +import { updateWith } from "lodash"; +export default updateWith; diff --git a/types/lodash-es/zipObjectDeep.d.ts b/types/lodash-es/zipObjectDeep.d.ts new file mode 100644 index 0000000000..218c4f373d --- /dev/null +++ b/types/lodash-es/zipObjectDeep.d.ts @@ -0,0 +1,2 @@ +import { zipObjectDeep } from "lodash"; +export default zipObjectDeep; diff --git a/types/lodash.cond/index.d.ts b/types/lodash.cond/index.d.ts new file mode 100644 index 0000000000..0322422601 --- /dev/null +++ b/types/lodash.cond/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for lodash.cond 4.5 +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts + +import { cond } from "lodash"; +export = cond; diff --git a/types/lodash.cond/tsconfig.json b/types/lodash.cond/tsconfig.json new file mode 100644 index 0000000000..3bc13b0278 --- /dev/null +++ b/types/lodash.cond/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/lodash.cond/tslint.json b/types/lodash.cond/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/lodash.cond/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/lodash.divide/index.d.ts b/types/lodash.divide/index.d.ts new file mode 100644 index 0000000000..be1cd64bdc --- /dev/null +++ b/types/lodash.divide/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for lodash.divide 4.9 +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts + +import { divide } from "lodash"; +export = divide; diff --git a/types/lodash.divide/tsconfig.json b/types/lodash.divide/tsconfig.json new file mode 100644 index 0000000000..3bc13b0278 --- /dev/null +++ b/types/lodash.divide/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/lodash.divide/tslint.json b/types/lodash.divide/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/lodash.divide/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/lodash.flatmapdeep/index.d.ts b/types/lodash.flatmapdeep/index.d.ts new file mode 100644 index 0000000000..aecfd03b25 --- /dev/null +++ b/types/lodash.flatmapdeep/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for lodash.flatMapDeep 4.10 +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts + +import { flatMapDeep } from "lodash"; +export = flatMapDeep; diff --git a/types/lodash.flatmapdeep/tsconfig.json b/types/lodash.flatmapdeep/tsconfig.json new file mode 100644 index 0000000000..3bc13b0278 --- /dev/null +++ b/types/lodash.flatmapdeep/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/lodash.flatmapdeep/tslint.json b/types/lodash.flatmapdeep/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/lodash.flatmapdeep/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/lodash.flatmapdepth/index.d.ts b/types/lodash.flatmapdepth/index.d.ts new file mode 100644 index 0000000000..c478b9cf9c --- /dev/null +++ b/types/lodash.flatmapdepth/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for lodash.flatMapDepth 4.10 +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts + +import { flatMapDepth } from "lodash"; +export = flatMapDepth; diff --git a/types/lodash.flatmapdepth/tsconfig.json b/types/lodash.flatmapdepth/tsconfig.json new file mode 100644 index 0000000000..3bc13b0278 --- /dev/null +++ b/types/lodash.flatmapdepth/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/lodash.flatmapdepth/tslint.json b/types/lodash.flatmapdepth/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/lodash.flatmapdepth/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/lodash.nth/index.d.ts b/types/lodash.nth/index.d.ts index 9576fa5a4e..9ec5caf822 100644 --- a/types/lodash.nth/index.d.ts +++ b/types/lodash.nth/index.d.ts @@ -1,8 +1,10 @@ -// Type definitions for lodash.nth 4.0 +// Type definitions for lodash.nth 4.11 // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 +// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts + import { nth } from "lodash"; export = nth; diff --git a/types/lodash.nth/tsconfig.json b/types/lodash.nth/tsconfig.json index 92ebbc6458..3bc13b0278 100644 --- a/types/lodash.nth/tsconfig.json +++ b/types/lodash.nth/tsconfig.json @@ -1,7 +1,4 @@ { - "files": [ - "index.d.ts" - ], "compilerOptions": { "module": "commonjs", "lib": [ @@ -9,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,5 +14,8 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true - } + }, + "files": [ + "index.d.ts" + ] } \ No newline at end of file diff --git a/types/lodash.pullallwith/index.d.ts b/types/lodash.pullallwith/index.d.ts new file mode 100644 index 0000000000..78c1e388be --- /dev/null +++ b/types/lodash.pullallwith/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for lodash.pullAllWith 4.7 +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts + +import { pullAllWith } from "lodash"; +export = pullAllWith; diff --git a/types/lodash.pullallwith/tsconfig.json b/types/lodash.pullallwith/tsconfig.json new file mode 100644 index 0000000000..3bc13b0278 --- /dev/null +++ b/types/lodash.pullallwith/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/lodash.pullallwith/tslint.json b/types/lodash.pullallwith/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/lodash.pullallwith/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/lodash.tofinite/index.d.ts b/types/lodash.tofinite/index.d.ts new file mode 100644 index 0000000000..51a9dc58c2 --- /dev/null +++ b/types/lodash.tofinite/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for lodash.toFinite 4.12 +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts + +import { toFinite } from "lodash"; +export = toFinite; diff --git a/types/lodash.tofinite/tsconfig.json b/types/lodash.tofinite/tsconfig.json new file mode 100644 index 0000000000..3bc13b0278 --- /dev/null +++ b/types/lodash.tofinite/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/lodash.tofinite/tslint.json b/types/lodash.tofinite/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/lodash.tofinite/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/lodash.updatewith/index.d.ts b/types/lodash.updatewith/index.d.ts new file mode 100644 index 0000000000..0d3376763c --- /dev/null +++ b/types/lodash.updatewith/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for lodash.updateWith 4.10 +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts + +import { updateWith } from "lodash"; +export = updateWith; diff --git a/types/lodash.updatewith/tsconfig.json b/types/lodash.updatewith/tsconfig.json new file mode 100644 index 0000000000..3bc13b0278 --- /dev/null +++ b/types/lodash.updatewith/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/types/lodash.updatewith/tslint.json b/types/lodash.updatewith/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/lodash.updatewith/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/lodash.zipobjectdeep/index.d.ts b/types/lodash.zipobjectdeep/index.d.ts index 1944588188..5147f6b847 100644 --- a/types/lodash.zipobjectdeep/index.d.ts +++ b/types/lodash.zipobjectdeep/index.d.ts @@ -1,8 +1,10 @@ -// Type definitions for lodash.zipObjectDeep 4.1 +// Type definitions for lodash.zipObjectDeep 4.4 // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 +// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts + import { zipObjectDeep } from "lodash"; export = zipObjectDeep; diff --git a/types/lodash.zipobjectdeep/tsconfig.json b/types/lodash.zipobjectdeep/tsconfig.json index 92ebbc6458..3bc13b0278 100644 --- a/types/lodash.zipobjectdeep/tsconfig.json +++ b/types/lodash.zipobjectdeep/tsconfig.json @@ -1,7 +1,4 @@ { - "files": [ - "index.d.ts" - ], "compilerOptions": { "module": "commonjs", "lib": [ @@ -9,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,5 +14,8 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true - } + }, + "files": [ + "index.d.ts" + ] } \ No newline at end of file diff --git a/types/lodash/cond.d.ts b/types/lodash/cond.d.ts new file mode 100644 index 0000000000..a325bad4bb --- /dev/null +++ b/types/lodash/cond.d.ts @@ -0,0 +1,2 @@ +import { cond } from "./index"; +export = cond; diff --git a/types/lodash/divide.d.ts b/types/lodash/divide.d.ts new file mode 100644 index 0000000000..3d8e393166 --- /dev/null +++ b/types/lodash/divide.d.ts @@ -0,0 +1,2 @@ +import { divide } from "./index"; +export = divide; diff --git a/types/lodash/entries.d.ts b/types/lodash/entries.d.ts new file mode 100644 index 0000000000..24b241751b --- /dev/null +++ b/types/lodash/entries.d.ts @@ -0,0 +1,2 @@ +import { entries } from "./index"; +export = entries; diff --git a/types/lodash/entriesIn.d.ts b/types/lodash/entriesIn.d.ts new file mode 100644 index 0000000000..a68ab1e576 --- /dev/null +++ b/types/lodash/entriesIn.d.ts @@ -0,0 +1,2 @@ +import { entriesIn } from "./index"; +export = entriesIn; diff --git a/types/lodash/flatMapDeep.d.ts b/types/lodash/flatMapDeep.d.ts new file mode 100644 index 0000000000..c65639a1fa --- /dev/null +++ b/types/lodash/flatMapDeep.d.ts @@ -0,0 +1,2 @@ +import { flatMapDeep } from "./index"; +export = flatMapDeep; diff --git a/types/lodash/flatMapDepth.d.ts b/types/lodash/flatMapDepth.d.ts new file mode 100644 index 0000000000..7ec18534b0 --- /dev/null +++ b/types/lodash/flatMapDepth.d.ts @@ -0,0 +1,2 @@ +import { flatMapDepth } from "./index"; +export = flatMapDepth; diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index 0d54e31678..d487135799 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -5,9 +5,10 @@ // Stepan Mikhaylyuk , // Eric L Anderson , // AJ Richardson , -// Junyoung Clare Jang +// Junyoung Clare Jang , +// e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.4 /** ### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog) @@ -1958,6 +1959,7 @@ declare namespace _ { } interface RecursiveArray extends Array> {} + interface ListOfRecursiveArraysOrValues extends List> {} //_.flatten @@ -2088,7 +2090,7 @@ declare namespace _ { * @return Returns the new flattened array. */ flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[]; - } + } //_.fromPairs interface LoDashStatic { @@ -2430,6 +2432,40 @@ declare namespace _ { ): any[]; } + type Comparator = (arrVal: T, othVal: T) => boolean; + + //_.pullAllWith + interface LoDashStatic { + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + pullAllWith( + array: List, + values: List, + comparator?: Comparator + ): List; + } + //_.reverse DUMMY interface LoDashStatic { /** @@ -6789,7 +6825,7 @@ declare namespace _ { predicate: ListIteratorTypeGuard, fromIndex?: number ): S|undefined; - + /** * @see _.find */ @@ -6880,7 +6916,7 @@ declare namespace _ { predicate: ListIteratorTypeGuard, fromIndex?: number ): S|undefined; - + /** * @see _.findLast */ @@ -7138,6 +7174,411 @@ declare namespace _ { flatMap(): LoDashExplicitArrayWrapper; } + //_.flatMapDeep + interface LoDashStatic { + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + flatMapDeep( + collection: List> | Dictionary> | NumericDictionary> | null | undefined + ): T[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: List | null | undefined, + iteratee: ListIterator> | string + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: Dictionary | null | undefined, + iteratee: DictionaryIterator> | string + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: NumericDictionary | null | undefined, + iteratee: NumericDictionaryIterator> | string + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: object | null | undefined, + iteratee?: ObjectIterator> | string + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: object | null | undefined, + iteratee: object + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: StringIterator> + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapperBase { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: ListIterator>|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: object + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapperBase { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: ListIterator>|DictionaryIterator>|NumericDictionaryIterator> + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: ObjectIterator>|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: object + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: StringIterator> + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapperBase { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: ListIterator>|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: object + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapperBase { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: ListIterator>|DictionaryIterator>|NumericDictionaryIterator> + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: ObjectIterator>|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + iteratee: object + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep(): LoDashExplicitArrayWrapper; + } + + //_.flatMapDepth + interface LoDashStatic { + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + flatMapDepth( + collection: List> | Dictionary> | NumericDictionary> | null | undefined, + depth?: number + ): T[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: List | null | undefined, + iteratee: ListIterator> | string, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: Dictionary | null | undefined, + iteratee: DictionaryIterator> | string, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: NumericDictionary | null | undefined, + iteratee: NumericDictionaryIterator> | string, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: object | null | undefined, + iteratee?: ObjectIterator> | string, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: object | null | undefined, + iteratee: object, + depth?: number + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: StringIterator>, + depth?: number + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapperBase { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: ListIterator>|string, + depth?: number + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: object, + depth?: number + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapperBase { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: ListIterator>|DictionaryIterator>|NumericDictionaryIterator>, + depth?: number + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: ObjectIterator>|string, + depth?: number + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: object, + depth?: number + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: StringIterator>, + depth?: number + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapperBase { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: ListIterator>|string, + depth?: number + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: object, + depth?: number + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapperBase { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: ListIterator>|DictionaryIterator>|NumericDictionaryIterator>, + depth?: number + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: ObjectIterator>|string, + depth?: number + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + iteratee: object, + depth?: number + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth(): LoDashExplicitArrayWrapper; + } + //_.forEach interface LoDashStatic { /** @@ -11351,6 +11792,42 @@ declare namespace _ { conformsTo(object: T, source: ConformsPredicateObject): boolean; } + type CondPair = [(val: T) => boolean, (val: T) => R] + + //_.cond + interface LoDashStatic { + /** + * Creates a function that iterates over `pairs` and invokes the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Array} pairs The predicate-function pairs. + * @returns {Function} Returns the new composite function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.stubTrue, _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' + */ + cond(pairs: CondPair[]): (Target: T) => R; + } + //_.eq interface LoDashStatic { /** @@ -14861,6 +15338,54 @@ declare namespace _ { defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper; } + //_.entries + interface LoDashStatic { + /** + * @see _.toPairs + */ + entries(object?: T): [string, any][]; + + entries(object?: T): [string, TResult][]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.toPairs + */ + entries(): LoDashImplicitArrayWrapper<[string, TResult]>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.toPairs + */ + entries(): LoDashExplicitArrayWrapper<[string, TResult]>; + } + + //_.entriesIn + interface LoDashStatic { + /** + * @see _.toPairsIn + */ + entriesIn(object?: T): [string, any][]; + + entriesIn(object?: T): [string, TResult][]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.toPairsIn + */ + entriesIn(): LoDashImplicitArrayWrapper<[string, TResult]>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.toPairsIn + */ + entriesIn(): LoDashExplicitArrayWrapper<[string, TResult]>; + } + // _.extend interface LoDashStatic { /** @@ -17231,6 +17756,72 @@ declare namespace _ { ): LoDashExplicitObjectWrapper; } + //_.updateWith + interface LoDashStatic { + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + updateWith( + object: Object, + path: Many, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): TResult; + + /** + * @see _.updateWith + */ + updateWith( + object: O, + path: Many, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.updateWith + */ + updateWith( + path: Many, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.updateWith + */ + updateWith( + path: Many, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): LoDashExplicitObjectWrapper; + } + //_.values interface LoDashStatic { /** diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index e00d951023..ed80175d6f 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -4198,6 +4198,330 @@ namespace TestFlatMap { } } +// _.flatMapDeep +namespace TestFlatMapDeep { + let numArray: (number|number[])[] | null | undefined = [1, [2, 3]] as any; + let objArray: ({a: number}|{a: number}[])[] | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; + + let obj: any = {}; + let numList: _.List | null | undefined = obj; + let objList: _.List<{a: number}|{a: number}[]> | null | undefined = obj; + + let numDictionary: _.Dictionary | null | undefined = obj; + let objDictionary: _.Dictionary<{a: number}|{a: number}[]> | null | undefined = obj; + + let numNumericDictionary: _.NumericDictionary | null | undefined = obj; + let objNumericDictionary: _.NumericDictionary<{a: number}|{a: number}[]> | null | undefined = obj; + + let stringIterator: (value: string, index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) => ['a', 'b', 'c']; + + let listIterator: (value: number|number[], index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) => [1]; + + let dictionaryIterator: (value: number|number[], key: string, collection: _.Dictionary) =>_.ListOfRecursiveArraysOrValues = (a, b, c) => [1]; + + let numericDictionaryIterator: (value: number|number[], key: number, collection: _.NumericDictionary) => _.ListOfRecursiveArraysOrValues = (a, b, c) => [1]; + + { + let result: string[]; + + result = _.flatMapDeep('abc'); + + result = _.flatMapDeep('abc', stringIterator); + } + + { + let result: number[]; + + result = _.flatMapDeep(numArray); + + result = _.flatMapDeep(numArray, listIterator); + + result = _.flatMapDeep(objArray, 'a'); + + result = _.flatMapDeep(numList); + + result = _.flatMapDeep(numList, listIterator); + + result = _.flatMapDeep(objList, 'a'); + + result = _.flatMapDeep(numDictionary); + + result = _.flatMapDeep(numDictionary, dictionaryIterator); + + result = _.flatMapDeep(objDictionary, 'a'); + + result = _.flatMapDeep(numNumericDictionary); + + result = _.flatMapDeep(numNumericDictionary, numericDictionaryIterator); + + result = _.flatMapDeep(objNumericDictionary, 'a'); + } + + { + let result: boolean[]; + + result = _.flatMapDeep(objArray, ['a', 42]); + result = _.flatMapDeep(objArray, {'a': 42}); + + result = _.flatMapDeep(objList, ['a', 42]); + result = _.flatMapDeep(objList, {'a': 42}); + + result = _.flatMapDeep(objDictionary, ['a', 42]); + result = _.flatMapDeep(objDictionary, {'a': 42}); + + result = _.flatMapDeep(objNumericDictionary, ['a', 42]); + result = _.flatMapDeep(objNumericDictionary, {'a': 42}); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _('abc').flatMapDeep(); + result = _('abc').flatMapDeep(stringIterator); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(numArray).flatMapDeep(); + result = _(numArray).flatMapDeep(listIterator); + result = _(objArray).flatMapDeep('a'); + + result = _(numList).flatMapDeep(); + result = _(numList).flatMapDeep(listIterator); + result = _(objList).flatMapDeep('a'); + + result = _(numDictionary).flatMapDeep(); + result = _(numDictionary).flatMapDeep(dictionaryIterator); + result = _(objDictionary).flatMapDeep('a'); + + result = _(numNumericDictionary).flatMapDeep(); + result = _(numNumericDictionary).flatMapDeep(numericDictionaryIterator); + result = _(objNumericDictionary).flatMapDeep('a'); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(objArray).flatMapDeep(['a', 42]); + result = _(objArray).flatMapDeep({a: 42}); + + result = _(objList).flatMapDeep(['a', 42]); + result = _(objList).flatMapDeep({a: 42}); + + result = _(objDictionary).flatMapDeep(['a', 42]); + result = _(objDictionary).flatMapDeep({a: 42}); + + result = _(objNumericDictionary).flatMapDeep(['a', 42]); + result = _(objNumericDictionary).flatMapDeep({a: 42}); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _('abc').chain().flatMapDeep(); + result = _('abc').chain().flatMapDeep(stringIterator); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(numArray).chain().flatMapDeep(); + result = _(numArray).chain().flatMapDeep(listIterator); + result = _(objArray).chain().flatMapDeep('a'); + + result = _(numList).chain().flatMapDeep(); + result = _(numList).chain().flatMapDeep(listIterator); + result = _(objList).chain().flatMapDeep('a'); + + result = _(numDictionary).chain().flatMapDeep(); + result = _(numDictionary).chain().flatMapDeep(dictionaryIterator); + result = _(objDictionary).chain().flatMapDeep('a'); + + result = _(numNumericDictionary).chain().flatMapDeep(); + result = _(numNumericDictionary).chain().flatMapDeep(numericDictionaryIterator); + result = _(objNumericDictionary).chain().flatMapDeep('a'); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(objArray).chain().flatMapDeep(['a', 42]); + result = _(objArray).chain().flatMapDeep({a: 42}); + + result = _(objList).chain().flatMapDeep(['a', 42]); + result = _(objList).chain().flatMapDeep({a: 42}); + + result = _(objDictionary).chain().flatMapDeep(['a', 42]); + result = _(objDictionary).chain().flatMapDeep({a: 42}); + + result = _(objNumericDictionary).chain().flatMapDeep(['a', 42]); + result = _(objNumericDictionary).chain().flatMapDeep({a: 42}); + } +} + +// _.flatMapDepth +namespace TestFlatMapDepth { + let numArray: (number|number[])[] | null | undefined = [1, [2, 3]] as any; + let objArray: ({a: number}|{a: number}[])[] | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; + + let obj: any = {}; + let numList: _.List | null | undefined = obj; + let objList: _.List<{a: number}|{a: number}[]> | null | undefined = obj; + + let numDictionary: _.Dictionary | null | undefined = obj; + let objDictionary: _.Dictionary<{a: number}|{a: number}[]> | null | undefined = obj; + + let numNumericDictionary: _.NumericDictionary | null | undefined = obj; + let objNumericDictionary: _.NumericDictionary<{a: number}|{a: number}[]> | null | undefined = obj; + + let stringIterator: (value: string, index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) => ""; + + let listIterator: (value: number|number[], index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) =>[ 1]; + + let dictionaryIterator: (value: number|number[], key: number, collection: _.Dictionary) => _.ListOfRecursiveArraysOrValues = (a, b, c) => [1]; + + let numericDictionaryIterator: (value: number|number[], key: number, collection: _.NumericDictionary) => _.ListOfRecursiveArraysOrValues = (a, b, c) => [1]; + + { + let result: string[]; + + result = _.flatMapDepth('abc'); + + result = _.flatMapDepth('abc', stringIterator, 1); + } + + { + let result: number[]; + + result = _.flatMapDepth(numArray); + + result = _.flatMapDepth(numArray, listIterator, 1); + + result = _.flatMapDepth(objArray, 'a'); + + result = _.flatMapDepth(numList); + + result = _.flatMapDepth(numList, listIterator, 1); + + result = _.flatMapDepth(objList, 'a', 1); + + result = _.flatMapDepth(numDictionary); + + result = _.flatMapDepth(numDictionary, dictionaryIterator, 1); + + result = _.flatMapDepth(objDictionary, 'a', 1); + + result = _.flatMapDepth(numNumericDictionary); + + result = _.flatMapDepth(numNumericDictionary, numericDictionaryIterator, 1); + + result = _.flatMapDepth(objNumericDictionary, 'a', 1); + } + + { + let result: boolean[]; + + result = _.flatMapDepth(objArray, ['a', 42], 1); + result = _.flatMapDepth(objArray, {'a': 42}, 1); + + result = _.flatMapDepth(objList, ['a', 42], 1); + result = _.flatMapDepth(objList, {'a': 42}, 1); + + result = _.flatMapDepth(objDictionary, ['a', 42], 1); + result = _.flatMapDepth(objDictionary, {'a': 42}, 1); + + result = _.flatMapDepth(objNumericDictionary, ['a', 42], 1); + result = _.flatMapDepth(objNumericDictionary, {'a': 42}, 1); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _('abc').flatMapDepth(); + result = _('abc').flatMapDepth(stringIterator, 1); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(numArray).flatMapDepth(); + result = _(numArray).flatMapDepth(listIterator, 1); + result = _(objArray).flatMapDepth('a', 1); + + result = _(numList).flatMapDepth(); + result = _(numList).flatMapDepth(listIterator, 1); + result = _(objList).flatMapDepth('a', 1); + + result = _(numDictionary).flatMapDepth(); + result = _(numDictionary).flatMapDepth(dictionaryIterator, 1); + result = _(objDictionary).flatMapDepth('a', 1); + + result = _(numNumericDictionary).flatMapDepth(); + result = _(numNumericDictionary).flatMapDepth(numericDictionaryIterator, 1); + result = _(objNumericDictionary).flatMapDepth('a', 1); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(objArray).flatMapDepth(['a', 42], 1); + result = _(objArray).flatMapDepth({a: 42}, 1); + + result = _(objList).flatMapDepth(['a', 42], 1); + result = _(objList).flatMapDepth({a: 42}, 1); + + result = _(objDictionary).flatMapDepth(['a', 42], 1); + result = _(objDictionary).flatMapDepth({a: 42}, 1); + + result = _(objNumericDictionary).flatMapDepth(['a', 42], 1); + result = _(objNumericDictionary).flatMapDepth({a: 42}, 1); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _('abc').chain().flatMapDepth(); + result = _('abc').chain().flatMapDepth(stringIterator, 1); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(numArray).chain().flatMapDepth(); + result = _(numArray).chain().flatMapDepth(listIterator, 1); + result = _(objArray).chain().flatMapDepth('a', 1); + + result = _(numList).chain().flatMapDepth(); + result = _(numList).chain().flatMapDepth(listIterator, 1); + result = _(objList).chain().flatMapDepth('a', 1); + + result = _(numDictionary).chain().flatMapDepth(); + result = _(numDictionary).chain().flatMapDepth(dictionaryIterator, 1); + result = _(objDictionary).chain().flatMapDepth('a', 1); + + result = _(numNumericDictionary).chain().flatMapDepth(); + result = _(numNumericDictionary).chain().flatMapDepth(numericDictionaryIterator, 1); + result = _(objNumericDictionary).chain().flatMapDepth('a', 1); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(objArray).chain().flatMapDepth(['a', 42], 1); + result = _(objArray).chain().flatMapDepth({a: 42}, 1); + + result = _(objList).chain().flatMapDepth(['a', 42], 1); + result = _(objList).chain().flatMapDepth({a: 42}, 1); + + result = _(objDictionary).chain().flatMapDepth(['a', 42], 1); + result = _(objDictionary).chain().flatMapDepth({a: 42}, 1); + + result = _(objNumericDictionary).chain().flatMapDepth(['a', 42], 1); + result = _(objNumericDictionary).chain().flatMapDepth({a: 42}, 1); + } +} + // _.forEach namespace TestForEach { let array: TResult[] = []; @@ -9406,6 +9730,88 @@ const TestDefaultsDeepSource = { 'user': { 'name': 'fred', 'age': 36 } }; result = _.defaultsDeep(TestDefaultsDeepObject, TestDefaultsDeepSource); result = _(TestDefaultsDeepObject).defaultsDeep(TestDefaultsDeepSource).value(); +// _.entries +namespace TestEntries { + let object: _.Dictionary = {}; + + { + let result: [string, any][]; + + result = _.entries<_.Dictionary>(object); + } + + { + let result: [string, string][]; + + result = _.entries<_.Dictionary, string>(object); + } + + { + let result: _.LoDashImplicitArrayWrapper<[string, string]>; + + result = _(object).entries(); + } + + { + let result: _.LoDashImplicitArrayWrapper<[string, any]>; + + result = _(object).entries(); + } + + { + let result: _.LoDashExplicitArrayWrapper<[string, string]>; + + result = _(object).chain().entries(); + } + + { + let result: _.LoDashExplicitArrayWrapper<[string, any]>; + + result = _(object).chain().entries(); + } +} + +// _.entriesIn +namespace TestEntriesIn { + let object: _.Dictionary = {}; + + { + let result: [string, any][]; + + result = _.entriesIn<_.Dictionary>(object); + } + + { + let result: [string, string][]; + + result = _.entriesIn<_.Dictionary, string>(object); + } + + { + let result: _.LoDashImplicitArrayWrapper<[string, string]>; + + result = _(object).entriesIn(); + } + + { + let result: _.LoDashImplicitArrayWrapper<[string, any]>; + + result = _(object).entriesIn(); + } + + { + let result: _.LoDashExplicitArrayWrapper<[string, string]>; + + result = _(object).chain().entriesIn(); + } + + { + let result: _.LoDashExplicitArrayWrapper<[string, any]>; + + result = _(object).chain().entriesIn(); + } +} + // _.extend namespace TestExtend { type Obj = { a: string }; @@ -11002,7 +11408,7 @@ namespace TestToPairsIn { { let result: _.LoDashExplicitArrayWrapper<[string, any]>; - result = _(object).chain().toPairs(); + result = _(object).chain().toPairsIn(); } } @@ -11137,6 +11543,48 @@ namespace TestUpdate { } } +// _.updateWith +namespace TestUpdateWith { + type SampleObject = {a: {}}; + type SampleResult = {a: {b: number[]}}; + + let object: SampleObject = { a: {} }; + let updater = (value: any) => 0; + let customizer = (value: any, key: string, object: SampleObject) => 0; + + { + let result: SampleResult; + + result = _.updateWith(object, 'a.b[1]', updater); + result = _.updateWith(object, 'a.b[1]', updater, customizer); + result = _.updateWith(object, ['a', 'b', 1], updater); + result = _.updateWith(object, ['a', 'b', 1], updater, customizer); + + result = _.updateWith(object, 'a.b[1]', updater); + result = _.updateWith(object, 'a.b[1]', updater, customizer); + result = _.updateWith(object, ['a', 'b', 1], updater); + result = _.updateWith(object, ['a', 'b', 1], updater, customizer); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(object).updateWith('a.b[1]', updater); + result = _(object).updateWith('a.b[1]', updater, customizer); + result = _(object).updateWith(['a', 'b', 1], updater); + result = _(object).updateWith(['a', 'b', 1], updater, customizer); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(object).chain().updateWith('a.b[1]', updater); + result = _(object).chain().updateWith('a.b[1]', updater, customizer); + result = _(object).chain().updateWith(['a', 'b', 1], updater); + result = _(object).chain().updateWith(['a', 'b', 1], updater, customizer); + } +} + // _.values namespace TestValues { type SampleObject = {a: {}}; @@ -11945,6 +12393,20 @@ namespace TestAttempt { } } +// _.cond +namespace TestCond { + let pairPred1: (val: string) => boolean = (val) => true; + let pairPred2: (val: string) => boolean = (val) => false; + let pairRes1: (val: string) => number = (val) => 1; + let pairRes2: (val: string) => number = (val) => 2; + + { + let result: number; + + result = _.cond([[pairPred1, pairRes1],[pairPred2, pairRes2]])('hello'); + } +} + // _.constant namespace TestConstant { { diff --git a/types/lodash/nth.d.ts b/types/lodash/nth.d.ts new file mode 100644 index 0000000000..ce1013f23b --- /dev/null +++ b/types/lodash/nth.d.ts @@ -0,0 +1,2 @@ +import { nth } from "./index"; +export = nth; diff --git a/types/lodash/pullAllWith.d.ts b/types/lodash/pullAllWith.d.ts new file mode 100644 index 0000000000..d3ce829804 --- /dev/null +++ b/types/lodash/pullAllWith.d.ts @@ -0,0 +1,2 @@ +import { pullAllWith } from "./index"; +export = pullAllWith; diff --git a/types/lodash/scripts/generate-modules.ts b/types/lodash/scripts/generate-modules.ts index e6a4e72abb..32bbc0ec25 100644 --- a/types/lodash/scripts/generate-modules.ts +++ b/types/lodash/scripts/generate-modules.ts @@ -160,6 +160,8 @@ function modulesNotOnNpm(): string[] { "chain", "each", "eachRight", + "entries", + "entriesIn", "extend", "extendWith", "noConflict", @@ -199,6 +201,7 @@ function allModuleNames(): string[] { "cloneWith", "compact", "concat", + "cond", "constant", "countBy", "create", @@ -213,6 +216,7 @@ function allModuleNames(): string[] { "difference", "differenceBy", "differenceWith", + "divide", "drop", "dropRight", "dropRightWhile", @@ -220,6 +224,8 @@ function allModuleNames(): string[] { "each", "eachRight", "endsWith", + "entries", + "entriesIn", "eq", "escape", "escapeRegExp", @@ -236,6 +242,8 @@ function allModuleNames(): string[] { "findLastKey", "first", "flatMap", + "flatMapDeep", + "flatMapDepth", "flatten", "flattenDeep", "flattenDepth", @@ -260,10 +268,10 @@ function allModuleNames(): string[] { "hasIn", "head", "identity", - "inRange", "includes", "indexOf", "initial", + "inRange", "intersection", "intersectionBy", "intersectionWith", @@ -341,6 +349,7 @@ function allModuleNames(): string[] { "noConflict", "noop", "now", + "nth", "nthArg", "omit", "omitBy", @@ -364,6 +373,7 @@ function allModuleNames(): string[] { "pull", "pullAll", "pullAllBy", + "pullAllWith", "pullAt", "random", "range", @@ -416,6 +426,7 @@ function allModuleNames(): string[] { "thru", "times", "toArray", + "toFinite", "toInteger", "toLength", "toLower", @@ -439,12 +450,13 @@ function allModuleNames(): string[] { "unionWith", "uniq", "uniqBy", - "uniqWith", "uniqueId", + "uniqWith", "unset", "unzip", "unzipWith", "update", + "updateWith", "upperCase", "upperFirst", "values", @@ -457,6 +469,7 @@ function allModuleNames(): string[] { "xorWith", "zip", "zipObject", + "zipObjectDeep", "zipWith" ]; } diff --git a/types/lodash/toFinite.d.ts b/types/lodash/toFinite.d.ts new file mode 100644 index 0000000000..c575b47847 --- /dev/null +++ b/types/lodash/toFinite.d.ts @@ -0,0 +1,2 @@ +import { toFinite } from "./index"; +export = toFinite; diff --git a/types/lodash/tsconfig.json b/types/lodash/tsconfig.json index 8fdd6ddff3..8239e4f277 100644 --- a/types/lodash/tsconfig.json +++ b/types/lodash/tsconfig.json @@ -44,6 +44,7 @@ "cloneWith.d.ts", "compact.d.ts", "concat.d.ts", + "cond.d.ts", "constant.d.ts", "countBy.d.ts", "create.d.ts", @@ -58,6 +59,7 @@ "difference.d.ts", "differenceBy.d.ts", "differenceWith.d.ts", + "divide.d.ts", "drop.d.ts", "dropRight.d.ts", "dropRightWhile.d.ts", @@ -65,6 +67,8 @@ "each.d.ts", "eachRight.d.ts", "endsWith.d.ts", + "entries.d.ts", + "entriesIn.d.ts", "eq.d.ts", "escape.d.ts", "escapeRegExp.d.ts", @@ -81,6 +85,8 @@ "findLastKey.d.ts", "first.d.ts", "flatMap.d.ts", + "flatMapDeep.d.ts", + "flatMapDepth.d.ts", "flatten.d.ts", "flattenDeep.d.ts", "flattenDepth.d.ts", @@ -105,10 +111,10 @@ "hasIn.d.ts", "head.d.ts", "identity.d.ts", - "inRange.d.ts", "includes.d.ts", "indexOf.d.ts", "initial.d.ts", + "inRange.d.ts", "intersection.d.ts", "intersectionBy.d.ts", "intersectionWith.d.ts", @@ -186,6 +192,7 @@ "noConflict.d.ts", "noop.d.ts", "now.d.ts", + "nth.d.ts", "nthArg.d.ts", "omit.d.ts", "omitBy.d.ts", @@ -209,6 +216,7 @@ "pull.d.ts", "pullAll.d.ts", "pullAllBy.d.ts", + "pullAllWith.d.ts", "pullAt.d.ts", "random.d.ts", "range.d.ts", @@ -261,6 +269,7 @@ "thru.d.ts", "times.d.ts", "toArray.d.ts", + "toFinite.d.ts", "toInteger.d.ts", "toLength.d.ts", "toLower.d.ts", @@ -284,12 +293,13 @@ "unionWith.d.ts", "uniq.d.ts", "uniqBy.d.ts", - "uniqWith.d.ts", "uniqueId.d.ts", + "uniqWith.d.ts", "unset.d.ts", "unzip.d.ts", "unzipWith.d.ts", "update.d.ts", + "updateWith.d.ts", "upperCase.d.ts", "upperFirst.d.ts", "values.d.ts", @@ -302,6 +312,7 @@ "xorWith.d.ts", "zip.d.ts", "zipObject.d.ts", + "zipObjectDeep.d.ts", "zipWith.d.ts" ] } \ No newline at end of file diff --git a/types/lodash/updateWith.d.ts b/types/lodash/updateWith.d.ts new file mode 100644 index 0000000000..44175423ec --- /dev/null +++ b/types/lodash/updateWith.d.ts @@ -0,0 +1,2 @@ +import { updateWith } from "./index"; +export = updateWith; diff --git a/types/lodash/zipObjectDeep.d.ts b/types/lodash/zipObjectDeep.d.ts new file mode 100644 index 0000000000..2a483e8393 --- /dev/null +++ b/types/lodash/zipObjectDeep.d.ts @@ -0,0 +1,2 @@ +import { zipObjectDeep } from "./index"; +export = zipObjectDeep;