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

@saltcorn/markup

Package Overview
Dependencies
Maintainers
1
Versions
401
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saltcorn/markup - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

4

markup.test.js

@@ -30,2 +30,6 @@ const { a, input, div, ul, text } = require("./tags");

);
expect(div({ class: ["foo", " "] }, 5)).toBe('<div class="foo ">5</div>');
expect(input({ class: ["foo", " "] })).toBe('<input class="foo ">');
expect(

@@ -32,0 +36,0 @@ div({ class: ["foo bar", "", undefined, null, false, "baz"] }, 5)

6

package.json
{
"name": "@saltcorn/markup",
"version": "0.0.5",
"version": "0.0.6",
"description": "",

@@ -12,3 +12,3 @@ "main": "index.js",

"dependencies": {
"contractis": "^0.0.5",
"contractis": "^0.0.6",
"xss": "^1.0.6"

@@ -25,3 +25,3 @@ },

},
"gitHead": "1725443990ecd751fed7549ed73fdb8aee4b0ed0"
"gitHead": "4c4b8e7d7ebc5a703b8c9f7c1527b59694238d71"
}
const xss = require("xss");
const ppClasses = cs =>
typeof cs === "string" ? cs : !cs ? "" : cs.filter(c => c).join(" ");
const ppAttrib = ([k, v]) =>
typeof v === "boolean"
? v
? k
: ""
: typeof v === "undefined"
? ""
: k === "class"
? `class="${ppClasses(v)}"`
: `${k}="${v}"`;
const mkTag = (tnm, forceStandAloneClosingTag) => (...args) => {

@@ -7,16 +20,2 @@ var body = "";

const ppClasses = cs =>
typeof cs === "string" ? cs : !cs ? "" : cs.filter(c => c).join(" ");
const ppAttrib = ([k, v]) =>
typeof v === "boolean"
? v
? k
: ""
: typeof v === "undefined"
? ""
: k === "class"
? `class="${ppClasses(v)}"`
: `${k}="${v}"`;
const argIter = arg => {

@@ -45,3 +44,3 @@ if (typeof arg === "undefined" || arg === null || arg === false) {

const attribs = Object.entries(kvs)
.map(([k, v]) => `${k}="${v}"`)
.map(ppAttrib)
.join(" ");

@@ -76,2 +75,3 @@ return `<input ${attribs}>`;

header: mkTag("header"),
footer: mkTag("footer"),
section: mkTag("section"),

@@ -78,0 +78,0 @@ tr: mkTag("tr"),

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