Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "customizr", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Build out a lean, mean Modernizr machine.", | ||
@@ -5,0 +5,0 @@ "main": "src", |
@@ -15,2 +15,32 @@ # customizr | ||
## Example | ||
### CSS / SCSS / LESS | ||
When going through css files, the crawler will not look for `display: flex` but rather if the code contains a css selector that is named like the Modernizr properties | ||
``` | ||
.flexbox { | ||
... | ||
} | ||
``` | ||
or | ||
``` | ||
.no-flexbox { | ||
... | ||
} | ||
``` | ||
### Javascript | ||
When going through javascript files, the crawler will look for Modernizr calls like this one: | ||
``` | ||
if (!Modernizr.flexbox) { | ||
... | ||
} | ||
``` | ||
## Use with Grunt | ||
@@ -62,3 +92,2 @@ | ||
"options" : [ | ||
"setClasses", | ||
"addTest", | ||
@@ -97,3 +126,6 @@ "html5printshiv", | ||
// Have custom Modernizr tests? Add them here. | ||
"customTests" : [] | ||
"customTests" : [], | ||
// Add custom prefix to Modernizr CSS classes | ||
"classPrefix" : '' | ||
} | ||
@@ -156,2 +188,7 @@ ``` | ||
###### **`classPrefix`** (String, optional) | ||
Add custom prefix to Modernizr classes to avoid clashes with your preexisting class names. | ||
This is an optional parameter. | ||
## Caching | ||
@@ -158,0 +195,0 @@ |
@@ -41,4 +41,4 @@ /* jshint node: true */ | ||
// JS files | ||
if ((/\.js$/).test(basename)) { | ||
// JavaScript/CoffeeScript/TypeScript files | ||
if ((/\.(js|coffee|ts)$/).test(basename)) { | ||
// Don't bother if we don't find a reference to Modernizr in the file... | ||
@@ -51,3 +51,3 @@ if (!(/Modernizr/im).test(data)) { | ||
} | ||
// If it's not JS, assume it's CSS (or similar, e.g.: LESS, SCSS) files | ||
// If it's not script, assume it's CSS (or similar, e.g.: LESS, SCSS) files | ||
else { | ||
@@ -189,3 +189,7 @@ prefix = settings.classPrefix || ''; | ||
var data = metadata.filter(function (data) { | ||
return data.property === test; | ||
if (Array.isArray(data.property)) { | ||
return data.property.indexOf(test) !== -1; | ||
} else { | ||
return data.property === test; | ||
} | ||
}); | ||
@@ -192,0 +196,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
252
5
32328
12
638