Closed magnusvk closed 10 years ago
I'd like to see an example of your use case. It sounds like a good idea, but I can't accept this as is. It has numerous problems:
[x] Missing underscore dependency (causing current build failure)
Array.prototype.concat()
method. I do see it being used to check that something is a regex, which, admittedly, is a little cleaner thanObject.prototype.toString(foo) == '[object RegExp]'
I'm generally against adding a whole extra dependency for 1 line. It may be possible to re-use the dependency for deepmerge
, though, which would replace one dependency with another.
@OverZealous Thanks for getting back to me so quickly. I think I've addressed all of the issues you've raised in my additional commits. Sorry about the underscore confusion, that was just a brainfart on my part -- when I saw the _
I just assumed you were using that already, but lodash does the things I need and is already there as a dependency, so now I just use that.
Re: Example. I added one in the README. At Bonobos, we use this to dynamically resize our images through imgIX. The actual image src lives in a data-src attribute, then at runtime when we know what width we are displaying the image as, we request exactly that width. It's pretty nifty.
Please take another look and let me know if there's anything else you'd like me to address. Also, thanks for making this! :)
Awesome, looks great! Thanks for going through and adding this. That's a great use case, I hadn't even thought of that.
OK, everything has been updated and published to NPM, including an updated gulp-cdnizer
, which isn't critical, but I like keeping the docs in sync.
We keep some URLs that we want to CDN-ize in custom data-attributes. To support that, we need to add a custom matcher. This adds support for that.