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

@jeefo/component

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jeefo/component - npm Package Compare versions

Comparing version 0.0.2 to 0.0.4

27

directives/for_each.js
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
* File Name : for_each.js
* Created at : 2017-07-25
* Updated at : 2019-10-26
* Updated at : 2019-11-02
* Author : jeefo

@@ -24,3 +24,5 @@ * Purpose :

const comp_prop = Symbol("component");
const values_prop = Symbol("values");
const definition = {

@@ -34,2 +36,5 @@ binders : [],

const DOCUMENT_FRAGMENT_NODE = 11;
const is_fragment = element => element.nodeType === DOCUMENT_FRAGMENT_NODE;
async function create_new_child (value, index, component) {

@@ -57,3 +62,3 @@ const { variable_name, index_name } = component;

const values = instance[values_prop];
const component = instance["(component)"];
const component = instance[comp_prop];
const { children } = component;

@@ -114,3 +119,3 @@

async on_init ($element, component) {
this["(component)"] = component;
this[comp_prop] = component;

@@ -140,6 +145,4 @@ try {

const comment = ` For each: ${ component.expression } `;
const comment_node = jqlite(document.createComment(comment));
this["(comment)"] = comment_node;
$element.replace(comment_node);
const comment = ` For each: ${ component.expression } `;
$element.replace(document.createComment(comment));

@@ -153,4 +156,5 @@ await this.on_digest();

async on_digest () {
const component = this["(component)"];
const component = this[comp_prop];
const {
$element : $comment,
children,

@@ -165,6 +169,11 @@ index_name,

if ($comment.DOM_element.parentNode === null) {
const frag = document.createDocumentFragment();
frag.appendChild($comment.DOM_element);
}
children.forEach((child, index) => {
if (! child.is_attached || child.index !== index) {
if (index === 0) {
this["(comment)"].after(child.$element);
$comment.after(child.$element);
} else {

@@ -171,0 +180,0 @@ const prev = component.children[index - 1];

{
"name": "@jeefo/component",
"version": "0.0.2",
"version": "0.0.4",
"homepage": "https://github.com/je3f0o/jeefo_component",

@@ -5,0 +5,0 @@ "copyright": "2019",

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