Comments (5)
I don't see why it would be dead code. It works down to ES3, so it needs to polyfill Function#bind
, and when shimmed onto the global object, it needs to conditionally check for property descriptor support.
When I run browserify
locally, I do end up with a file that's 28K.
So part of the size is that there's an Object.keys
polyfill included (object-keys
), part is Function#bind
(function-bind
), part is Array#forEach
(for-each
).
One quick way to decrease the size if you don't target ES3 (say, if you target ES5 or above) would be to alias these three polyfills to simply module.exports = Object.keys
, module.exports = Function.prototype.bind
, and module.exports = Array.prototype.forEach
. It's also likely that these modules will already dedupe with other things.
from object.entries.
(In other words, Object.entries
is in no way a simple loop, and it needs to also be robust against someone deleting or overriding global builtins)
from object.entries.
FWIW istanbul cover
suggests that about 60% code is not executed. In any case, there should be a warning that this isn't as small as it looks to avoid surprises.
from object.entries.
@slikts sure, it contains polyfills - in a given engine, 100% of the code is never executed. The point is that across all the engines it supports combined, it has 100% coverage.
from object.entries.
Also, if "as it looks" doesn't include dependencies, that's an issue with your expectations - any npm package might pull in a core module, or a lot of deps, or none.
from object.entries.
Related Issues (12)
- Not-yet-visited keys deleted on a [[Get]] must not show up in the output
- Exclude test output from npm package HOT 1
- Question about implementation HOT 2
- too complex HOT 3
- Shim doesn't work on Chrome 49 HOT 4
- Action required: Greenkeeper could not be activated 🚨
- An in-range update of eslint is breaking the build 🚨 HOT 1
- An in-range update of es-abstract is breaking the build 🚨 HOT 1
- Dependency Dashboard
- Add example for ES6 to README HOT 6
- Entries misspelled 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 object.entries.