normalize-package-data
Advanced tools
Comparing version 2.3.5 to 2.3.6
@@ -23,2 +23,2 @@ var util = require("util") | ||
return util.format(messages.typo, providedName, probableName) | ||
} | ||
} |
@@ -12,3 +12,3 @@ module.exports = normalize | ||
var thingsToFix = fieldsToFix.map(function(fieldName) { | ||
var thingsToFix = fieldsToFix.map(function(fieldName) { | ||
return ucFirst(fieldName) + "Field" | ||
@@ -26,4 +26,4 @@ }) | ||
if (data.scripts && | ||
data.scripts.install === "node-gyp rebuild" && | ||
if (data.scripts && | ||
data.scripts.install === "node-gyp rebuild" && | ||
!data.scripts.preinstall) { | ||
@@ -30,0 +30,0 @@ data.gypfile = true |
@@ -9,2 +9,2 @@ var util = require('util') | ||
return util.format.apply(null, arguments) | ||
} | ||
} |
{ | ||
"topLevel": { | ||
"topLevel": { | ||
"dependancies": "dependencies" | ||
@@ -4,0 +4,0 @@ ,"dependecies": "dependencies" |
{ | ||
"name": "normalize-package-data", | ||
"version": "2.3.5", | ||
"version": "2.3.6", | ||
"author": "Meryn Stol <merynstol@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Normalizes data that can be found in package.json files.", |
# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data) | ||
normalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry. | ||
normalize-package-data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry. | ||
@@ -19,3 +19,3 @@ normalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools. | ||
normalizeData = require('normalize-package-data') | ||
packageData = fs.readFileSync("package.json") | ||
packageData = require("./package.json") | ||
normalizeData(packageData) | ||
@@ -31,4 +31,3 @@ // packageData is now normalized | ||
normalizeData = require('normalize-package-data') | ||
packageData = fs.readFileSync("package.json") | ||
warnFn = function(msg) { console.error(msg) } | ||
packageData = require("./package.json") | ||
normalizeData(packageData, true) | ||
@@ -46,3 +45,3 @@ // packageData is now normalized | ||
normalizeData = require('normalize-package-data') | ||
packageData = fs.readFileSync("package.json") | ||
packageData = require("./package.json") | ||
warnFn = function(msg) { console.error(msg) } | ||
@@ -84,3 +83,3 @@ normalizeData(packageData, warnFn) | ||
* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`. | ||
* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/ . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. | ||
* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]#readme . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. | ||
@@ -93,3 +92,3 @@ ### Rules for name field | ||
* contain the following characters: `/@\s+%` | ||
* contain and characters that would need to be encoded for use in urls. | ||
* contain any characters that would need to be encoded for use in urls. | ||
* resemble the word `node_modules` or `favicon.ico` (case doesn't matter). | ||
@@ -96,0 +95,0 @@ |
@@ -16,3 +16,3 @@ var tap = require("tap") | ||
verifyConsistency = function(entryName, next) { | ||
warn = function(msg) { | ||
warn = function(msg) { | ||
// t.equal("",msg) // uncomment to have some kind of logging of warnings | ||
@@ -37,2 +37,2 @@ } | ||
}) // fs.readdir | ||
}) // tap.test | ||
}) // tap.test |
@@ -18,3 +18,3 @@ var tap = require("tap") | ||
}, warn) | ||
var wanted1 = safeFormat(warningMessages.nonStringDependency, "a", 123) | ||
@@ -38,3 +38,3 @@ var wanted2 = safeFormat(warningMessages.nonStringDependency, "b", 456) | ||
}, warn) | ||
var wanted1 = safeFormat(warningMessages.nonStringBundleDependency, 123) | ||
@@ -41,0 +41,0 @@ var wanted2 = safeFormat(warningMessages.nonStringBundleDependency, {foo:"bar"}) |
@@ -36,2 +36,2 @@ { | ||
} | ||
} | ||
} |
@@ -56,2 +56,2 @@ { | ||
] | ||
} | ||
} |
@@ -35,2 +35,2 @@ { | ||
} | ||
} | ||
} |
@@ -7,7 +7,7 @@ { | ||
"description": "a simple zero-configuration command-line http server", | ||
"contributors": [ | ||
"contributors": [ | ||
{ | ||
"name": "Marak Squires", | ||
"email": "marak@nodejitsu.com" | ||
} | ||
} | ||
], | ||
@@ -49,3 +49,3 @@ "bin": { | ||
"ecstatic" | ||
], | ||
], | ||
"license": "MIT", | ||
@@ -55,2 +55,2 @@ "engines": { | ||
} | ||
} | ||
} |
@@ -21,2 +21,2 @@ { | ||
} | ||
} | ||
} |
{ | ||
"name": "foo-bar-package", | ||
"version": "0.0.1" | ||
} | ||
} |
@@ -26,2 +26,2 @@ { | ||
"license": "MIT" | ||
} | ||
} |
@@ -135,2 +135,2 @@ { | ||
] | ||
} | ||
} |
@@ -39,2 +39,2 @@ { | ||
} | ||
} | ||
} |
@@ -17,2 +17,2 @@ { | ||
"license" : "MIT" | ||
} | ||
} |
@@ -104,4 +104,2 @@ var tap = require("tap") | ||
console.error(a) | ||
var expect = | ||
@@ -133,4 +131,2 @@ [ warningMessages.missingDescription, | ||
console.error(a) | ||
var expect = | ||
@@ -157,4 +153,2 @@ [ warningMessages.missingDescription, | ||
console.error(a) | ||
var expect = | ||
@@ -161,0 +155,0 @@ [ warningMessages.missingDescription, |
@@ -13,3 +13,3 @@ var test = require('tap').test | ||
} | ||
var typoMessage = safeFormat.bind(undefined, warningMessages.typo) | ||
@@ -16,0 +16,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1582
58478
35
107