New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@begin/enhance

Package Overview
Dependencies
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@begin/enhance - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

50

index.js

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

import { existsSync } from 'fs'
import path from 'path'

@@ -14,6 +13,6 @@ import { parse, parseFragment as fragment, serialize } from 'parse5'

function html(strings, ...values) {
return function html(strings, ...values) {
const doc = parse(render(strings, ...values))
const body = doc.childNodes[0].childNodes[1]
const customElements = processCustomElements(doc, templates)
const customElements = processCustomElements(body, templates)
const moduleNames = [...new Set(customElements.map(node => node.tagName))]

@@ -24,4 +23,2 @@ const scripts = fragment(moduleNames.map(name => script(modules, name)).join(''))

}
return html
}

@@ -81,29 +78,34 @@

slots.forEach(slot => {
for (let i=0; i < slots.length; i++) {
const slot = slots[i]
const slotAttrs = slot.attrs || []
let hasSlotName = false
slotAttrs.forEach(attr => {
for (let i=0; i < slotAttrs.length; i++) {
const attr = slotAttrs[i]
if (attr.name === 'name') {
hasSlotName = true
const slotName = attr.value
inserts.forEach(insert => {
for (let i=0; i < inserts.length; i ++) {
const insert = inserts[i]
const insertAttrs = insert.attrs || []
insertAttrs.forEach(attr => {
if (attr.name === 'slot') {
const insertSlot = attr.value
if (insertSlot === slotName) {
const slotParentChildNodes = slot.parentNode.childNodes
slotParentChildNodes.splice(
slotParentChildNodes
.indexOf(slot),
1,
insert
)
}
for (let i=0; i < insertAttrs.length; i++) {
const attr = insertAttrs[i]
const insertSlot = attr.value
if (insertSlot === slotName) {
const slotParentChildNodes = slot.parentNode.childNodes
slotParentChildNodes.splice(
slotParentChildNodes
.indexOf(slot),
1,
insert
)
}
})
})
}
}
}
})
}

@@ -120,3 +122,3 @@ if (!hasSlotName) {

}
})
}
}

@@ -123,0 +125,0 @@

{
"name": "@begin/enhance",
"version": "0.0.3",
"version": "0.0.4",
"description": "Custom Element Server-side rendering CESR",

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

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