Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-resolve-import

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-resolve-import - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "css-resolve-import",
"version": "0.0.2",
"version": "0.0.3",
"description": "Resolves @import statements in CSS",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -7,6 +7,7 @@ module.exports = parse

var stripUTF8ByteOrder = require('./strip-utf8-byte-order')
var stringImportMatcher = /@import ["'](.+)["'];/g
var importMatcher = /@import +(url\()?([^()]+)\)? *;/g
var stringImportMatcher = /@import ["'](.+)["'];?/g
var importMatcher = /@import +(?:url\()?([^()]+)\)?(:? *;)?/g
var urlMatcher = /url\(["']?([^"'()]+)["']?\)/g
var absoluteUrl = /^([a-z][a-z-+.0-9]*:\/)?\//i
var urlWithScheme = /^(?:[a-z][a-z-+.0-9]*:)?\/\//i
var absoluteUrl = /^\//i
var dataUrl = /^data:/

@@ -27,3 +28,3 @@

url = url.trim()
if(!url.match(dataUrl) && !url.match(absoluteUrl)) {
if(!url.match(dataUrl) && !url.match(urlWithScheme) && !url.match(absoluteUrl)) {
url = path.join(relRoot, url).replace(/\\/g, '/')

@@ -33,3 +34,7 @@ }

})
.replace(importMatcher, function(match, junk, file) {
.replace(importMatcher, function(match, file) {
if(file.match(urlWithScheme)) {
return format('@import url(%s);', file)
}
if(!file.match(absoluteUrl)) {

@@ -36,0 +41,0 @@ file = path.join(absRoot, file)

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