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

cssjoin

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cssjoin - npm Package Compare versions

Comparing version 0.1.0-0 to 0.2.0-0

1

lib/cssjoin.js

@@ -83,3 +83,2 @@ var inutil = require("./util.js");

var _resolvePaths = this.getPaths(cssFilePath);
var _this = this;

@@ -86,0 +85,0 @@ fs.stat(cssFilePath, function(err, result){

36

lib/util.js

@@ -6,5 +6,3 @@ var fs = require("fs");

var IMPORT_REGEXP = /@import\s.+;/g;
var FILE_REGEXP = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/;
/**

@@ -41,2 +39,29 @@ * Find exist file.

function trimQuate(syntax){
if(/^'(.*)'$/.test(syntax)){
syntax = syntax.replace(/^'/,'');
syntax = syntax.replace(/'$/,'');
return syntax
}
if(/^"(.*)"$/.test(syntax)){
syntax = syntax.replace(/^"/,'');
syntax = syntax.replace(/"$/,'');
return syntax;
}
return syntax;
}
function findImportFile(syntax){
var URL_REGEXP = /url\((.*)\)/
if(URL_REGEXP.test(syntax)){
var matches = syntax.match(URL_REGEXP);
return trimQuate(matches[1]);
}
var FILE_REGEXP = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/;
if(FILE_REGEXP.test(syntax)){
var matches = syntax.match(FILE_REGEXP);
var fileName = matches[1] || matches[2];
return fileName
}
}
function getReplaceMap(css, resolvePaths){

@@ -55,7 +80,4 @@ var _replaceMap = {};

var importSyntax = importMatches[i];
if(FILE_REGEXP.test(importSyntax) === false){
continue;
}
var matches = importSyntax.match(FILE_REGEXP);
var fileName = matches[1] || matches[2];
var fileName = findImportFile(importSyntax)
if(/\.css$/.test(fileName) === false){

@@ -62,0 +84,0 @@ continue;

{
"name": "cssjoin",
"version": "0.1.0-0",
"version": "0.2.0-0",
"description": "Extend css @import loaded file",

@@ -18,3 +18,4 @@ "main": "index.js",

"mocha": "~1.7.3",
"should": "~1.2.1"
"should": "~1.2.1",
"rewire": "~1.1.2"
},

@@ -21,0 +22,0 @@ "scripts": {

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