Socket
Socket
Sign inDemoInstall

@thi.ng/hiccup

Package Overview
Dependencies
Maintainers
1
Versions
254
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/hiccup - npm Package Compare versions

Comparing version 0.1.7 to 1.0.0

16

CHANGELOG.md

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

<a name="1.0.0"></a>
# [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@0.1.7...@thi.ng/hiccup@1.0.0) (2018-02-03)
### Features
* **hiccup:** skip fn exec for event attribs, update tests, readme ([7ae706e](https://github.com/thi-ng/umbrella/commit/7ae706e))
### BREAKING CHANGES
* **hiccup:** event attribs w/ function values will be omitted, see readme for details/examples
<a name="0.1.7"></a>

@@ -8,0 +24,0 @@ ## [0.1.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@0.1.6...@thi.ng/hiccup@0.1.7) (2018-02-02)

2

package.json
{
"name": "@thi.ng/hiccup",
"version": "0.1.7",
"version": "1.0.0",
"description": "HTML/SVG/XML serialization of nested data structures, iterables & closures",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -120,2 +120,5 @@ # @thi.ng/hiccup

**BREAKING CHANGE since 1.0.0:** Function values for event attributes (any
attrib name starting with "on") WILL BE OMITTED from output.
```js

@@ -129,2 +132,18 @@ ["div#foo", { bar: (attribs) => attribs.id + "-bar" }]

```js
["div#foo", { onclick: () => alert("foo") }, "click me!"]
```
```html
<div id="foo">click me!</div>
```
```js
["div#foo", { onclick: "alert('foo')" }, "click me!"]
```
```html
<div id="foo" onclick="alert('foo')">click me!</div>
```
### Simple components

@@ -131,0 +150,0 @@

@@ -92,6 +92,6 @@ "use strict";

if (attribs.hasOwnProperty(a)) {
let v = attribs[a];
let v = attribs[a], isEvent = /^on\w+/.test(a);
if (v != null) {
if (is_function_1.isFunction(v)) {
if ((v = v(attribs)) == null) {
if (isEvent || (v = v(attribs)) == null) {
continue;

@@ -98,0 +98,0 @@ }

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