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

bkb

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bkb - npm Package Compare versions

Comparing version 0.20.1 to 0.20.2

2

bkb.min.js

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

function call(t,e){t.thisArg?t.cb.call(t.thisArg,e.data,e):t.cb(e.data,e)}class Emitter{constructor(t,e){this.log=t,this.eventNames=new Set,this.strictEvents=!1,this.destroyed=!1,e&&this.exposeEvent(e,!1)}exposeEvent(t,e){if(this.destroyed)throw new Error("Cannot call exposeEvent in a destroyed transmitter");for(let e of t)this.eventNames.add(e);e&&(this.strictEvents=!0)}emit(t){if(this.destroyed||!this.listeners)return;if(this.strictEvents&&!this.eventNames.has(t.eventName))throw new Error(`Unexposed event: ${t.eventName}`);let e=this.listeners.get(t.eventName);if(e)for(let n of e)try{call(n,t)}catch(t){this.log.errorHandler(t)}}on(t,e,n){if(!this.destroyed){this.listeners||(this.listeners=new Map);for(let i of t){let t=this.listeners.get(i);t||this.listeners.set(i,t=[]),t.push({cb:e,thisArg:n})}}}off(t,e,n){if(!this.destroyed&&this.listeners)for(let[i,r]of this.listeners)if(!t||t.has(i))for(let t=0;t<r.length;++t){let i=r[t];i.cb===e&&i.thisArg===n&&(r.splice(t,1),--t)}}destroy(){this.listeners=void 0,this.destroyed=!0}}class Subscriber{listenTo(t,e,n,i=null){t.on(e,n,i),this.map||(this.map=new Map);let r=this.map.get(n);r||this.map.set(n,r=new Map);let s=r.get(i);s||r.set(i,s=new Map);let o=s.get(t);o||s.set(t,o=new Set);for(let t of e)o.add(t)}stopListeningEverywhere(t,e=null){if(!this.map)return;let n=this.map.get(t);if(!n)return;let i=n.get(e);if(i){for(let[n,r]of i)n.off(r,t,e);n.delete(e),0===n.size&&this.map.delete(t)}}stopListening(t,e,n,i=null){if(!this.map)return;let r=this.map.get(n);if(!r)return;let s=r.get(i);if(!s)return;let o=s.get(t);if(!o)return;let a=new Set;for(let t of e)o.delete(t)&&a.add(t);t.off(a,n,i),0===o.size&&(s.delete(t),0===s.size&&(r.delete(i),0===r.size&&this.map.delete(n)))}destroy(){if(this.map){for(let[t,e]of this.map)for(let[n,i]of e)for(let[e,r]of i)e.off(r,t,n);this.map=void 0}}}class Container{constructor(t,e){this.app=t,this.componentId=e,this.subscriber=new Subscriber,this.emitter=new Emitter(t,["destroy"]),this.pub=makePublicDash(this),this.dash=makeDash(this,this.pub)}makeInstance(t,e){return this.inst?this.inst:this.setInstance(new t(this.dash,...e))}setInstance(t){if(console.log("[setInstance]",t,this.inst),this.inst)return this.inst;if(!this.pub)throw new Error("Destroyed component");return this.inst=t,this.app.setInstanceOf(this.componentId,this.inst),t}getInstance(){if(!this.inst){if(this.pub)throw new Error("The component instance is still not initialized");throw new Error("Destroyed component")}return this.inst}destroy(){this.emit("destroy",void 0,{sync:!0}),this.app.removeComponent(this,this.inst),this.childGroups&&this.childGroups.clear(),this.emitter.destroy(),this.subscriber.destroy(),this.pub=void 0,this.dash=void 0,this.inst=void 0}forgetChild(t){if(this.childGroups)for(let e of this.childGroups.values())e.delete(t)}createChild(t){return this.app.createComponent(t,this)}addToGroup(t,e){let n=this.app.getContainerByInst(t).componentId;if(this!==this.app.getParentOf(n))throw new Error(`The component ${n} is not a child of ${this.componentId}`);this.childGroups||(this.childGroups=new Map);for(let t of e){let e=this.childGroups.get(t);e||this.childGroups.set(t,e=new Set),e.add(n)}}inGroup(t,e){if(!this.childGroups)return!1;let n=this.app.getContainerByInst(t).componentId;for(let t of e){let e=this.childGroups.get(t);if(e&&e.has(n))return!0}return!1}broadcast(t,e){e&&e.sync?this.emitter.emit(t):this.app.asyncCall(()=>this.emitter.emit(t))}emit(t,e,n){n&&n.sync?this.emitSync(this.createEvent(t,e)):this.app.asyncCall(()=>this.emitSync(this.createEvent(t,e)))}createEvent(t,e){let n=this,i=!0;return Object.freeze({eventName:t,get source(){return n.getInstance()},data:e,stopPropagation:()=>{i=!1},[Container.canPropagateSymb]:()=>i})}emitSync(t){this.emitter.emit(t);let e=this.app.getParentOf(this.componentId);e&&e.bubbleUpEvent(t)}bubbleUpEvent(t){if(t[Container.canPropagateSymb]&&!t[Container.canPropagateSymb]())return;this.emitter.emit(t);let e=this.app.getParentOf(this.componentId);e&&e.bubbleUpEvent(t)}getParent(t){let e=this;for(;e=this.app.getParentOf(e.componentId);)if(!t||t(e))return e}getParents(t){let e=this,n=[];for(;e=this.app.getParentOf(e.componentId);)t&&!t(e)||n.push(e);return n}getChildren(t){let e=this.getChildContainers(t.group),n=[];for(let i of e)!i.inst||t.filter&&!t.filter(i)||n.push(i.getInstance());return n}getChild(t){let e=this.getChildren(t);if(1!==e.length)throw new Error(`Cannot find single ${JSON.stringify(t)} in component ${this.componentId}`);return e[0]}countChildren(t){return this.getChildren(t).length}hasChildren(t){return this.countChildren(t)>0}isChild(t){let e=this.app.getContainerByInst(t).componentId;return this===this.app.getParentOf(e)}destroyChildren(t){let e=this.getChildContainers(t.group);for(let n of e)t.filter&&!t.filter(n)||n.destroy()}getChildContainers(t){if(!t)return this.app.getChildrenOf(this.componentId);if(!this.childGroups)return[];let e="string"==typeof t?[t]:t,n=new Set;for(let t of e){let e=this.childGroups.get(t);if(e)for(let t of e.values())n.add(t)}let i=[];for(let t of n.values())i.push(this.app.getContainer(t));return i}}function makePublicDash(t){let e=Object.freeze({unattendedEvents:Object.freeze({on:(e,n,i)=>{t.emitter.on(arr(e),n,i)},off:(e,n,i)=>{t.emitter.off(new Set(arr(e)),n,i)}}),get instance(){return t.getInstance()},get parent(){return e.getParent()},getParent:function(e){let n=t.getParent(e);return n?n.getInstance():void 0},getParents:e=>t.getParents(e).map(t=>t.getInstance()),destroy:()=>t.destroy(),children:(e={})=>t.getChildren(e),getChild:(e={})=>t.getChild(e),countChildren:(e={})=>t.countChildren(e),hasChildren:(e={})=>t.hasChildren(e),isChild:e=>t.isChild(e),isComponent:e=>t.app.isComponent(e),getPublicDashOf:e=>t.app.getContainerByInst(e).pub,log:t.app.log});return e}function makeDash(t,e){let n={setInstance:e=>(t.setInstance(e),i),exposeEvent:function(...e){return t.emitter.exposeEvent(flatten(e),!0),i},create:(e,...n)=>t.createChild({asObj:!1,Class:e,args:n}).getInstance(),toComponent:e=>t.createChild({asObj:!0,obj:e}).dash,addToGroup:(e,...n)=>(t.addToGroup(e,flatten(n)),i),inGroup:(e,...n)=>t.inGroup(e,flatten(n)),emit:function(e,n,r){let s=Array.isArray(e)?e:[e];for(let e of s)t.emit(e,n,r);return i},broadcast:function(e,n){return t.broadcast(e,n),i},listenTo:(...e)=>{let n,r,s,o;if(2===e.length||"string"==typeof e[0]||Array.isArray(e[0]))[r,s,o]=e,n=t;else{let i;[i,r,s,o]=e,n=t.app.getContainerByInst(i)}return t.subscriber.listenTo(n.emitter,arr(r),s,o),i},stopListening:(...e)=>{let n,r,s,o,a=e.length;if("string"==typeof e[0]||Array.isArray(e[0]))[r,s,o]=e,n=t;else{if(1===a||2===a)return[s,o]=e,void t.subscriber.stopListeningEverywhere(s,o);{let i;[i,r,s,o]=e,n=t.app.getContainerByInst(i)}}return t.subscriber.stopListening(n.emitter,arr(r),s,o),i},destroyChildren:(e={})=>(t.destroyChildren(e),i),publicDash:e},i=Object.assign(Object.create(e),n);return t.app.root&&t.app.root!==t?(Object.defineProperties(i,{app:{get:()=>t.app.root.getInstance()}}),Object.assign(i,...t.app.augmentList.map(t=>t(i)))):i.registerDashAugmentation=(e=>{t.app.augmentList.push(e)}),Object.freeze(i),i}function arr(t){return"string"==typeof t?[t]:t}function flatten(t){return 1===t.length&&Array.isArray(t[0])?t[0]:t}Container.canPropagateSymb=Symbol("canPropagate");class ApplicationContainer{constructor(t,e,n){this.compCount=0,this.nodesByInst=new WeakMap,this.nodes=new Map,this.insideRmComp=!1,this.augmentList=[];let i=["error","warn","info","debug","trace"],r=this.newId();this.log=this.createLog(i),this.root=new Container(this,r);let s={container:this.root};this.nodes.set(r,s),this.root.emitter.exposeEvent(["log",...i,"addComponent","removeComponent","changeComponent"],!1),e?this.root.setInstance(t):this.root.makeInstance(t,n||[])}setInstanceOf(t,e){let n=this.nodes.get(t);if(!n)throw new Error("Destroyed component");this.nodesByInst.set(e,n)}getParentOf(t){let e=this.findNode(t);return e.parent?e.parent.container:void 0}getChildrenOf(t){let e=[],n=this.findNode(t).children;if(n)for(let t of Array.from(n.values()))e.push(t.container);return e}getContainer(t){return this.findNode(t).container}getContainerByInst(t){return this.findNodeByInst(t).container}isComponent(t){return!!this.nodesByInst.get(t)}createComponent(t,e){if(!this.root.dash)throw new Error("Destroyed root component");let n,i=this.newId(),r=new Container(this,i),s=this.findNode(e.componentId),o={container:r,parent:s};return this.nodes.set(i,o),s.children||(s.children=new Map),s.children.set(i,o),n=t.asObj?r.setInstance(t.obj):r.makeInstance(t.Class,t.args),this.root.dash.emit("addComponent",{component:r.getInstance()}),this.root.dash.emit("changeComponent",{component:r.getInstance(),type:"add"}),r}removeComponent(t,e){if(!this.root.dash)throw new Error("Destroyed root component");let n=!this.insideRmComp;try{n&&(this.insideRmComp=!0,this.root.dash.emit("removeComponent",{component:t.getInstance()},{sync:!0}),this.root.dash.emit("changeComponent",{component:t.getInstance(),type:"remove"},{sync:!0}));let i=t.componentId,r=this.findNode(i);if(r.children){for(let t of Array.from(r.children.values()))t.parent=void 0,t.container.destroy();r.children.clear()}r.parent&&(r.parent.container.forgetChild(i),r.parent.children.delete(i)),this.nodes.delete(i),e&&this.nodesByInst.delete(e)}finally{n&&(this.insideRmComp=!1)}}errorHandler(t){if(!this.root.dash)throw new Error("Destroyed root component");this.root.dash.emit("log",{type:"error",messages:[t]},{sync:!0})}asyncCall(t){this.tickList?this.tickList.push(t):(this.tickList=[t],setTimeout(()=>{if(this.tickList){for(let t of this.tickList)try{t()}catch(t){this.errorHandler(t)}this.tickList=void 0}},0))}findNode(t){let e=this.nodes.get(t);if(!e)throw new Error(`Missing node of component "${t}"`);return e}findNodeByInst(t){let e=this.nodesByInst.get(t);if(!e)throw new Error(`Cannot find a component for the instance: ${t}`);return e}newId(){return this.compCount++}createLog(t){let e={};for(let n of t)e[n]=((...t)=>{if(!this.root.dash)throw new Error("Destroyed root component");this.root.dash.emit("log",{type:n,messages:t},{sync:!0})});return Object.freeze(e)}}function createApplication(t,...e){return new ApplicationContainer(t,!1,e).root.getInstance()}function asApplication(t){return new ApplicationContainer(t,!0).root.dash}export{createApplication,asApplication};
function call(t,e){t.thisArg?t.cb.call(t.thisArg,e.data,e):t.cb(e.data,e)}class Emitter{constructor(t,e){this.log=t,this.eventNames=new Set,this.strictEvents=!1,this.destroyed=!1,e&&this.exposeEvent(e,!1)}exposeEvent(t,e){if(this.destroyed)throw new Error("Cannot call exposeEvent in a destroyed transmitter");for(let e of t)this.eventNames.add(e);e&&(this.strictEvents=!0)}emit(t){if(this.destroyed||!this.listeners)return;if(this.strictEvents&&!this.eventNames.has(t.eventName))throw new Error(`Unexposed event: ${t.eventName}`);let e=this.listeners.get(t.eventName);if(e)for(let n of e)try{call(n,t)}catch(t){this.log.errorHandler(t)}}on(t,e,n){if(!this.destroyed){this.listeners||(this.listeners=new Map);for(let i of t){let t=this.listeners.get(i);t||this.listeners.set(i,t=[]),t.push({cb:e,thisArg:n})}}}off(t,e,n){if(!this.destroyed&&this.listeners)for(let[i,r]of this.listeners)if(!t||t.has(i))for(let t=0;t<r.length;++t){let i=r[t];i.cb===e&&i.thisArg===n&&(r.splice(t,1),--t)}}destroy(){this.listeners=void 0,this.destroyed=!0}}class Subscriber{listenTo(t,e,n,i=null){t.on(e,n,i),this.map||(this.map=new Map);let r=this.map.get(n);r||this.map.set(n,r=new Map);let s=r.get(i);s||r.set(i,s=new Map);let o=s.get(t);o||s.set(t,o=new Set);for(let t of e)o.add(t)}stopListeningEverywhere(t,e=null){if(!this.map)return;let n=this.map.get(t);if(!n)return;let i=n.get(e);if(i){for(let[n,r]of i)n.off(r,t,e);n.delete(e),0===n.size&&this.map.delete(t)}}stopListening(t,e,n,i=null){if(!this.map)return;let r=this.map.get(n);if(!r)return;let s=r.get(i);if(!s)return;let o=s.get(t);if(!o)return;let a=new Set;for(let t of e)o.delete(t)&&a.add(t);t.off(a,n,i),0===o.size&&(s.delete(t),0===s.size&&(r.delete(i),0===r.size&&this.map.delete(n)))}destroy(){if(this.map){for(let[t,e]of this.map)for(let[n,i]of e)for(let[e,r]of i)e.off(r,t,n);this.map=void 0}}}class Container{constructor(t,e){this.app=t,this.componentId=e,this.subscriber=new Subscriber,this.emitter=new Emitter(t,["destroy"]),this.pub=makePublicDash(this),this.dash=makeDash(this,this.pub)}makeInstance(t,e){return this.inst?this.inst:(this.setInstance(new t(this.dash,...e)),this.inst)}setInstance(t){if(this.inst)return this.inst;if(!this.pub)throw new Error("Destroyed component");this.inst=t,this.app.setInstanceOf(this.componentId,this.inst)}getInstance(){if(!this.inst){if(this.pub)throw new Error("The component instance is still not initialized");throw new Error("Destroyed component")}return this.inst}destroy(){this.emit("destroy",void 0,{sync:!0}),this.app.removeComponent(this,this.inst),this.childGroups&&this.childGroups.clear(),this.emitter.destroy(),this.subscriber.destroy(),this.pub=void 0,this.dash=void 0,this.inst=void 0}forgetChild(t){if(this.childGroups)for(let e of this.childGroups.values())e.delete(t)}createChild(t){return this.app.createComponent(t,this)}addToGroup(t,e){let n=this.app.getContainerByInst(t).componentId;if(this!==this.app.getParentOf(n))throw new Error(`The component ${n} is not a child of ${this.componentId}`);this.childGroups||(this.childGroups=new Map);for(let t of e){let e=this.childGroups.get(t);e||this.childGroups.set(t,e=new Set),e.add(n)}}inGroup(t,e){if(!this.childGroups)return!1;let n=this.app.getContainerByInst(t).componentId;for(let t of e){let e=this.childGroups.get(t);if(e&&e.has(n))return!0}return!1}broadcast(t,e){e&&e.sync?this.emitter.emit(t):this.app.asyncCall(()=>this.emitter.emit(t))}emit(t,e,n){n&&n.sync?this.emitSync(this.createEvent(t,e)):this.app.asyncCall(()=>this.emitSync(this.createEvent(t,e)))}createEvent(t,e){let n=this,i=!0;return Object.freeze({eventName:t,get source(){return n.getInstance()},data:e,stopPropagation:()=>{i=!1},[Container.canPropagateSymb]:()=>i})}emitSync(t){this.emitter.emit(t);let e=this.app.getParentOf(this.componentId);e&&e.bubbleUpEvent(t)}bubbleUpEvent(t){if(t[Container.canPropagateSymb]&&!t[Container.canPropagateSymb]())return;this.emitter.emit(t);let e=this.app.getParentOf(this.componentId);e&&e.bubbleUpEvent(t)}getParent(t){let e=this;for(;e=this.app.getParentOf(e.componentId);)if(!t||t(e))return e}getParents(t){let e=this,n=[];for(;e=this.app.getParentOf(e.componentId);)t&&!t(e)||n.push(e);return n}getChildren(t){let e=this.getChildContainers(t.group),n=[];for(let i of e)!i.inst||t.filter&&!t.filter(i)||n.push(i.getInstance());return n}getChild(t){let e=this.getChildren(t);if(1!==e.length)throw new Error(`Cannot find single ${JSON.stringify(t)} in component ${this.componentId}`);return e[0]}countChildren(t){return this.getChildren(t).length}hasChildren(t){return this.countChildren(t)>0}isChild(t){let e=this.app.getContainerByInst(t).componentId;return this===this.app.getParentOf(e)}destroyChildren(t){let e=this.getChildContainers(t.group);for(let n of e)t.filter&&!t.filter(n)||n.destroy()}getChildContainers(t){if(!t)return this.app.getChildrenOf(this.componentId);if(!this.childGroups)return[];let e="string"==typeof t?[t]:t,n=new Set;for(let t of e){let e=this.childGroups.get(t);if(e)for(let t of e.values())n.add(t)}let i=[];for(let t of n.values())i.push(this.app.getContainer(t));return i}}function makePublicDash(t){let e=Object.freeze({unattendedEvents:Object.freeze({on:(e,n,i)=>{t.emitter.on(arr(e),n,i)},off:(e,n,i)=>{t.emitter.off(new Set(arr(e)),n,i)}}),get instance(){return t.getInstance()},get parent(){return e.getParent()},getParent:function(e){let n=t.getParent(e);return n?n.getInstance():void 0},getParents:e=>t.getParents(e).map(t=>t.getInstance()),destroy:()=>t.destroy(),children:(e={})=>t.getChildren(e),getChild:(e={})=>t.getChild(e),countChildren:(e={})=>t.countChildren(e),hasChildren:(e={})=>t.hasChildren(e),isChild:e=>t.isChild(e),isComponent:e=>t.app.isComponent(e),getPublicDashOf:e=>t.app.getContainerByInst(e).pub,log:t.app.log});return e}function makeDash(t,e){let n={setInstance:e=>(t.setInstance(e),i),exposeEvent:function(...e){return t.emitter.exposeEvent(flatten(e),!0),i},create:(e,...n)=>t.createChild({asObj:!1,Class:e,args:n}).getInstance(),toComponent:e=>t.createChild({asObj:!0,obj:e}).dash,addToGroup:(e,...n)=>(t.addToGroup(e,flatten(n)),i),inGroup:(e,...n)=>t.inGroup(e,flatten(n)),emit:function(e,n,r){let s=Array.isArray(e)?e:[e];for(let e of s)t.emit(e,n,r);return i},broadcast:function(e,n){return t.broadcast(e,n),i},listenTo:(...e)=>{let n,r,s,o;if(2===e.length||"string"==typeof e[0]||Array.isArray(e[0]))[r,s,o]=e,n=t;else{let i;[i,r,s,o]=e,n=t.app.getContainerByInst(i)}return t.subscriber.listenTo(n.emitter,arr(r),s,o),i},stopListening:(...e)=>{let n,r,s,o,a=e.length;if("string"==typeof e[0]||Array.isArray(e[0]))[r,s,o]=e,n=t;else{if(1===a||2===a)return[s,o]=e,void t.subscriber.stopListeningEverywhere(s,o);{let i;[i,r,s,o]=e,n=t.app.getContainerByInst(i)}}return t.subscriber.stopListening(n.emitter,arr(r),s,o),i},destroyChildren:(e={})=>(t.destroyChildren(e),i),publicDash:e},i=Object.assign(Object.create(e),n);return t.app.root&&t.app.root!==t?(Object.defineProperties(i,{app:{get:()=>t.app.root.getInstance()}}),Object.assign(i,...t.app.augmentList.map(t=>t(i)))):i.registerDashAugmentation=(e=>{t.app.augmentList.push(e)}),Object.freeze(i),i}function arr(t){return"string"==typeof t?[t]:t}function flatten(t){return 1===t.length&&Array.isArray(t[0])?t[0]:t}Container.canPropagateSymb=Symbol("canPropagate");class ApplicationContainer{constructor(t,e,n){this.compCount=0,this.nodesByInst=new WeakMap,this.nodes=new Map,this.insideRmComp=!1,this.augmentList=[];let i=["error","warn","info","debug","trace"],r=this.newId();this.log=this.createLog(i),this.root=new Container(this,r);let s={container:this.root};this.nodes.set(r,s),this.root.emitter.exposeEvent(["log",...i,"addComponent","removeComponent","changeComponent"],!1),e?this.root.setInstance(t):this.root.makeInstance(t,n||[])}setInstanceOf(t,e){let n=this.nodes.get(t);if(!n)throw new Error("Destroyed component");this.nodesByInst.set(e,n)}getParentOf(t){let e=this.findNode(t);return e.parent?e.parent.container:void 0}getChildrenOf(t){let e=[],n=this.findNode(t).children;if(n)for(let t of Array.from(n.values()))e.push(t.container);return e}getContainer(t){return this.findNode(t).container}getContainerByInst(t){return this.findNodeByInst(t).container}isComponent(t){return!!this.nodesByInst.get(t)}createComponent(t,e){if(!this.root.dash)throw new Error("Destroyed root component");let n=this.newId(),i=new Container(this,n),r=this.findNode(e.componentId),s={container:i,parent:r};return this.nodes.set(n,s),r.children||(r.children=new Map),r.children.set(n,s),t.asObj?i.setInstance(t.obj):i.makeInstance(t.Class,t.args),this.root.dash.emit("addComponent",{component:i.getInstance()}),this.root.dash.emit("changeComponent",{component:i.getInstance(),type:"add"}),i}removeComponent(t,e){if(!this.root.dash)throw new Error("Destroyed root component");let n=!this.insideRmComp;try{n&&(this.insideRmComp=!0,this.root.dash.emit("removeComponent",{component:t.getInstance()},{sync:!0}),this.root.dash.emit("changeComponent",{component:t.getInstance(),type:"remove"},{sync:!0}));let i=t.componentId,r=this.findNode(i);if(r.children){for(let t of Array.from(r.children.values()))t.parent=void 0,t.container.destroy();r.children.clear()}r.parent&&(r.parent.container.forgetChild(i),r.parent.children.delete(i)),this.nodes.delete(i),e&&this.nodesByInst.delete(e)}finally{n&&(this.insideRmComp=!1)}}errorHandler(t){if(!this.root.dash)throw new Error("Destroyed root component");this.root.dash.emit("log",{type:"error",messages:[t]},{sync:!0})}asyncCall(t){this.tickList?this.tickList.push(t):(this.tickList=[t],setTimeout(()=>{if(this.tickList){for(let t of this.tickList)try{t()}catch(t){this.errorHandler(t)}this.tickList=void 0}},0))}findNode(t){let e=this.nodes.get(t);if(!e)throw new Error(`Missing node of component "${t}"`);return e}findNodeByInst(t){let e=this.nodesByInst.get(t);if(!e)throw new Error(`Cannot find a component for the instance: ${t}`);return e}newId(){return this.compCount++}createLog(t){let e={};for(let n of t)e[n]=((...t)=>{if(!this.root.dash)throw new Error("Destroyed root component");this.root.dash.emit("log",{type:n,messages:t},{sync:!0})});return Object.freeze(e)}}function createApplication(t,...e){return new ApplicationContainer(t,!1,e).root.getInstance()}function asApplication(t){return new ApplicationContainer(t,!0).root.dash}export{createApplication,asApplication};
{
"name": "bkb",
"version": "0.20.1",
"version": "0.20.2",
"description": "A JavaScript Framework for Front-end Applications",

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