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

@ne1410s/cust-elems

Package Overview
Dependencies
Maintainers
1
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ne1410s/cust-elems - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

dist/custom-element-base.d.ts

7

dist/index.d.ts

@@ -1,5 +0,2 @@

export declare abstract class CustomElementBase extends HTMLElement {
protected root: ShadowRoot;
constructor(css: string, html: string, mode?: ShadowRootMode);
protected decode(b64: string): string;
}
export { CustomElementBase } from './custom-element-base';
export * from './custom-element-static';

@@ -9,13 +9,26 @@ 'use strict';

this.root = this.attachShadow({ mode });
this.root.innerHTML = this.decode(html);
this.root.innerHTML = html;
const style = document.createElement('style');
style.textContent = this.decode(css);
style.textContent = css;
this.root.appendChild(style);
}
decode(b64) {
const bIndex = (b64 + '').indexOf('base64,');
return bIndex === -1 ? b64 : window.atob(b64.substring(bIndex + 7));
}
}
function decode(b64) {
const bIndex = (b64 + '').indexOf('base64,');
return bIndex === -1 ? b64 : window.atob(b64.substring(bIndex + 7));
}
function reduceCss(cssIn) {
return cssIn
.replace(/\s+/g, ' ')
.replace(/([,{}:;])\s/g, '$1')
.replace(/\s([{])/g, '$1');
}
function reduceHtml(htmlIn) {
return htmlIn.replace(/\s+/g, ' ').replace(/>\s</g, '><');
}
exports.CustomElementBase = CustomElementBase;
exports.decode = decode;
exports.reduceCss = reduceCss;
exports.reduceHtml = reduceHtml;

@@ -5,13 +5,23 @@ class CustomElementBase extends HTMLElement {

this.root = this.attachShadow({ mode });
this.root.innerHTML = this.decode(html);
this.root.innerHTML = html;
const style = document.createElement('style');
style.textContent = this.decode(css);
style.textContent = css;
this.root.appendChild(style);
}
decode(b64) {
const bIndex = (b64 + '').indexOf('base64,');
return bIndex === -1 ? b64 : window.atob(b64.substring(bIndex + 7));
}
}
export { CustomElementBase };
function decode(b64) {
const bIndex = (b64 + '').indexOf('base64,');
return bIndex === -1 ? b64 : window.atob(b64.substring(bIndex + 7));
}
function reduceCss(cssIn) {
return cssIn
.replace(/\s+/g, ' ')
.replace(/([,{}:;])\s/g, '$1')
.replace(/\s([{])/g, '$1');
}
function reduceHtml(htmlIn) {
return htmlIn.replace(/\s+/g, ' ').replace(/>\s</g, '><');
}
export { CustomElementBase, decode, reduceCss, reduceHtml };

@@ -11,14 +11,27 @@ (function (global, factory) {

this.root = this.attachShadow({ mode });
this.root.innerHTML = this.decode(html);
this.root.innerHTML = html;
const style = document.createElement('style');
style.textContent = this.decode(css);
style.textContent = css;
this.root.appendChild(style);
}
decode(b64) {
const bIndex = (b64 + '').indexOf('base64,');
return bIndex === -1 ? b64 : window.atob(b64.substring(bIndex + 7));
}
}
function decode(b64) {
const bIndex = (b64 + '').indexOf('base64,');
return bIndex === -1 ? b64 : window.atob(b64.substring(bIndex + 7));
}
function reduceCss(cssIn) {
return cssIn
.replace(/\s+/g, ' ')
.replace(/([,{}:;])\s/g, '$1')
.replace(/\s([{])/g, '$1');
}
function reduceHtml(htmlIn) {
return htmlIn.replace(/\s+/g, ' ').replace(/>\s</g, '><');
}
exports.CustomElementBase = CustomElementBase;
exports.decode = decode;
exports.reduceCss = reduceCss;
exports.reduceHtml = reduceHtml;

@@ -25,0 +38,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

{
"name": "@ne1410s/cust-elems",
"version": "0.1.5",
"version": "0.2.0",
"description": "ES Custom Elements base functionality",

@@ -43,7 +43,7 @@ "main": "dist/ne14_cust_elems.cjs.min.js",

"rimraf": "^3.0.1",
"rollup": "^2.31.0",
"rollup": "^2.33.2",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-typescript2": "^0.27.3",
"typescript": "^4.0.3"
"rollup-plugin-typescript2": "^0.29.0",
"typescript": "^4.0.5"
}
}
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