inject-stylesheet
Advanced tools
Comparing version 2.0.0 to 3.0.0
### General information | ||
* Library version: <!-- Example: 1.0.0 --> | ||
* Browser and OS <!-- Example: Chrome 56.0.2924.87 (64-bit) on MacOS 10.12.3 --> | ||
- Library version: <!-- Example: 1.0.0 --> | ||
- Browser and OS <!-- Example: Chrome 56.0.2924.87 (64-bit) on MacOS 10.12.3 --> | ||
@@ -6,0 +6,0 @@ ### Issue description |
@@ -0,1 +1,9 @@ | ||
# 3.0.0 | ||
- Add typescript types | ||
_Breaking Changes_ | ||
- drop IE8 support | ||
# 2.0.0 | ||
@@ -5,7 +13,7 @@ | ||
* change `injectWithBlacklist` to `injectWithBlocklist` | ||
* change `injectWithWhitelist` to `injectWithAllowlist` | ||
- change `injectWithBlacklist` to `injectWithBlocklist` | ||
- change `injectWithWhitelist` to `injectWithAllowlist` | ||
# 1.0.0 | ||
* Initial release | ||
- Initial release |
{ | ||
"name": "inject-stylesheet", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Create a style element with CSS properties, filtering input using a allowlist or blocklist", | ||
"main": "index.js", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"lint": "eslint .", | ||
"test": "npm run lint && karma start config/karma.js --single-run" | ||
"prepublishOnly": "npm run build", | ||
"prebuild": "prettier --write .", | ||
"build": "tsc --declaration", | ||
"lint": "eslint --ext js,ts .", | ||
"posttest": "npm run lint", | ||
"test": "jest" | ||
}, | ||
@@ -17,16 +22,18 @@ "author": "Braintree <code@getbraintree.com>", | ||
"devDependencies": { | ||
"browserify": "^16.2.3", | ||
"chai": "^4.2.0", | ||
"eslint": "^5.16.0", | ||
"eslint-config-braintree": "^2.0.0", | ||
"karma": "^4.1.0", | ||
"karma-browserify": "^6.0.0", | ||
"karma-chai-sinon": "0.1.5", | ||
"karma-mocha": "^1.3.0", | ||
"karma-phantomjs-launcher": "^1.0.4", | ||
"mocha": "^6.1.4", | ||
"phantomjs-prebuilt": "^2.1.16", | ||
"sinon": "^7.3.2", | ||
"sinon-chai": "^3.3.0" | ||
"@types/jest": "^25.2.1", | ||
"eslint": "^6.8.0", | ||
"eslint-config-braintree": "^5.0.0-typescript-prep-rc.17", | ||
"jest": "^25.3.0", | ||
"prettier": "^2.0.4", | ||
"ts-jest": "^25.3.1", | ||
"typescript": "^3.8.3" | ||
}, | ||
"jest": { | ||
"preset": "ts-jest", | ||
"globals": { | ||
"ts-jest": { | ||
"tsConfig": "src/__tests__/tsconfig.json" | ||
} | ||
} | ||
} | ||
} |
@@ -1,3 +0,2 @@ | ||
inject-stylesheet | ||
================= | ||
# inject-stylesheet | ||
@@ -18,19 +17,19 @@ This library takes a blocklist (or allowlist) of CSS properties and sanitizes for known CSS exploits. | ||
```javascript | ||
var injectStylesheet = require('inject-stylesheet'); | ||
var injectStylesheet = require("inject-stylesheet"); | ||
var styles = { | ||
"input": { | ||
input: { | ||
"font-size": "16pt", | ||
"color": "#3A3A3A" | ||
color: "#3A3A3A", | ||
}, | ||
".invalid": { | ||
"color": "tomato" | ||
color: "tomato", | ||
}, | ||
"@media screen and (max-width: 700px)": { | ||
"input": { | ||
"font-size": "14pt" | ||
} | ||
} | ||
input: { | ||
"font-size": "14pt", | ||
}, | ||
}, | ||
}; | ||
var allowlist = [ 'font-size', 'color' ]; | ||
var blocklist = [ 'background', 'display' ]; | ||
var allowlist = ["font-size", "color"]; | ||
var blocklist = ["background", "display"]; | ||
@@ -37,0 +36,0 @@ injectStylesheet.injectWithBlocklist(styles, blocklist); |
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
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
23586
7
31
588
56