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

realdom

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

realdom - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

package.json
{
"name": "realdom",
"version": "0.0.3",
"version": "0.0.4",
"author": "Fedot Kriutchenko <fodyadev@gmail.com>",

@@ -5,0 +5,0 @@ "description": "",

import { runWithState, getCurrentHandler } from './state.js';
import { argsToArray, isReactive, kebab } from './common.js';
import { argsToArray, toString, kebab } from './common.js';
let tree = null;
let treeSymbol = Symbol();
const symbol = Symbol();
export class Tree {

@@ -17,3 +17,7 @@ list = []

case NodeOpen:
const elem = document.createElement(item.tag);
const elem = (
item.tag === ''
? document.createTextNode('')
: document.createElement(item.tag)
);
if (node) node.appendChild(elem); else this.tmpl = elem;

@@ -27,4 +31,3 @@ node = nodes[l] = elem;

case NodeText:
const text = document.createTextNode(item.value);
nodes[l - 1].appendChild(text);
if (!item.rerender) node.textContent = item.value;
break;

@@ -74,3 +77,2 @@ case NodeClose:

const symbol = Symbol();
function builder(effect) {

@@ -90,3 +92,3 @@ let names = [];

const get = (_, k) => {
if (k === treeSymbol) return true;
if (k === symbol) return true;
names.push(k);

@@ -122,18 +124,16 @@ return p;

export const Element = (tag, ...content) => {
const launch = () => {
tree.list[tree.i++] ??= new NodeOpen(
tag[0].toLowerCase() + kebab(tag.slice(1))
);
for (const item of content) {
switch (item[treeSymbol]) {
case true: item(); break;
default: (tree.list[tree.i++] ??= new NodeText(item)).update(item);
}
export const Element = tag => builder((_, content) => {
tree.list[tree.i++] ??= new NodeOpen(
!tag ? tag : tag[0].toLowerCase() + kebab(tag.slice(1))
);
for (const item of argsToArray(content)) {
if (typeof item == 'function' && item[symbol]) item();
else {
tree.list[tree.i++] ??= new NodeOpen('');
(tree.list[tree.i++] ??= new NodeText(item)).update(item);
tree.list[tree.i++] ??= new NodeClose();
}
tree.list[tree.i++] ??= new NodeClose();
}
launch[treeSymbol] = true;
return launch;
}
tree.list[tree.i++] ??= new NodeClose();
});

@@ -140,0 +140,0 @@ export const Component = func => {

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