New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

uhandlers

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uhandlers - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

12

cjs/index.js
'use strict';
const {isArray} = require('uarray');
// flag for foreign checks (slower path, fast by default)
let useForeign = false;
class Foreign {
constructor(handler, value) {
useForeign = true;
this._ = (...args) => handler(...args, value);

@@ -11,9 +15,3 @@ }

// flag for foreign checks (slower path, fast by default)
let useForeign = false;
const foreign = (handler, value) => {
useForeign = true;
return new Foreign(handler, value);
};
const foreign = (handler, value) => new Foreign(handler, value);
exports.foreign = foreign;

@@ -20,0 +18,0 @@

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

var uhtmlHandlers=function(t){"use strict";const{isArray:e}=Array;class r{constructor(t,e){this._=(...r)=>t(...r,e)}}let n=!1;const o=({dataset:t})=>e=>{for(const r in e){const n=e[r];null==n?delete t[r]:t[r]=n}};return t.Foreign=r,t.aria=t=>e=>{for(const r in e){const n="role"===r?r:`aria-${r}`,o=e[r];null==o?t.removeAttribute(n):t.setAttribute(n,o)}},t.attribute=(t,e)=>{let o,s=!0;const i=document.createAttributeNS(null,e);return u=>{if(o!==u)if(o=u,null==o)s||(t.removeAttributeNode(i),s=!0);else{const o=n&&u instanceof r?u._(t,e):u;null==o?(s||t.removeAttributeNode(i),s=!0):(i.value=o,s&&(t.setAttributeNodeNS(i),s=!1))}}},t.boolean=(t,e,r)=>n=>{r!==!!n&&((r=!!n)?t.setAttribute(e,""):t.removeAttribute(e))},t.data=o,t.event=(t,r)=>{let n,o,s=r.slice(2);return!(r in t)&&(o=r.toLowerCase())in t&&(s=o.slice(2)),r=>{const o=e(r)?r:[r,!1];n!==o[0]&&(n&&t.removeEventListener(s,n,o[1]),(n=o[0])&&t.addEventListener(s,n,o[1]))}},t.foreign=(t,e)=>(n=!0,new r(t,e)),t.ref=t=>{let e;return r=>{e!==r&&(e=r,"function"==typeof r?r(t):r.current=t)}},t.setter=(t,e)=>"dataset"===e?o(t):r=>{t[e]=r},t.text=t=>{let e;return r=>{e!=r&&(e=r,t.textContent=null==r?"":r)}},t}({});
var uhtmlHandlers=function(t){"use strict";const{isArray:e}=Array;let r=!1;class n{constructor(t,e){r=!0,this._=(...r)=>t(...r,e)}}const o=({dataset:t})=>e=>{for(const r in e){const n=e[r];null==n?delete t[r]:t[r]=n}};return t.Foreign=n,t.aria=t=>e=>{for(const r in e){const n="role"===r?r:`aria-${r}`,o=e[r];null==o?t.removeAttribute(n):t.setAttribute(n,o)}},t.attribute=(t,e)=>{let o,s=!0;const i=document.createAttributeNS(null,e);return u=>{if(o!==u)if(o=u,null==o)s||(t.removeAttributeNode(i),s=!0);else{const o=r&&u instanceof n?u._(t,e):u;null==o?(s||t.removeAttributeNode(i),s=!0):(i.value=o,s&&(t.setAttributeNodeNS(i),s=!1))}}},t.boolean=(t,e,r)=>n=>{r!==!!n&&((r=!!n)?t.setAttribute(e,""):t.removeAttribute(e))},t.data=o,t.event=(t,r)=>{let n,o,s=r.slice(2);return!(r in t)&&(o=r.toLowerCase())in t&&(s=o.slice(2)),r=>{const o=e(r)?r:[r,!1];n!==o[0]&&(n&&t.removeEventListener(s,n,o[1]),(n=o[0])&&t.addEventListener(s,n,o[1]))}},t.foreign=(t,e)=>new n(t,e),t.ref=t=>{let e;return r=>{e!==r&&(e=r,"function"==typeof r?r(t):r.current=t)}},t.setter=(t,e)=>"dataset"===e?o(t):r=>{t[e]=r},t.text=t=>{let e;return r=>{e!=r&&(e=r,t.textContent=null==r?"":r)}},t}({});
import {isArray} from 'uarray';
// flag for foreign checks (slower path, fast by default)
let useForeign = false;
export class Foreign {
constructor(handler, value) {
useForeign = true;
this._ = (...args) => handler(...args, value);

@@ -9,10 +13,4 @@ }

// flag for foreign checks (slower path, fast by default)
let useForeign = false;
export const foreign = (handler, value) => new Foreign(handler, value);
export const foreign = (handler, value) => {
useForeign = true;
return new Foreign(handler, value);
};
export const aria = node => values => {

@@ -19,0 +17,0 @@ for (const key in values) {

@@ -12,5 +12,8 @@ var uhtmlHandlers = (function (exports) {

var useForeign = false;
var Foreign = function Foreign(handler, value) {
_classCallCheck(this, Foreign);
useForeign = true;
this._ = function () {

@@ -23,7 +26,4 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {

};
}; // flag for foreign checks (slower path, fast by default)
var useForeign = false;
};
var foreign = function foreign(handler, value) {
useForeign = true;
return new Foreign(handler, value);

@@ -30,0 +30,0 @@ };

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

var uhtmlHandlers=function(t){"use strict";var n=Array.isArray,e=function t(n,e){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this._=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.apply(void 0,r.concat([e]))}},r=!1,i=function(t){var n=t.dataset;return function(t){for(var e in t){var r=t[e];null==r?delete n[e]:n[e]=r}}};return t.Foreign=e,t.aria=function(t){return function(n){for(var e in n){var r="role"===e?e:"aria-".concat(e),i=n[e];null==i?t.removeAttribute(r):t.setAttribute(r,i)}}},t.attribute=function(t,n){var i,u=!0,o=document.createAttributeNS(null,n);return function(a){if(i!==a)if(null==(i=a))u||(t.removeAttributeNode(o),u=!0);else{var c=r&&a instanceof e?a._(t,n):a;null==c?(u||t.removeAttributeNode(o),u=!0):(o.value=c,u&&(t.setAttributeNodeNS(o),u=!1))}}},t.boolean=function(t,n,e){return function(r){e!==!!r&&((e=!!r)?t.setAttribute(n,""):t.removeAttribute(n))}},t.data=i,t.event=function(t,e){var r,i,u=e.slice(2);return!(e in t)&&(i=e.toLowerCase())in t&&(u=i.slice(2)),function(e){var i=n(e)?e:[e,!1];r!==i[0]&&(r&&t.removeEventListener(u,r,i[1]),(r=i[0])&&t.addEventListener(u,r,i[1]))}},t.foreign=function(t,n){return r=!0,new e(t,n)},t.ref=function(t){var n;return function(e){n!==e&&(n=e,"function"==typeof e?e(t):e.current=t)}},t.setter=function(t,n){return"dataset"===n?i(t):function(e){t[n]=e}},t.text=function(t){var n;return function(e){n!=e&&(n=e,t.textContent=null==e?"":e)}},t}({});
var uhtmlHandlers=function(t){"use strict";var n=Array.isArray,e=!1,r=function t(n,r){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),e=!0,this._=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return n.apply(void 0,e.concat([r]))}},i=function(t){var n=t.dataset;return function(t){for(var e in t){var r=t[e];null==r?delete n[e]:n[e]=r}}};return t.Foreign=r,t.aria=function(t){return function(n){for(var e in n){var r="role"===e?e:"aria-".concat(e),i=n[e];null==i?t.removeAttribute(r):t.setAttribute(r,i)}}},t.attribute=function(t,n){var i,u=!0,o=document.createAttributeNS(null,n);return function(a){if(i!==a)if(null==(i=a))u||(t.removeAttributeNode(o),u=!0);else{var c=e&&a instanceof r?a._(t,n):a;null==c?(u||t.removeAttributeNode(o),u=!0):(o.value=c,u&&(t.setAttributeNodeNS(o),u=!1))}}},t.boolean=function(t,n,e){return function(r){e!==!!r&&((e=!!r)?t.setAttribute(n,""):t.removeAttribute(n))}},t.data=i,t.event=function(t,e){var r,i,u=e.slice(2);return!(e in t)&&(i=e.toLowerCase())in t&&(u=i.slice(2)),function(e){var i=n(e)?e:[e,!1];r!==i[0]&&(r&&t.removeEventListener(u,r,i[1]),(r=i[0])&&t.addEventListener(u,r,i[1]))}},t.foreign=function(t,n){return new r(t,n)},t.ref=function(t){var n;return function(e){n!==e&&(n=e,"function"==typeof e?e(t):e.current=t)}},t.setter=function(t,n){return"dataset"===n?i(t):function(e){t[n]=e}},t.text=function(t){var n;return function(e){n!=e&&(n=e,t.textContent=null==e?"":e)}},t}({});
{
"name": "uhandlers",
"version": "0.6.0",
"version": "0.6.1",
"description": "µhtml attributes handlers",

@@ -5,0 +5,0 @@ "main": "./cjs/index.js",

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