normalize-package-data
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -100,2 +100,5 @@ var semver = require("semver") | ||
} | ||
if (typeof data.name !== "string") { | ||
throw new Error("name field must be a string.") | ||
} | ||
data.name = data.name.trim() | ||
@@ -102,0 +105,0 @@ ensureValidName(data.name) |
@@ -9,4 +9,3 @@ // a warning for deprecated or likely-incorrect fields | ||
var hasWarned = false | ||
var warn | ||
warn = function(msg) { | ||
function warn(msg) { | ||
hasWarned = true | ||
@@ -16,3 +15,3 @@ if(warnFunc) warnFunc(msg) | ||
if (data.modules) warn("'modules' is deprecated") | ||
Object.keys(typos.topLevel).forEach(function (warnings, d) { | ||
Object.keys(typos.topLevel).forEach(function (d) { | ||
if (data.hasOwnProperty(d)) { | ||
@@ -19,0 +18,0 @@ warn(makeTypoWarning(d, typos.topLevel[d])) |
{ | ||
"name": "normalize-package-data", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": "Meryn Stol <merynstol@gmail.com>", | ||
@@ -16,3 +16,3 @@ "description": "Normalizes data that can be found in package.json files.", | ||
"semver": "1.x", | ||
"github-url-from-git": "git://github.com/isaacs/node-github-url-from-git" | ||
"github-url-from-git": "~1.1.1" | ||
}, | ||
@@ -19,0 +19,0 @@ "devDependencies": { |
@@ -42,2 +42,3 @@ # normalize-package-data [![Build Status](https://travis-ci.org/meryn/normalize-package-data.png?branch=master)](https://travis-ci.org/meryn/normalize-package-data) | ||
* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver). | ||
* If `name` and/or `version` fields are missing, they are set to empty strings. | ||
* If `repository` field is a string, it will become am object with `url` set to the original string value, and `type` set to `"git"`. | ||
@@ -54,3 +55,3 @@ * If `files` field is not an array, it will be removed. | ||
* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value. | ||
* If `bugs` field does not exist, but `repository` field points to a repository hosted on github, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . | ||
* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. | ||
* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed. | ||
@@ -61,3 +62,3 @@ * If `homepage` field is not a string, it will be removed. | ||
The value of the name field may not | ||
If `name` field is given, the value of the name field must be a string. The string may not: | ||
@@ -71,3 +72,3 @@ * start with a period. | ||
The value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver). | ||
If `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver). | ||
@@ -74,0 +75,0 @@ ## Credits |
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
36239
25
1034
74
0
+ Addedgithub-url-from-git@1.1.1(transitive)
Updatedgithub-url-from-git@~1.1.1