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

@erickmerchant/framework

Package Overview
Dependencies
Maintainers
1
Versions
244
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@erickmerchant/framework - npm Package Compare versions

Comparing version 42.1.0 to 42.2.0

4

create-dom-view.js

@@ -87,3 +87,3 @@ const svgNamespace = 'http://www.w3.org/2000/svg'

if (next.type === 'text') {
if (next.text) {
if (!append && childNode.nodeType !== 3) {

@@ -203,3 +203,3 @@ replace = true

if (grand == null || grand.type == null) {
grand = {type: 'text', value: grand == null ? '' : grand}
grand = {text: true, value: grand == null ? '' : grand}
}

@@ -206,0 +206,0 @@

@@ -6,4 +6,14 @@ const weakMap = new WeakMap()

export const tokenTypes = {
variable: 0,
tag: 1,
endtag: 2,
key: 3,
value: 4,
node: 5,
text: 6
}
const valueTrue = {
type: 'value',
type: tokenTypes.value,
value: true

@@ -52,3 +62,3 @@ }

yield {
type: !end ? 'tag' : 'endtag',
type: !end ? tokenTypes.tag : tokenTypes.endtag,
value

@@ -66,3 +76,3 @@ }

{
type: 'endtag',
type: tokenTypes.endtag,
value: tag

@@ -94,3 +104,3 @@ },

yield {
type: 'key',
type: tokenTypes.key,
value

@@ -123,3 +133,3 @@ }

yield {
type: 'value',
type: tokenTypes.value,
value

@@ -146,3 +156,3 @@ }

yield {
type: 'text',
type: tokenTypes.text,
value

@@ -160,3 +170,3 @@ }

yield {
type: 'variable',
type: tokenTypes.variable,
value: index

@@ -172,3 +182,3 @@ }

tag,
type: 'node',
type: tokenTypes.node,
dynamic: 0,

@@ -190,7 +200,11 @@ attributes: [],

break
} else if (token.type === 'key') {
} else if (token.type === tokenTypes.key) {
const next = tokens.next()?.value
if (next.type === 'value') {
child.attributes.push({key: token.value, value: next.value})
if (next.type === tokenTypes.value) {
child.attributes.push({
key: token.value,
variable: false,
value: next.value
})
} else {

@@ -207,3 +221,3 @@ const value = next.value

}
} else if (token.type === 'variable') {
} else if (token.type === tokenTypes.variable) {
child.dynamic |= 0b01

@@ -226,18 +240,19 @@

if (token.type === 'endtag' && token.value === child.tag) {
if (token.type === tokenTypes.endtag && token.value === child.tag) {
break
} else if (token.type === 'tag') {
} else if (token.type === tokenTypes.tag) {
const dynamic = parse(tokens, child, token.value) ? 0b10 : 0
child.dynamic = child.dynamic | dynamic
} else if (token.type === 'text') {
} else if (token.type === tokenTypes.text) {
child.children.push({
type: 'text',
type: tokenTypes.text,
text: true,
value: token.value
})
} else if (token.type === 'variable') {
} else if (token.type === tokenTypes.variable) {
child.dynamic |= 0b10
child.children.push({
type: 'variable',
type: tokenTypes.variable,
variable: true,

@@ -272,5 +287,5 @@ value: token.value

if (token.type === 'tag') {
if (token.type === tokenTypes.tag) {
parse(tokens, {children}, token.value)
} else if (token.type === 'text' && token.value.trim()) {
} else if (token.type === tokenTypes.text && token.value.trim()) {
throw createAssertionError(token.type, "'node'")

@@ -277,0 +292,0 @@ }

{
"name": "@erickmerchant/framework",
"version": "42.1.0",
"version": "42.2.0",
"description": "A front-end framework.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/erickmerchant/framework#readme",

# @erickmerchant/framework
A very simple framework in a bit more than 2kB minified + gzipped. No build step required to use. Import it from a cdn like skypack or unpkg and get started.
A very simple framework in a bit less than 3kB minified + gzipped. No build step required to use. Import it from a cdn like skypack and get started.

@@ -8,3 +8,7 @@ ## Example

```javascript
import {createApp, createDomView, html} from 'https://unpkg.com/@erickmerchant/framework/main.js'
import {
createApp,
createDomView,
html
} from 'https://cdn.skypack.dev/@erickmerchant/framework?min'

@@ -23,3 +27,5 @@ const app = createApp(0)

const view = createDomView(target, (state) => html`
const view = createDomView(
target,
(state) => html`
<div>

@@ -26,0 +32,0 @@ <output>${state}</output>

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

import {tokenTypes} from './html.js'
const escapeObj = {

@@ -90,3 +92,3 @@ '&': '&amp;',

if (child?.type === 'variable') {
if (child?.type === tokenTypes.variable) {
child = variables[child.value]

@@ -112,7 +114,7 @@ }

switch (child.type) {
case 'text':
case tokenTypes.text:
result += tag !== 'style' ? escape(child.value) : child.value
break
case 'node':
case tokenTypes.node:
result += stringify(

@@ -119,0 +121,0 @@ Object.assign({}, child, {

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