Comments (6)
This is problematic when people call array functions on it. forEach
, join
, etc.
from normalize-package-data.
@isaacs Are you ok with setting data.keywords
to an empty array if it's anything else than a string (will be split) or an array (left alone)? I see no downsides.
from normalize-package-data.
Same applies for data.man
.
from normalize-package-data.
Or maybe, rather than setting it to empty array, simply delete the property.
For example, data.files
is currently deleted if it exists and is not an array.
from normalize-package-data.
The "people" fields (data.contributors
and data.authors
) are currently left alone if not an array.
from normalize-package-data.
In general, there's a trade-off between "API simplicity" (i.e. does a consumer need to do .isArray()
first?) and maintaining any ("malformed") data that's there.
I think a choice should be made. Either all fields get the same treatment, or some fields are excepted due to some kind of special status.
from normalize-package-data.
Related Issues (20)
- Drop semver 4.3.0 and earlier versions
- [BUG] Array dependencies can't handle scoped packages
- [BUG] lib/fixer.js#fixLicenseField should not display warning when field is spelled `licence`
- [BUG] missing tag HOT 1
- [BUG] Allow sentimental versioning HOT 2
- [BUG] Missing 'main' field doesn't default to 'index.js' HOT 1
- [BUG] docs(README) license is BSD-2-Clause but points to MIT
- Npm audit issue HOT 5
- Scurity Fix coming? CVE-2021-23343 path-parse ? HOT 1
- [BUG] Error thrown when normalising Partytown React package HOT 1
- [BUG] Invalid name: "@apollo/client/core" HOT 3
- Reporting a vulnerability HOT 1
- [FEATURE] drop logging
- [Deps vulnerability] semver version vulnerability HOT 1
- [FEATURE] “fixed” description is often less relevant than nothing
- Why are optional dependencies copied over? HOT 2
- [DOCS] Documentation does not match argument order HOT 1
- typos.json with non-standard formatting causes minification errors later HOT 1
- please add tag for 2.4.0 release
- Release 2.4.1 is breaking builds that use it such as Karma 0.5.5 HOT 19
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 normalize-package-data.