Midwest Dev Chat

MidwestDevChat.com

  • The newest 15 messages in the super-cool #javascript channel.

  • 01/16 12:50:17 Shawanna: The lodash implementation is 2.2k lines joy https://unpkg.com/lodash.mapkeys
  • 01/16 12:54:03 Korey: just in case you've never seen it: http://microjs.com
  • 01/16 12:54:18 Korey: Although, I don't know how recent any of the packages there are...
  • 01/16 12:56:05 Shawanna: That used to be one of my go-tos
  • 01/16 12:56:50 Shawanna: I've been using http://node-modules.com/ for years now, it's still the best
  • 01/16 12:57:28 Shawanna: other npm searches have gotten better, but the smartest general search algorithms apparently can't compete with an algorithm that weights packages based on the people you follow on Github
  • 01/16 12:58:18 Shawanna: if you like the idea of just-map-keys, you'll probably be interested in bookmarking/starring the rest of the "just" collection by Angus Croll: https://github.com/angus-c/just#readme
  • 01/16 12:59:02 Shawanna: it's the `date-fns` to `lodash`'s `moment`
  • 01/16 13:28:59 Ivana: For now I’m using `bidirectional-map` w/ like 20 lines of code.
  • 01/16 13:39:04 Shawanna: eh, it's over 100 lines https://unpkg.com/bidirectional-map but still better than lodash!
  • 01/16 15:51:32 Gino: why does just-map-keys name the function `map` instead of `mapKeys`???
  • 01/16 15:52:38 Gino: that is NOT what I would expect to happen when calling `map`... what am I missing here?
  • 01/18 13:30:48 Shawanna: The function name there is largely irrelevant - it will only ever show up in stack traces. It's declared inside of a module scope, so the "real" name that it is used by will only ever be the one that it is imported as.
    const mapKeys = require('just-map-keys')
    
  • 01/18 13:31:38 Shawanna: For consistancy's sake, there's no reason for it to be named anything other than the package name, but in practice it doesn't matter.
  • 01/18 13:32:27 Shawanna: The important part is the first line of the JS file: `module.exports = map` - that's the only place where that name will ever be referenced by code
  • *Usernames have been changed to protect the innocent.
We're currently 1132 members strong. Join us!
Request Invite

Check out all the cool channels!

Join the conversation!