cdnjs-transform
Advanced tools
Comparing version 0.0.4 to 0.0.5
var transform = require('./'); | ||
var fs = require('fs'); | ||
console.log(require('util').inspect(transform(require('./packages').packages), { depth: null, colors: false })); | ||
console.log(require('util').inspect(transform(require('./packages').packages), { depth: null, colors: false })); | ||
console.log(); | ||
console.log(); | ||
console.log('length', transform(require('./packages').packages).length); |
@@ -27,3 +27,3 @@ var _ = require('lodash'); | ||
var nameMatchesPackageName = function (name, packageName) { | ||
return name.indexOf(packageName) !== -1; | ||
return name.toLowerCase().indexOf(packageName.toLowerCase()) !== -1; | ||
}; | ||
@@ -43,8 +43,6 @@ | ||
var extractName = function (filename) { | ||
return filename.replace(/([.-]min)?\.js$/, '') | ||
return filename.replace(/([.-]min)?\.js$/, ''); | ||
}; | ||
var processAssetFiles = function (package, memo, asset) { | ||
// Don't allow invalidly semver'd packages in | ||
if (!semver.valid(asset.version)) return memo; | ||
return asset.files.reduce(function (memo, filename) { | ||
@@ -95,3 +93,3 @@ // Not Javascript? No thanks. | ||
return packages.filter(hasFilename).filter(isJS).reduce(extractAssets, {}); | ||
} | ||
}; | ||
@@ -98,0 +96,0 @@ module.exports = function (packages) { |
{ | ||
"name": "cdnjs-transform", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Extract assets to make CDNjs's packages useful.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
4257
103