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

@riotjs/util

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@riotjs/util - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

binding-types.js

30

misc.js

@@ -1,2 +0,2 @@

import {createExpression, expressionTypes} from '@riotjs/dom-bindings'
import {ATTRIBUTE, VALUE} from './expression-types'
import {dashToCamelCase} from './strings'

@@ -14,26 +14,2 @@

/**
* Create the bindings to update the component attributes
* @param {HTMLElement} node - node where we will bind the expressions
* @param {Array} attributes - list of attribute bindings
* @returns {TemplateChunk} - template bindings object
*/
export function createAttributeBindings(node, attributes = []) {
const expressions = attributes.map(a => createExpression(node, a))
const binding = {}
const updateValues = method => scope => {
expressions.forEach(e => e[method](scope))
return binding
}
return Object.assign(binding, {
expressions,
mount: updateValues('mount'),
update: updateValues('update'),
unmount: updateValues('unmount')
})
}
/**
* Evaluate a list of attribute expressions

@@ -49,3 +25,3 @@ * @param {Array} attributes - attribute expressions generated by the riot compiler

// spread attribute
case !attribute.name && type === expressionTypes.ATTRIBUTE:
case !attribute.name && type === ATTRIBUTE:
return {

@@ -56,3 +32,3 @@ ...acc,

// value attribute
case type === expressionTypes.VALUE:
case type === VALUE:
acc.value = attribute.value

@@ -59,0 +35,0 @@ break

{
"name": "@riotjs/util",
"version": "1.0.0",
"version": "1.1.0",
"description": "Riot.js util functions",

@@ -16,2 +16,4 @@ "scripts": {

"checks.js",
"expression-types.js",
"binding-types.js",
"misc.js"

@@ -35,3 +37,2 @@ ],

"devDependencies": {
"@riotjs/dom-bindings": "^4.3.0",
"chai": "^4.2.0",

@@ -38,0 +39,0 @@ "eslint": "^6.4.0",

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