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

travix-css-themes-polyfill

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

travix-css-themes-polyfill - npm Package Compare versions

Comparing version 0.1.1 to 0.1.4

2

lib/index.js

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

!function(){window.cssThemeService=function(e){return e.split("\n").join("").replace(/var\(--([\w-]+)\)/g,function(e,t){return(window.TravixTheme||{})[t]})},[].forEach.call(document.querySelectorAll("[data-cssvars]"),function(e){var t=e.href,n=new XMLHttpRequest;n.open("GET",t,!0),n.onreadystatechange=function(){if(4===n.readyState&&(200===n.status||0===n.status)){var e=document.createElement("style");document.head.appendChild(e),e.innerText=window.cssThemeService(n.responseText)}},n.send(null)}),document.head.addEventListener("DOMSubtreeModified",function(e){if(e.target instanceof HTMLStyleElement){-1!==e.target.innerText.indexOf("var(--")&&(e.target.innerText=window.cssThemeService(e.target.innerText))}},!1)}();
!function(){function e(e){var t=e.href;e.setAttribute("data-parsed",!0);var n=new XMLHttpRequest;n.open("GET",t,!0),n.onreadystatechange=function(){if(4===n.readyState&&(200===n.status||0===n.status)){var e=document.createElement("style");document.head.appendChild(e),e.innerText=window.cssThemeService(n.responseText)}},n.send(null)}function t(){[].forEach.call(document.querySelectorAll("[data-cssvars]:not([data-parsed])"),e)}window.cssThemeService=function(e){return e.split("\n").join("").replace(/var\(--([\w-]+)\)/g,function(e,t){return(window.TravixTheme||{})[t]})},t(),document.head.addEventListener("DOMSubtreeModified",function(e){if(e.target instanceof HTMLHeadElement&&t(),e.target instanceof HTMLStyleElement){-1!==e.target.innerText.indexOf("var(--")&&(e.target.innerText=window.cssThemeService(e.target.innerText))}},!1)}();
{
"name": "travix-css-themes-polyfill",
"version": "0.1.1",
"version": "0.1.4",
"description": "Travix CSS variables for themes polyfill",
"main": "src/index.js",
"main": "lib/index.js",
"scripts": {
"build": "uglifyjs --compress --mangle --output lib/index.js src/index.js",
"build": "mkdir -p lib && uglifyjs --compress --mangle --output lib/index.js src/index.js",
"test": "node test/index.spec.js",

@@ -9,0 +9,0 @@ "lint": "eslint --color src/index.js"

@@ -10,3 +10,6 @@ global.window = {

querySelectorAll() {
return [{ href: 'test.js' }];
return [{
href: 'test.js',
setAttribute: () => {},
}];
},

@@ -37,2 +40,7 @@ createElement(name) {

function HTMLHeadElement() {
this.href = 'fake.js';
this.setAttribute = () => {};
};
function testEventHandler() {

@@ -85,3 +93,4 @@ const testElem = new HTMLStyleElement();

global.HTMLStyleElement = HTMLStyleElement;
global.HTMLHeadElement = HTMLHeadElement;
require('../src/index.js');
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