3 ms·
The obvious solution would be to have some stdlib or even a common-utils project or something like it, which contain all such items. In one package. Because, i
by berkes 6y ago
The obvious solution would be to have some stdlib or even a common-utils project or something like it, which contain all such items. In one package.
Because, indeed, no-one should be rewriting obvious code like isArray, leftPad, isEven and so on.
Yes, that might cause some overhead in some situations (when you need isOdd, but not leftPad). But I'm certain that overhead is minimal. In practice, however, we currently see dependency-trees where these "should-be-stdlib" modules like "leftPad" or "isArray" are repeated numerous times in one project.
Any stdlib could even be optimized by browsers and engines, turning that "overhead" into a net benefit.