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

dominic

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dominic - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

7

dominic.js

@@ -309,2 +309,3 @@ (function(root, factory) {

var c = obj()
if (injectOpts) assign3(c, injectOpts)
setChildren(root, c, realRoot, injectOpts)

@@ -316,3 +317,3 @@ }

if (injectOpts) assign3(opts, injectOpts)
setChildren(root, opts, realRoot)
setChildren(root, opts, realRoot, injectOpts)
}

@@ -324,5 +325,5 @@ }

delete obj.tag
if (injectOpts) assign3(opj, injectOpts)
if (injectOpts) assign3(obj, injectOpts)
var el = CreateElement(tag, obj, realRoot)
setChildren(root, el, realRoot)
setChildren(root, el, realRoot, injectOpts)
}

@@ -329,0 +330,0 @@ else if (obj.hasOwnProperty('for')) {

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

!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.CreateElement=t()}(this,function(){var e=[],t={},r=function(e){return e instanceof Node},n=function(e){var t=typeof e;return"object"===t||"function"===t},o=function(e){var t=typeof e;return"string"===t||"number"===t},a=function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},i=function(e){e=e||{};for(var t=1;t<arguments.length;t++)for(var r=arguments[t],n=Object.keys(arguments[t]),o=0;o<n.length;o++)e[n[o]]=r[n[o]];return e},f=function(e){if(e=e||{},arguments.length<2)return e;var t=arguments[arguments.length-1];if("string"!=typeof t)return e;var r=t.split(",");if(!r.length)return e;for(var n=1;n<arguments.length-1;n++)for(var o=arguments[n],a=Object.keys(arguments[n]),i=0;i<a.length;i++){var f=a[i];if(-1!==r.indexOf(f)){var u=o[f];e[f]=u}}return e},u=function(e){e=e||{};for(var t=1;t<arguments.length;t++)for(var r=arguments[t],n=Object.keys(arguments[t]),o=0;o<n.length;o++){var a=n[o];if(Array.isArray(e))for(k=0;k<e.length;k++)e[k].hasOwnProperty(a)||(e[k][a]=r[a]);else e.hasOwnProperty(a)||(e[a]=r[a])}return e},l=function(t){var r=t.id?"#"+t.id:"",n=t.classList.toString(),o=n?n.split(" "):e,a=t.localName+r+(o.length?"."+o.join("."):"");return a},s=function(e,t,r){for(;t!==e;){if(t.matches(r))return t;t=t.parentNode}return null},c=function(e,t,r){t=t||{};var n=t.el||document.documentElement,o=t.callback,a=t.capture||!1,i=t.delegate,f=function(e){if("string"==typeof i){if(n===e.target)return;var t=s(n,e.target,i);if(!t)return;"function"==typeof o&&o.call(t,e)}else"function"==typeof o&&o.call(r,e)};return f.destroy=function(){return this.el=null,n.removeEventListener(e,f,a)},f.el=n,f.type=e,f.capture=a,n.addEventListener(e,f,a),f},p=Object.defineProperties,v=Object.defineProperty,h=function(){var e=function(){Array.call(this)};return e.prototype=Object.create(Array.prototype),p(e.prototype,{remove:{value:function(e){if("function"!=typeof e)return!1;for(var t=[],r=0,n=0;n<this.length;n++)e.call(null,this[n])&&t.push(this[n]);for(var o=0;o<t.length;o++){var a=t[o];a.destroy(),this.splice(this.indexOf(a),1),r++}return r==t.length}},removeEvent:{value:function(e,t,r){var n=this,o=[];return this.forEach(function(n){"*"!==e&&n.type!==e||"*"!==t&&n.el!==t||r&&n.capture!==r||o.push(n)}),o.forEach(function(e){e.destroy(),n.splice(n.indexOf(e),1)}),o.length}},removeAll:{value:function(){for(var e=0;e<this.length;e++)this[e].destroy();this.length=0}}}),e}(),d=function(){var e=function(){};return e.prototype=Object.create(Object.prototype),p(e.prototype,{remove:{value:function(e){if("function"!=typeof e)return!1;for(var t=Object.keys(this),r=0,n=0;n<t.length;n++){var o=t[n];e.call(null,this[o],o)&&(r+=delete this[o]?1:0)}return r==t.length}},removeRef:{value:function(e){return this.hasOwnProperty(e)?delete this[e]:!1}},removeAll:{value:function(){for(var e=Object.keys(this),t=0;t<e.length;t++)delete this[e[t]];return t===e.length}}}),e}(),y=function(){var e=function(e){if("undefined"==typeof e)throw new Error("No root provided");this.__owner=e};return e.prototype=Object.create(Object.prototype),p(e.prototype,{add:{value:function(e,t){var r=t.update?t.update.observeProp:"";if(!r||"__owner"===r||!o(r))return!1;var n=f({},t,{appendTo:e,obsProp:r},"tplFn,for,root,appendTo,obsProp,update");v(this,r,{set:function(t){for(n["for"]=t;e.firstChild;){var r=e.removeChild(e.firstChild);this.__owner.evts.remove(function(e){return r.contains(e.el)}),this.__owner.refs.remove(function(e,t){return r===e||r.contains(e)})}var o=m(e,n,this.__owner);w(e,o,this.__owner)}})}}}),e}(),g=function(e,t,r){var n=t.ref;if(o(n)){var a=t.refScope,i="parent"===a?e:r;i.refs=i.refs||new d,i.refs[n]=t}},m=function(e,t,r){var n,o=t["for"],a=t.root||"",i=a?o[a]:o,f=t.tplFn;if(i&&"function"==typeof f){var u=t.scope,l="root"===u?r:"parent"===u?e:u;n=Array.isArray(i)?i.map(f,l):f.call(l,i)}return n},b=function(e,t,r){r.observe=r.observe||new y(r),r.observe.add(e,t)},w=function(e,t,o,a){"use strict";if(n(t))if(r(t))e.appendChild(t),g(e,t,o);else if("function"==typeof t){var i=t();w(e,i,o,a)}else if(Array.isArray(t))for(var f=0;f<t.length;f++){var l=t[f];a&&u(l,a),w(e,l,o)}else{var s=t.tag;if(s){delete t.tag,a&&u(opj,a);var c=Q(s,t,o);w(e,c,o)}else if(t.hasOwnProperty("for")){if(!n(t["for"]))return;var p=m(e,t,o);w(e,p,o,a),n(t.update)&&b(e,t,o)}else{var v=t.fn;if("function"==typeof v){var h=t.scope,d="root"===h?o:"parent"===h?e:h,y=v.call(d);w(e,y,o,a)}}}},O=function(e,t,r){var n=t.type;if(!n)throw new Error("No event type specified");var o,a=t.handler,i=typeof a;r=r||e;var f="root"===t.scope?r:t.scope?t.scope:e;if("function"===i?o=a:"string"===i&&(o=f[a]),"function"!=typeof o)throw new Error('Cannot find handler: "'+a+'" on element: ['+l(f)+"].");var u=t.capture,s=t.delegate,p=c(n,{el:e,callback:o,capture:u,delegate:s},f);r.evts=r.evts||new h,r.evts.push(p)},j=function(e,t,r){if(Array.isArray(t))for(var n=0;n<t.length;n++)O(e,t[n],r);else O(e,t,r)},A=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;n++){var o=r[n],i=t[o];e.setAttribute(a(o),i)}},x=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;n++){var o=r[n],a=t[o];e.style[o]=isNaN(a)?a:a+"px"}},_={setevents:j,setattrs:A,setstyle:x,setchildren:w,setitems:w},C=function(e,t){for(var r=Object.keys(t),n=r.length,o=0;n>o;o++){var a=r[o],i=t[a];e[a]=(e[a]+i).trim()}},E=function(e,t,r,n){for(var o=0,a=t.length;a>o;o++){var i=t[o];_["set"+i.key](e,i.val,r,n)}},N=function(e,t,r){for(var n=0,o=t.length;o>n;n++){var a=t[n],f=i({},{type:a.key},a.val);O(e,f,r)}},P=function(e){var t;return t="function"==typeof e?e():e,Boolean(t)},L=["width","height","maxWidth","maxHeight","padding","margin"],T=["color","backgroundColor","background","display","position","opacity"],F=["defaults"],S=["style","children","items","attrs","events"],$=["click","mousedown","mouseup","mouseover","mouseout","mouseenter","mouseleave","dragstart","dragend","drag","dragover","dragenter","dragout","drop","blur","focus","keydown","keypress","keyup","change","input","submit","touchstart","touchmove","touchend","wheel","scroll"],z=["created","appended"],B=["className","id"],H=["text","textContent"],R=["parent"],W=L.concat(T,F,S,$,z,B,H,R),Z=L.length,q=Z+T.length,D=q+F.length,G=D+S.length,I=G+$.length,J=I+z.length,K=J+B.length,M=K+H.length,Q=function(e,n,o,a){n=n||t;var f=document.createElement(e);o=o||f;var u,l,s,c,p,v,h=Object.keys(n);if(n.hasOwnProperty("if")&&!P(n["if"]))return null;for(var d=0,y=h.length;y>d;d++){var g=h[d],m=n[g],b=W.indexOf(g);-1==b?f[g]=m:Z>b?f.style[g]=isNaN(m)?m:m+"px":q>b?f.style[g]=m:D>b?i(v=v||{},m):G>b?(u=u||[]).push({key:g,val:m}):I>b?(l=l||[]).push({key:g,val:m}):J>b?(s=s||{})[g]=m:K>b?(c=c||{})[g]=m:M>b?f.appendChild(document.createTextNode(m)):p=m}return c&&C(f,c),u&&E(f,u,o,v),l&&N(f,l,o),s&&"function"==typeof s.created&&s.created.call(f),p&&r(p)&&f===o&&(p.appendChild(f),s&&"function"==typeof s.appended&&s.appended.call(f,p)),f},U=function(e,t){return Q(e,t)};return U});
!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.CreateElement=t()}(this,function(){var e=[],t={},r=function(e){return e instanceof Node},n=function(e){var t=typeof e;return"object"===t||"function"===t},o=function(e){var t=typeof e;return"string"===t||"number"===t},a=function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},i=function(e){e=e||{};for(var t=1;t<arguments.length;t++)for(var r=arguments[t],n=Object.keys(arguments[t]),o=0;o<n.length;o++)e[n[o]]=r[n[o]];return e},f=function(e){if(e=e||{},arguments.length<2)return e;var t=arguments[arguments.length-1];if("string"!=typeof t)return e;var r=t.split(",");if(!r.length)return e;for(var n=1;n<arguments.length-1;n++)for(var o=arguments[n],a=Object.keys(arguments[n]),i=0;i<a.length;i++){var f=a[i];if(-1!==r.indexOf(f)){var u=o[f];e[f]=u}}return e},u=function(e){e=e||{};for(var t=1;t<arguments.length;t++)for(var r=arguments[t],n=Object.keys(arguments[t]),o=0;o<n.length;o++){var a=n[o];if(Array.isArray(e))for(k=0;k<e.length;k++)e[k].hasOwnProperty(a)||(e[k][a]=r[a]);else e.hasOwnProperty(a)||(e[a]=r[a])}return e},l=function(t){var r=t.id?"#"+t.id:"",n=t.classList.toString(),o=n?n.split(" "):e,a=t.localName+r+(o.length?"."+o.join("."):"");return a},s=function(e,t,r){for(;t!==e;){if(t.matches(r))return t;t=t.parentNode}return null},c=function(e,t,r){t=t||{};var n=t.el||document.documentElement,o=t.callback,a=t.capture||!1,i=t.delegate,f=function(e){if("string"==typeof i){if(n===e.target)return;var t=s(n,e.target,i);if(!t)return;"function"==typeof o&&o.call(t,e)}else"function"==typeof o&&o.call(r,e)};return f.destroy=function(){return this.el=null,n.removeEventListener(e,f,a)},f.el=n,f.type=e,f.capture=a,n.addEventListener(e,f,a),f},p=Object.defineProperties,v=Object.defineProperty,h=function(){var e=function(){Array.call(this)};return e.prototype=Object.create(Array.prototype),p(e.prototype,{remove:{value:function(e){if("function"!=typeof e)return!1;for(var t=[],r=0,n=0;n<this.length;n++)e.call(null,this[n])&&t.push(this[n]);for(var o=0;o<t.length;o++){var a=t[o];a.destroy(),this.splice(this.indexOf(a),1),r++}return r==t.length}},removeEvent:{value:function(e,t,r){var n=this,o=[];return this.forEach(function(n){"*"!==e&&n.type!==e||"*"!==t&&n.el!==t||r&&n.capture!==r||o.push(n)}),o.forEach(function(e){e.destroy(),n.splice(n.indexOf(e),1)}),o.length}},removeAll:{value:function(){for(var e=0;e<this.length;e++)this[e].destroy();this.length=0}}}),e}(),d=function(){var e=function(){};return e.prototype=Object.create(Object.prototype),p(e.prototype,{remove:{value:function(e){if("function"!=typeof e)return!1;for(var t=Object.keys(this),r=0,n=0;n<t.length;n++){var o=t[n];e.call(null,this[o],o)&&(r+=delete this[o]?1:0)}return r==t.length}},removeRef:{value:function(e){return this.hasOwnProperty(e)?delete this[e]:!1}},removeAll:{value:function(){for(var e=Object.keys(this),t=0;t<e.length;t++)delete this[e[t]];return t===e.length}}}),e}(),y=function(){var e=function(e){if("undefined"==typeof e)throw new Error("No root provided");this.__owner=e};return e.prototype=Object.create(Object.prototype),p(e.prototype,{add:{value:function(e,t){var r=t.update?t.update.observeProp:"";if(!r||"__owner"===r||!o(r))return!1;var n=f({},t,{appendTo:e,obsProp:r},"tplFn,for,root,appendTo,obsProp,update");v(this,r,{set:function(t){for(n["for"]=t;e.firstChild;){var r=e.removeChild(e.firstChild);this.__owner.evts.remove(function(e){return r.contains(e.el)}),this.__owner.refs.remove(function(e,t){return r===e||r.contains(e)})}var o=m(e,n,this.__owner);w(e,o,this.__owner)}})}}}),e}(),g=function(e,t,r){var n=t.ref;if(o(n)){var a=t.refScope,i="parent"===a?e:r;i.refs=i.refs||new d,i.refs[n]=t}},m=function(e,t,r){var n,o=t["for"],a=t.root||"",i=a?o[a]:o,f=t.tplFn;if(i&&"function"==typeof f){var u=t.scope,l="root"===u?r:"parent"===u?e:u;n=Array.isArray(i)?i.map(f,l):f.call(l,i)}return n},b=function(e,t,r){r.observe=r.observe||new y(r),r.observe.add(e,t)},w=function(e,t,o,a){"use strict";if(n(t))if(r(t))e.appendChild(t),g(e,t,o);else if("function"==typeof t){var i=t();a&&u(i,a),w(e,i,o,a)}else if(Array.isArray(t))for(var f=0;f<t.length;f++){var l=t[f];a&&u(l,a),w(e,l,o,a)}else{var s=t.tag;if(s){delete t.tag,a&&u(t,a);var c=Q(s,t,o);w(e,c,o,a)}else if(t.hasOwnProperty("for")){if(!n(t["for"]))return;var p=m(e,t,o);w(e,p,o,a),n(t.update)&&b(e,t,o)}else{var v=t.fn;if("function"==typeof v){var h=t.scope,d="root"===h?o:"parent"===h?e:h,y=v.call(d);w(e,y,o,a)}}}},O=function(e,t,r){var n=t.type;if(!n)throw new Error("No event type specified");var o,a=t.handler,i=typeof a;r=r||e;var f="root"===t.scope?r:t.scope?t.scope:e;if("function"===i?o=a:"string"===i&&(o=f[a]),"function"!=typeof o)throw new Error('Cannot find handler: "'+a+'" on element: ['+l(f)+"].");var u=t.capture,s=t.delegate,p=c(n,{el:e,callback:o,capture:u,delegate:s},f);r.evts=r.evts||new h,r.evts.push(p)},j=function(e,t,r){if(Array.isArray(t))for(var n=0;n<t.length;n++)O(e,t[n],r);else O(e,t,r)},A=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;n++){var o=r[n],i=t[o];e.setAttribute(a(o),i)}},x=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;n++){var o=r[n],a=t[o];e.style[o]=isNaN(a)?a:a+"px"}},_={setevents:j,setattrs:A,setstyle:x,setchildren:w,setitems:w},C=function(e,t){for(var r=Object.keys(t),n=r.length,o=0;n>o;o++){var a=r[o],i=t[a];e[a]=(e[a]+i).trim()}},E=function(e,t,r,n){for(var o=0,a=t.length;a>o;o++){var i=t[o];_["set"+i.key](e,i.val,r,n)}},N=function(e,t,r){for(var n=0,o=t.length;o>n;n++){var a=t[n],f=i({},{type:a.key},a.val);O(e,f,r)}},P=function(e){var t;return t="function"==typeof e?e():e,Boolean(t)},L=["width","height","maxWidth","maxHeight","padding","margin"],T=["color","backgroundColor","background","display","position","opacity"],F=["defaults"],S=["style","children","items","attrs","events"],$=["click","mousedown","mouseup","mouseover","mouseout","mouseenter","mouseleave","dragstart","dragend","drag","dragover","dragenter","dragout","drop","blur","focus","keydown","keypress","keyup","change","input","submit","touchstart","touchmove","touchend","wheel","scroll"],z=["created","appended"],B=["className","id"],H=["text","textContent"],R=["parent"],W=L.concat(T,F,S,$,z,B,H,R),Z=L.length,q=Z+T.length,D=q+F.length,G=D+S.length,I=G+$.length,J=I+z.length,K=J+B.length,M=K+H.length,Q=function(e,n,o,a){n=n||t;var f=document.createElement(e);o=o||f;var u,l,s,c,p,v,h=Object.keys(n);if(n.hasOwnProperty("if")&&!P(n["if"]))return null;for(var d=0,y=h.length;y>d;d++){var g=h[d],m=n[g],b=W.indexOf(g);-1==b?f[g]=m:Z>b?f.style[g]=isNaN(m)?m:m+"px":q>b?f.style[g]=m:D>b?i(v=v||{},m):G>b?(u=u||[]).push({key:g,val:m}):I>b?(l=l||[]).push({key:g,val:m}):J>b?(s=s||{})[g]=m:K>b?(c=c||{})[g]=m:M>b?f.appendChild(document.createTextNode(m)):p=m}return c&&C(f,c),u&&E(f,u,o,v),l&&N(f,l,o),s&&"function"==typeof s.created&&s.created.call(f),p&&r(p)&&f===o&&(p.appendChild(f),s&&"function"==typeof s.appended&&s.appended.call(f,p)),f},U=function(e,t){return Q(e,t)};return U});
{
"name": "dominic",
"version": "0.1.7",
"version": "0.1.8",
"description": "Helper to quickly build up simple DOM in simple javascript object format.",

@@ -5,0 +5,0 @@ "main": "dominic.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