@riotjs/dom-bindings
Advanced tools
Comparing version 6.0.3 to 6.0.4
@@ -5,3 +5,3 @@ (function (global, factory) { | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.riotDOMBindings = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
})(this, (function (exports) { 'use strict'; | ||
@@ -111,4 +111,4 @@ /** | ||
const HEAD_SYMBOL = Symbol('head'); | ||
const TAIL_SYMBOL = Symbol('tail'); | ||
const HEAD_SYMBOL = Symbol(); | ||
const TAIL_SYMBOL = Symbol(); | ||
@@ -670,2 +670,10 @@ /** | ||
/** | ||
* Throw an error with a descriptive message | ||
* @param { string } message - error message | ||
* @returns { undefined } hoppla.. at this point the program should stop working | ||
*/ | ||
function panic(message) { | ||
throw new Error(message) | ||
} | ||
/** | ||
* Returns the memoized (cached) function. | ||
@@ -1354,3 +1362,3 @@ * // borrowed from https://www.30secondsofcode.org/js/s/memoize | ||
*/ | ||
const TemplateChunk = Object.freeze({ | ||
const TemplateChunk = { | ||
// Static props | ||
@@ -1388,3 +1396,3 @@ // bindings: null, | ||
mount(el, scope, parentScope, meta = {}) { | ||
if (!el) throw new Error('Please provide DOM node to mount properly your template') | ||
if (!el) panic('Please provide DOM node to mount properly your template'); | ||
@@ -1476,3 +1484,3 @@ if (this.el) this.unmount(scope); | ||
case !mustRemoveRoot: | ||
cleanNode(el); | ||
el.innerHTML = ''; | ||
break | ||
@@ -1502,3 +1510,3 @@ | ||
} | ||
}); | ||
}; | ||
@@ -1528,2 +1536,2 @@ | ||
}))); | ||
})); |
{ | ||
"name": "@riotjs/dom-bindings", | ||
"version": "6.0.3", | ||
"version": "6.0.4", | ||
"description": "Riot.js DOM bindings", | ||
@@ -47,21 +47,21 @@ "main": "dist/umd.dom-bindings.js", | ||
"benchmark": "^2.1.4", | ||
"chai": "^4.3.4", | ||
"chai": "^4.3.6", | ||
"coveralls": "^3.1.1", | ||
"eslint": "^7.32.0", | ||
"eslint": "^8.22.0", | ||
"eslint-config-riot": "^3.0.0", | ||
"esm": "^3.2.25", | ||
"jsdom": "^16.7.0", | ||
"jsdom": "^20.0.0", | ||
"jsdom-global": "3.0.2", | ||
"mocha": "^8.4.0", | ||
"nyc": "^15.1.0", | ||
"rollup": "^2.56.0", | ||
"rollup": "^2.78.0", | ||
"rollup-plugin-alias": "^2.2.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"sinon": "^11.1.2", | ||
"sinon": "^14.0.0", | ||
"sinon-chai": "^3.7.0", | ||
"typescript": "^4.3.5" | ||
"typescript": "^4.7.4" | ||
}, | ||
"dependencies": { | ||
"@riotjs/util": "^2.0.4" | ||
"@riotjs/util": "^2.1.1" | ||
} | ||
} |
# dom-bindings | ||
[![Build Status][travis-image]][travis-url] | ||
[![Build Status][ci-image]][ci-url] | ||
[![Code Quality][codeclimate-image]][codeclimate-url] | ||
@@ -35,4 +35,4 @@ [![NPM version][npm-version-image]][npm-url] | ||
[travis-image]:https://img.shields.io/travis/riot/dom-bindings.svg?style=flat-square | ||
[travis-url]:https://travis-ci.org/riot/dom-bindings | ||
[ci-image]:https://img.shields.io/github/workflow/status/riot/dom-bindings/test?style=flat-square | ||
[ci-url]:https://github.com/riot/dom-bindings/actions | ||
@@ -145,3 +145,3 @@ [license-image]:http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square | ||
expressions: [{ | ||
type: expressionTypes.Text, | ||
type: expressionTypes.TEXT, | ||
childNodeIndex: 0, | ||
@@ -152,3 +152,3 @@ evaluate: scope => scope.greeting, | ||
template('<article><p><!----></p></article>', [pGreeting]) | ||
template('<article><p><!----></p></article>', [pGreetingBinding]) | ||
``` | ||
@@ -155,0 +155,0 @@ |
@@ -1,2 +0,2 @@ | ||
export const HEAD_SYMBOL = Symbol('head') | ||
export const TAIL_SYMBOL = Symbol('tail') | ||
export const HEAD_SYMBOL = Symbol() | ||
export const TAIL_SYMBOL = Symbol() |
@@ -1,2 +0,2 @@ | ||
import {cleanNode, clearChildren, removeChild} from '@riotjs/util/dom' | ||
import {clearChildren, removeChild} from '@riotjs/util/dom' | ||
import {IS_PURE_SYMBOL} from '@riotjs/util/constants' | ||
@@ -7,2 +7,3 @@ import createBinding from './binding' | ||
import {isTemplate} from '@riotjs/util/checks' | ||
import {panic} from '@riotjs/util/misc' | ||
@@ -42,3 +43,3 @@ /** | ||
*/ | ||
export const TemplateChunk = Object.freeze({ | ||
export const TemplateChunk = { | ||
// Static props | ||
@@ -76,3 +77,3 @@ // bindings: null, | ||
mount(el, scope, parentScope, meta = {}) { | ||
if (!el) throw new Error('Please provide DOM node to mount properly your template') | ||
if (!el) panic('Please provide DOM node to mount properly your template') | ||
@@ -164,3 +165,3 @@ if (this.el) this.unmount(scope) | ||
case !mustRemoveRoot: | ||
cleanNode(el) | ||
el.innerHTML = '' | ||
break | ||
@@ -190,3 +191,3 @@ | ||
} | ||
}) | ||
} | ||
@@ -193,0 +194,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112682
2694
Updated@riotjs/util@^2.1.1