-
-
Notifications
You must be signed in to change notification settings - Fork 263
Adds support for the header's key to access nested object properties #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Updates node-sass package
Update package json
Adds preinstall script
Loads only lodash/get function
@yoanribot Didn't see this PR, so it was done in PR #107 to fix issue #84 which was outstanding. Your solution is smaller (even though you have not provided tests and build failed). However, it adds a dependency for Lodash, where I don't see much benefit for such a small portion of the package. @abdennour perhaps you can lend your thoughts |
Sorry for the unit test. Basically, my idea is to use the _get function of lodash. You don't have to import the entire library, just what you need: As you can see you are going to import only one function but if you think that is a problem (you could do your own version of the get of lodash, what I think is not a good idea because you should avoid |
@yoanribot I don't actually think it does. Can't see any tree shaking going on with Babel, so its increased the minified package size by 15% and the un-minified by about 30%. Unless I am missing something here? Unless I am wrong with the above, you could bring in the If you can get the package size down, write tests, then remove some un-needed things (node-sass version increase, and a new install script?) I'd choose this over my implementation |
yes sure, maybe in the future when I have some time. For now, I'm fine with my fork :). |
BTW your solution(Added in capability for dot notation in headers) is not merged yet, there are some conflicts pending to resolve. Could be cool if someone could take care of that if have a time of course :) |
@yoanribot yeah, I was waiting to discuss this PR with you. I'll merge #107 for now and close this PR. If you get time to solve the package size issue with lodash and want to re-open, feel free. thanks for you help, and if you fancy jumping on any other issues, help would be great ;-) |
First of all, nice works ;). I've made a little improvement to the headers prop, for cases where your data collection contain nested objects ( for now was only working for plain objects) where basically I use the lodash / get method to access the key(data index) in the object to allow cases like:
I hope you like the idea ;)