Comments (14)
Looks like I am going to get back to this.
from deepdash.
Brief progress report, just to let people know it's not abandoned:
I decided to create type definitions files right in the sources of package.
For testing my type definitions I rely on builtin VS Code autocompletion/hint feature, which works with *d.ts files out of the box. Later I'll add some typescript linter.
And finally, I hope some ts dev will give some feedback does it works as expected because I will not be able to write typescript tests for it.
I am still trying to avoid learning typescript, but only definitions.
(I have nothing against TS, looks very interesting, but I have absolutely no time for it)
from deepdash.
If anybody - let me know. Closed for now, maybe later I'll find some time for this.
from deepdash.
Ok, v4.5.5 now has type definitions.
All the entry points covered in deepdash-es package,
but only with main 'deepdash' function definitions work in cjs "deepdash" package
(not with cherry-picked methods, standalone version etc).
This is because "types" property of package.json can be set with a single value only and ts does no assumptions about other modules, even if ...d.ts files mirror all the file names.
I implemented these definitions relying on VS Code only.
I am still not a TS guy, so please anybody give some feedback if it works or something broken.
from deepdash.
Many thanks for your efforts
from deepdash.
Ok, I found a minute for this, please check fixed v5.0.2
from deepdash.
I have no resources to invest in learning TypeScript but without it, I'll not be able to do this task well.
If anybody wants to do it - I'll be happy to help.
from deepdash.
Thanks for the effort. I'm trying to use mapDeep in Typescript.
from deepdash.
Hi, in few days I am gonna publish first full version of definitions, it already works for vscode autocompletion, but only if I pollute root directory.
How do you use it?
deepdash or deepdash-es package?
Mixin everything into lodash, add only selected methods, use standalone version?
When I try to move definitions to separate directory and set "types" property of package.json - only this particular entry point works, but not all this cherry-picked separate methods.
As I got from internets, only more or less nice way to not pollute root directory is to copy this definitions only on npm install phase.
from deepdash.
If something - let me know here in comments, closing for now.
from deepdash.
@YuriGor firstly thank you for this excellent library! Secondly, thank you for doing the TS defs!
I've just come accross an issue using filterDeep
where the options expects cloneDeep
to be set. Looking at the docs this looks like it defaults to use lodash.cloneDeep
so it's not a required property. If that's true, I think the type def should be
options?: {
pathFormat?: "string" | "array"; // = "string";
checkCircular?: boolean; // = false;
keepCircular?: boolean; // = false;
childrenPath?: Path[];
includeRoot?: boolean;
leavesOnly?: boolean; // = false;
rootIsChildren?: boolean;
callbackAfterIterate?: boolean; // = false;
replaceCircularBy?: any;
condense?: boolean;
cloneDeep?: (value: any) => any; // <-- CHANGE HERE TO BE OPTIONAL
onTrue?: {
skipChildren?: boolean;
cloneDeep?: boolean;
keepIfEmpty?: boolean;
};
onFalse?: {
skipChildren?: boolean;
cloneDeep?: boolean;
keepIfEmpty?: boolean;
};
onUndefined?: {
skipChildren?: boolean;
cloneDeep?: boolean;
keepIfEmpty?: boolean;
};
}
from deepdash.
HI @jwhitmarsh, thank you!
Yes, you are right, all the options always should be optional.
I see the same issue in the definitions of other methods where such an option exists,
so probably it was just copypasted by me everywhere.
I am not sure when I'll fix it, no time currently,
so if you have some free time - PR is welcome.
To do it just fork/clone repo, fix ts files in src
folder and do npm test - it will rebuild everything (=copy ts files to es folder in this case)
from deepdash.
@YuriGor was this done already? I couldn't make it to show up in vscode autocomplete like regular lodash functions.
from deepdash.
Hi, @arash-bizcover it was working at that moment, maybe something was changed in vscode or was broken later.
I don't use vscode and typescript and have no time to check even bug listed in issues,
so if you have some time/energy to spend on this - contributions are welcome.
from deepdash.
Related Issues (20)
- omitDeep changes input on empty array HOT 1
- omitDeep doesn't omit objects HOT 7
- ERR_PACKAGE_PATH_NOT_EXPORTED HOT 3
- how to remove values from json if they exist
- Feature Request Parent path
- filterDeep not working on deeply nested object HOT 2
- Working with promises HOT 2
- Frustrating that things like `pickDeep` and `filterDeep` can only return a nested structure HOT 3
- deepdash-es not working with jest-resolve HOT 9
- deepFilter keep parents
- ESM: IIterateeContext typescript interface not exposed
- findPathDeep doesn't return first Value path
- findDeep or findDeepValue - Return object that contains the key & value
- eachDeep with childrenPath == wrong parent, parent path etc
- Bug in documentation _.findDeep*
- findDeep return types problem HOT 3
- Add contributing docs HOT 1
- findDeep is not a function HOT 1
- explicit return values, why and how does this work HOT 1
- mapValuesDeep mutates the original object if `leavesOnly: false` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepdash.