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

ink

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ink - npm Package Compare versions

Comparing version 2.0.0-8 to 2.0.0-9

59

build/create-reconciler.js

@@ -14,23 +14,2 @@ "use strict";

const applyProps = (node, props) => {
for (const [key, value] of Object.entries(props)) {
if (key === 'children') {
if (typeof value === 'string' || typeof value === 'number') {
// Text node must be wrapped in another node, so that text can be aligned within container
const textElement = (0, _dom.createNode)('span');
textElement.textContent = value;
(0, _dom.appendChildNode)(node, textElement);
}
} else if (key === 'style') {
Object.assign(node.style, value);
} else if (key === 'unstable__transformChildren') {
node.unstable__transformChildren = value; // eslint-disable-line camelcase
} else if (key === 'static') {
node.static = true;
} else {
(0, _dom.setAttribute)(node, key, value);
}
}
};
var _default = onRender => {

@@ -50,3 +29,22 @@ const rootHostContext = {};

const node = (0, _dom.createNode)(type);
applyProps(node, newProps);
for (const [key, value] of Object.entries(newProps)) {
if (key === 'children') {
if (typeof value === 'string' || typeof value === 'number') {
// Text node must be wrapped in another node, so that text can be aligned within container
const textElement = (0, _dom.createNode)('span');
textElement.textContent = value;
(0, _dom.appendChildNode)(node, textElement);
}
} else if (key === 'style') {
Object.assign(node.style, value);
} else if (key === 'unstable__transformChildren') {
node.unstable__transformChildren = value; // eslint-disable-line camelcase
} else if (key === 'static') {
node.static = true;
} else {
(0, _dom.setAttribute)(node, key, value);
}
}
return node;

@@ -83,3 +81,18 @@ },

commitUpdate: (node, updatePayload, type, oldProps, newProps) => {
applyProps(node, newProps);
for (const [key, value] of Object.entries(newProps)) {
if (key === 'children') {
if (typeof value === 'string' || typeof value === 'number') {
node.childNodes[0].textContent = value;
}
} else if (key === 'style') {
Object.assign(node.style, value);
} else if (key === 'unstable__transformChildren') {
node.unstable__transformChildren = value; // eslint-disable-line camelcase
} else if (key === 'static') {
node.static = true;
} else {
(0, _dom.setAttribute)(node, key, value);
}
}
onRender();

@@ -86,0 +99,0 @@ },

{
"name": "ink",
"version": "2.0.0-8",
"version": "2.0.0-9",
"description": "React for CLI",

@@ -5,0 +5,0 @@ "license": "MIT",

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