Socket
Socket
Sign inDemoInstall

defer-css

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.0.3

index.min.js

18

index.js

@@ -0,5 +1,12 @@

// @ts-check
let deferCssData = {};
const deferCss = (links, config = 'link') => {
/**
* @param {object[]} links
* @param {string|object} config
*/
const deferCss = function (links, config) {
// Setup Config default Values.
if (config === undefined) config = 'link';
if (typeof config !== "object") config = {mountOn: config};

@@ -31,3 +38,3 @@ if (typeof config.name === "undefined") config.name = "default";

newLink.onload = function () {
window.deferCssData[config.name].loaded++;
deferCssData[config.name].loaded++;
linkData.onload(linkData)

@@ -38,3 +45,3 @@ }

newLink.onload = function () {
window.deferCssData[config.name].loaded++;
deferCssData[config.name].loaded++;
}

@@ -53,2 +60,3 @@ }

// @ts-ignore
firstLink.parentNode.insertBefore(newLink, firstLink);

@@ -58,3 +66,3 @@ }

window.deferCss = deferCss;
window.deferCssData = deferCssData;
window['deferCss'] = deferCss;
window['deferCssData'] = deferCssData;
{
"name": "defer-css",
"version": "0.0.2",
"version": "0.0.3",
"description": "Load css in your page without affecting load speed.",
"main": "index.js",
"main": "index.min.js",
"repository": "https://github.com/trapcodeio/defer-css.git",

@@ -7,0 +7,0 @@ "author": "trapcode",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc