New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@zodash/load-css

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zodash/load-css - npm Package Compare versions

Comparing version 0.0.8 to 0.1.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [0.1.0](https://github.com/zcorky/zodash/compare/@zodash/load-css@0.0.8...@zodash/load-css@0.1.0) (2022-08-24)
### Features
* **load-css:** support custom attributes like integrity, crossorigin ([9d36121](https://github.com/zcorky/zodash/commit/9d36121587f9965abe7972bcb517025e48345d3b))
## [0.0.8](https://github.com/zcorky/zodash/compare/@zodash/load-css@0.0.7...@zodash/load-css@0.0.8) (2021-12-04)

@@ -8,0 +19,0 @@

7

lib/index.d.ts

@@ -0,1 +1,6 @@

export interface IOptions {
integrity?: string;
crossorigin?: string;
[key: string]: any;
}
/**

@@ -6,3 +11,3 @@ * dynamic load style

*/
export declare function loadCss(path: string): Promise<void>;
export declare function loadCss(path: string, options?: IOptions): Promise<void>;
/**

@@ -9,0 +14,0 @@ * dynamic load script using ajax

@@ -9,5 +9,10 @@ "use strict";

*/
function loadCss(path) {
function loadCss(path, options) {
const attributes = options !== null && options !== void 0 ? options : {};
return new Promise((resolve, reject) => {
const style = document.createElement('link');
for (const key in attributes) {
// script.setAttribute(key, attributes[key]);
style[key] = attributes[key];
}
style.rel = 'stylesheet';

@@ -14,0 +19,0 @@ style.href = path;

4

package.json
{
"name": "@zodash/load-css",
"version": "0.0.8",
"version": "0.1.0",
"description": "Dynamic load css file",

@@ -70,3 +70,3 @@ "keywords": [

},
"gitHead": "3f39603b0e00f0d4774e83895847eb9beba4963e"
"gitHead": "49d0df78191e85b42300cddb3c9c076adb05fefe"
}
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