New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cdnjs-transform

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdnjs-transform - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

6

example.js
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);

8

index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc