@bigcommerce/script-loader
Advanced tools
Comparing version 2.1.0 to 2.2.1
@@ -5,2 +5,11 @@ # Changelog | ||
### [2.2.1](https://github.com/bigcommerce/script-loader-js/compare/v2.2.0...v2.2.1) (2020-05-25) | ||
## [2.2.0](https://github.com/bigcommerce/script-loader-js/compare/v2.1.0...v2.2.0) (2020-05-25) | ||
### Features | ||
* **core:** CHECKOUT-4909 Pass in attributes to stylesheet ([8bfc8a4](https://github.com/bigcommerce/script-loader-js/commit/8bfc8a4)) | ||
## [2.1.0](https://github.com/bigcommerce/script-loader-js/compare/v2.0.0...v2.1.0) (2019-10-24) | ||
@@ -7,0 +16,0 @@ |
export interface LoadStylesheetOptions { | ||
prepend: boolean; | ||
attributes?: StylesheetAttributes; | ||
} | ||
@@ -7,2 +8,5 @@ export interface PreloadStylesheetOptions { | ||
} | ||
export interface StylesheetAttributes { | ||
[key: string]: string; | ||
} | ||
export default class StylesheetLoader { | ||
@@ -9,0 +13,0 @@ private _browserSupport; |
@@ -15,3 +15,7 @@ "use strict"; | ||
var stylesheet = document.createElement('link'); | ||
var _a = (options || {}).prepend, prepend = _a === void 0 ? false : _a; | ||
var _a = options || {}, _b = _a.prepend, prepend = _b === void 0 ? false : _b, _c = _a.attributes, attributes = _c === void 0 ? {} : _c; | ||
Object.keys(attributes) | ||
.forEach(function (key) { | ||
stylesheet.setAttribute(key, attributes[key]); | ||
}); | ||
stylesheet.onload = function () { return resolve(); }; | ||
@@ -18,0 +22,0 @@ stylesheet.onerror = function (event) { |
{ | ||
"name": "@bigcommerce/script-loader", | ||
"version": "2.1.0", | ||
"version": "2.2.1", | ||
"description": "A library for loading JavaScript files asynchronously", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41137
283
1