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

@riotjs/util

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@riotjs/util - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

20

checks.js

@@ -12,2 +12,22 @@ /**

/**
* Check if an element is part of an svg
* @param {HTMLElement} el - element to check
* @returns {boolean} true if we are in an svg context
*/
export function isSvg(el) {
const owner = el.ownerSVGElement
return !!owner || owner === null
}
/**
* Check if an element is a template tag
* @param {HTMLElement} el - element to check
* @returns {boolean} true if it's a <template>
*/
export function isTemplate(el) {
return !isNil(el.content)
}
/**
* Check that will be passed if its argument is a function

@@ -14,0 +34,0 @@ * @param {*} value - value to check

@@ -14,1 +14,34 @@ import {dashToCamelCase} from './strings'

}
/**
* Move all the child nodes from a source tag to another
* @param {HTMLElement} source - source node
* @param {HTMLElement} target - target node
* @returns {undefined} it's a void method ¯\_(ツ)_/¯
*/
// Ignore this helper because it's needed only for svg tags
export function moveChildren(source, target) {
if (source.firstChild) {
target.appendChild(source.firstChild)
moveChildren(source, target)
}
}
/**
* Remove the child nodes from any DOM node
* @param {HTMLElement} node - target node
* @returns {undefined}
*/
export function cleanNode(node) {
clearChildren(node.childNodes)
}
/**
* Clear multiple children in a node
* @param {HTMLElement[]} children - direct children nodes
* @returns {undefined}
*/
export function clearChildren(children) {
Array.from(children).forEach(n => n.parentNode && n.parentNode.removeChild(n))
}

2

package.json
{
"name": "@riotjs/util",
"version": "0.0.0",
"version": "1.0.0",
"description": "Riot.js util functions",

@@ -5,0 +5,0 @@ "scripts": {

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