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

typed-dom

Package Overview
Dependencies
Maintainers
1
Versions
350
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typed-dom - npm Package Compare versions

Comparing version 0.0.264 to 0.0.265

1

dom.test.ts

@@ -67,2 +67,3 @@ import { shadow, frag, html, svg, text, define, defrag } from './dom';

assert(define(define(html('a', { href: '' })), { href: null }).matches(':not([href])'));
assert(define(html('html'), frag(['a', 'b']).childNodes).innerHTML === 'ab');
assert(define(html('html', [frag(['a', text('b')])]), 'c').innerHTML === 'c');

@@ -69,0 +70,0 @@ assert(define(html('html', 'a'), [frag(['b', text('c')])]).innerHTML === 'bc');

9

dom.ts
import { Symbol, document } from 'spica/global';
import { hasOwnProperty } from 'spica/alias';
import { isArray, hasOwnProperty } from 'spica/alias';
import { memoize } from 'spica/memoize';

@@ -153,3 +153,3 @@

}
function defineChildren<T extends ParentNode & Node>(node: T, children: Children): T {
function defineChildren<T extends ParentNode & Node>(node: T, children: Children | readonly (string | Node)[]): T {
if (children === void 0) return node;

@@ -159,7 +159,8 @@ if (typeof children === 'string') {

}
else if (node.firstChild) {
else if (!isArray(children) || node.firstChild) {
node.replaceChildren(...children);
}
else {
for (const child of children) {
for (let i = 0; i < children.length; ++i) {
const child = children[i];
typeof child === 'object'

@@ -166,0 +167,0 @@ ? node.appendChild(child)

{
"name": "typed-dom",
"version": "0.0.264",
"version": "0.0.265",
"description": "A value-level and type-level DOM builder.",

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

@@ -67,2 +67,3 @@ import { shadow, frag, html, svg, text, define, defrag } from './dom';

assert(define(define(html('a', { href: '' })), { href: null }).matches(':not([href])'));
assert(define(html('html'), frag(['a', 'b']).childNodes).innerHTML === 'ab');
assert(define(html('html', [frag(['a', text('b')])]), 'c').innerHTML === 'c');

@@ -69,0 +70,0 @@ assert(define(html('html', 'a'), [frag(['b', text('c')])]).innerHTML === 'bc');

import { Symbol, document } from 'spica/global';
import { hasOwnProperty } from 'spica/alias';
import { isArray, hasOwnProperty } from 'spica/alias';
import { memoize } from 'spica/memoize';

@@ -153,3 +153,3 @@

}
function defineChildren<T extends ParentNode & Node>(node: T, children: Children): T {
function defineChildren<T extends ParentNode & Node>(node: T, children: Children | readonly (string | Node)[]): T {
if (children === void 0) return node;

@@ -159,7 +159,8 @@ if (typeof children === 'string') {

}
else if (node.firstChild) {
else if (!isArray(children) || node.firstChild) {
node.replaceChildren(...children);
}
else {
for (const child of children) {
for (let i = 0; i < children.length; ++i) {
const child = children[i];
typeof child === 'object'

@@ -166,0 +167,0 @@ ? node.appendChild(child)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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