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

lib0

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib0 - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

.nyc_output/167bd912-1145-4e23-b01a-4a50e13b22f2.json

2

.nyc_output/processinfo/index.json

@@ -1,1 +0,1 @@

{"processes":{"598731f2-a3ad-4949-9223-0a6f2fd43780":{"parent":null,"children":[]}},"files":{"/home/dmonad/ylabs/lib0/dist/test.cjs":["598731f2-a3ad-4949-9223-0a6f2fd43780"]},"externalIds":{}}
{"processes":{"167bd912-1145-4e23-b01a-4a50e13b22f2":{"parent":null,"children":[]}},"files":{"/home/dmonad/ylabs/lib0/dist/test.cjs":["167bd912-1145-4e23-b01a-4a50e13b22f2"]},"externalIds":{}}

@@ -8,2 +8,3 @@ /* eslint-env browser */

import * as string from './string.js'
import * as array from './array.js'

@@ -233,7 +234,10 @@ export const registry = customElements

for (const key in slotElems) {
const currentSlot = dom.querySelector(this, `[slot="${key}"]`)
const nextSlot = dom.parseElement(slotElems[key])
nextSlot.setAttribute('slot', key)
if (currentSlot) {
dom.replaceWith(currentSlot, nextSlot)
const currentSlots = /** @type {Array<any>} */ (key !== 'default' ? array.from(dom.querySelectorAll(this, `[slot="${key}"]`)) : array.from(this.childNodes).filter(/** @param {any} child */ child => !dom.checkNodeType(child, dom.ELEMENT_NODE) || !child.hasAttribute('slot')))
currentSlots.slice(1).map(dom.remove)
const nextSlot = dom.parseFragment(slotElems[key])
if (key !== 'default') {
array.from(nextSlot.children).forEach(c => c.setAttribute('slot', key))
}
if (currentSlots.length > 0) {
dom.replaceWith(currentSlots[0], nextSlot)
} else {

@@ -240,0 +244,0 @@ dom.appendChild(this, nextSlot)

@@ -95,2 +95,8 @@ /* eslint-env browser */

/**
* @param {HTMLElement} el
*/
/* istanbul ignore next */
export const remove = el => el.remove()
/**
* @param {EventTarget} el

@@ -219,3 +225,3 @@ * @param {string} name

/* istanbul ignore next */
export const parseFragment = html => fragment(_parse(html).children)
export const parseFragment = html => fragment(/** @type {any} */ (_parse(html).childNodes))

@@ -231,3 +237,3 @@ /**

* @param {HTMLElement} oldEl
* @param {HTMLElement} newEl
* @param {HTMLElement|DocumentFragment} newEl
*/

@@ -248,6 +254,20 @@ /* istanbul ignore next */

* @param {HTMLElement} parent
* @param {HTMLElement} child
* @return {HTMLElement}
* @param {HTMLElement|DocumentFragment} child
* @return {HTMLElement|DocumentFragment}
*/
/* istanbul ignore next */
export const appendChild = (parent, child) => parent.appendChild(child)
export const ELEMENT_NODE = document.ELEMENT_NODE
export const TEXT_NODE = document.TEXT_NODE
export const CDATA_SECTION_NODE = document.CDATA_SECTION_NODE
export const COMMENT_NODE = document.COMMENT_NODE
export const DOCUMENT_NODE = document.DOCUMENT_NODE
export const DOCUMENT_TYPE_NODE = document.DOCUMENT_TYPE_NODE
export const DOCUMENT_FRAGMENT_NODE = document.DOCUMENT_FRAGMENT_NODE
/**
* @param {any} node
* @param {number} type
*/
export const checkNodeType = (node, type) => node.nodeType === type
{
"name": "lib0",
"version": "0.2.6",
"version": "0.2.7",
"description": "",

@@ -5,0 +5,0 @@ "sideEffects": false,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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