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

@bigcommerce/script-loader

Package Overview
Dependencies
Maintainers
14
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bigcommerce/script-loader - npm Package Compare versions

Comparing version 2.1.0 to 2.2.1

9

CHANGELOG.md

@@ -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 @@

4

lib/stylesheet-loader.d.ts
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) {

2

package.json
{
"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

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