Comparing version 1.0.3 to 1.0.4
@@ -1,82 +0,1 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var pragmajs = require('pragmajs'); | ||
const isObj = o => (o !== null) && typeof o === 'object'; | ||
function deepMerge(obj, edit) { | ||
if (!isObj(obj) || !isObj(edit)) return edit | ||
for (let [key, value] of Object.entries(edit)) { | ||
if (!(key in edit)) continue | ||
obj[key] = deepMerge(obj[key], edit[key]); | ||
} | ||
return obj | ||
} | ||
class Jolene { | ||
static watcher = pragmajs._p('jolene-watcher') | ||
.createEvents('set', 'get') | ||
static on() { | ||
return Jolene.watcher.on(...arguments) | ||
} | ||
static setLocal(key, value){ | ||
return window.localStorage.setItem("jolene", JSON.stringify({[key]: value})) | ||
} | ||
static getLocal(key=null){ | ||
let jolene = JSON.parse(window.localStorage.getItem("jolene")); | ||
if (jolene == null) return null | ||
if (key == null) return jolene | ||
return jolene[key] | ||
} | ||
static set(key, value) { | ||
Jolene.watcher.triggerEvent("set", key, value); | ||
let keys = key.split(">").map(level => level.trim()); | ||
let shape = keys.reduceRight((dict, current, i) => { | ||
let val = i == keys.length-1 ? value : Object.assign({}, dict); | ||
return { [current]: val, lastModified: new Date() } | ||
} , {}); | ||
let origin_key = keys[0]; | ||
let diff = deepMerge(Jolene._get(origin_key), shape); | ||
Jolene.setLocal(origin_key, diff[origin_key]); | ||
return value | ||
} | ||
static _get(...keys){ | ||
let value = keys.slice(1).reduce((last, current) => { | ||
if (last != null && isObj(last) && (current in last)) { | ||
return last[current] | ||
} else { | ||
return null | ||
} | ||
}, Jolene.getLocal(keys[0])); | ||
return value | ||
} | ||
static get(key=null) { | ||
if (key === null) { return Jolene.getLocal() } | ||
let keys = key.split(">").map(level => level.trim()); | ||
let value = Jolene._get(...keys); | ||
Jolene.watcher.triggerEvent("get", key.trim(), value); | ||
return value | ||
} | ||
} | ||
exports.deepMerge = deepMerge; | ||
exports.isObj = isObj; | ||
exports.jolene = Jolene; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("pragmajs");const t=e=>null!==e&&"object"==typeof e;function r(e,l){if(!t(e)||!t(l))return l;for(let[t,n]of Object.entries(l))t in l&&(e[t]=r(e[t],l[t]));return e}class l{static watcher=e._p("jolene-watcher").createEvents("set","get");static on(){return l.watcher.on(...arguments)}static setLocal(e,t){return window.localStorage.setItem("jolene",JSON.stringify({[e]:t}))}static getLocal(e=null){let t=JSON.parse(window.localStorage.getItem("jolene"));return null==t?null:null==e?t:t[e]}static set(e,t){l.watcher.triggerEvent("set",e,t);let n=e.split(">").map((e=>e.trim())),s=n.reduceRight(((e,r,l)=>({[r]:l==n.length-1?t:Object.assign({},e),lastModified:new Date})),{}),a=n[0],i=r(l._get(a),s);return l.setLocal(a,i[a]),t}static _get(...e){return e.slice(1).reduce(((e,r)=>null!=e&&t(e)&&r in e?e[r]:null),l.getLocal(e[0]))}static get(e=null){if(null===e)return l.getLocal();let t=e.split(">").map((e=>e.trim())),r=l._get(...t);return l.watcher.triggerEvent("get",e.trim(),r),r}}exports.deepMerge=r,exports.isObj=t,exports.jolene=l; |
@@ -1,76 +0,1 @@ | ||
import { _p } from 'pragmajs'; | ||
const isObj = o => (o !== null) && typeof o === 'object'; | ||
function deepMerge(obj, edit) { | ||
if (!isObj(obj) || !isObj(edit)) return edit | ||
for (let [key, value] of Object.entries(edit)) { | ||
if (!(key in edit)) continue | ||
obj[key] = deepMerge(obj[key], edit[key]); | ||
} | ||
return obj | ||
} | ||
class Jolene { | ||
static watcher = _p('jolene-watcher') | ||
.createEvents('set', 'get') | ||
static on() { | ||
return Jolene.watcher.on(...arguments) | ||
} | ||
static setLocal(key, value){ | ||
return window.localStorage.setItem("jolene", JSON.stringify({[key]: value})) | ||
} | ||
static getLocal(key=null){ | ||
let jolene = JSON.parse(window.localStorage.getItem("jolene")); | ||
if (jolene == null) return null | ||
if (key == null) return jolene | ||
return jolene[key] | ||
} | ||
static set(key, value) { | ||
Jolene.watcher.triggerEvent("set", key, value); | ||
let keys = key.split(">").map(level => level.trim()); | ||
let shape = keys.reduceRight((dict, current, i) => { | ||
let val = i == keys.length-1 ? value : Object.assign({}, dict); | ||
return { [current]: val, lastModified: new Date() } | ||
} , {}); | ||
let origin_key = keys[0]; | ||
let diff = deepMerge(Jolene._get(origin_key), shape); | ||
Jolene.setLocal(origin_key, diff[origin_key]); | ||
return value | ||
} | ||
static _get(...keys){ | ||
let value = keys.slice(1).reduce((last, current) => { | ||
if (last != null && isObj(last) && (current in last)) { | ||
return last[current] | ||
} else { | ||
return null | ||
} | ||
}, Jolene.getLocal(keys[0])); | ||
return value | ||
} | ||
static get(key=null) { | ||
if (key === null) { return Jolene.getLocal() } | ||
let keys = key.split(">").map(level => level.trim()); | ||
let value = Jolene._get(...keys); | ||
Jolene.watcher.triggerEvent("get", key.trim(), value); | ||
return value | ||
} | ||
} | ||
export { deepMerge, isObj, Jolene as jolene }; | ||
import{_p as t}from"pragmajs";const e=t=>null!==t&&"object"==typeof t;function r(t,l){if(!e(t)||!e(l))return l;for(let[e,n]of Object.entries(l))e in l&&(t[e]=r(t[e],l[e]));return t}class l{static watcher=t("jolene-watcher").createEvents("set","get");static on(){return l.watcher.on(...arguments)}static setLocal(t,e){return window.localStorage.setItem("jolene",JSON.stringify({[t]:e}))}static getLocal(t=null){let e=JSON.parse(window.localStorage.getItem("jolene"));return null==e?null:null==t?e:e[t]}static set(t,e){l.watcher.triggerEvent("set",t,e);let n=t.split(">").map((t=>t.trim())),a=n.reduceRight(((t,r,l)=>({[r]:l==n.length-1?e:Object.assign({},t),lastModified:new Date})),{}),i=n[0],c=r(l._get(i),a);return l.setLocal(i,c[i]),e}static _get(...t){return t.slice(1).reduce(((t,r)=>null!=t&&e(t)&&r in t?t[r]:null),l.getLocal(t[0]))}static get(t=null){if(null===t)return l.getLocal();let e=t.split(">").map((t=>t.trim())),r=l._get(...e);return l.watcher.triggerEvent("get",t.trim(),r),r}}export{r as deepMerge,e as isObj,l as jolene}; |
@@ -1,88 +0,1 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jolenejs = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
function e(t,e=null,n=["rerun the code 10 times"],i=null,r=!1){if(!M()&&!r)return null;console.error(`%c 🧯 pragma.js %c \n\n encountered a soft error 🔫 %c \n\n \n${i?`Triggered by: [${i.key} ${i}]`:""}\n \n${t} %c\n\n \n${null!=e?`Potential ${e}: \n\t${n.join("\n\t")}`:""}\n `,"font-size:15px","font-size: 12px;","color:whitesmoke","color:white");}function n(){if(!M())return null;console.log(...arguments);}function i(){if(!M())return null;console.log("%c 🌴 [pragma] \n\n ","font-size:12px; color:#86D787;",...arguments,"\n");}class r{constructor(t){this.self=t,this.actions=new Map,this.delete=this.destroy;}addWithKey(t,e=null){return e=e||this.actions.size,this.actions.set(e,t),e}add(...t){let e=[];for(let n of t)e.push(this.addWithKey(n));return e.length>1?e:e[0]}forAction(t){for(let[e,n]of this.actions)t(e,n);}exec(...t){this.execAs(this.self,...t);}destroy(...t){t.forEach((t=>this.actions.delete(t)));}execAs(t,...e){this.forAction(((n,i)=>{let r=null;if(r="function"==typeof i.bind?i.bind(t)(...e):i(...e),"function"==typeof r){r({key:n,action:i,replaceWith:t=>{},selfDestruct:()=>{this.destroy(n);}});}}));}}function s(){return Math.random().toString(36).substring(3,6)+Math.random().toString(36).substring(5,8)}function o(){return a(8)}function a(t=7){return t<5?s():(s()+a(t-5)).substring(0,t)}function h(t){return a(t)}function l(t,e){for(let[n,i]of Object.entries(e))t[n]=i;return t}const c=t=>t.replace(/([-_]\w)/g,(t=>t[1].toUpperCase()));function u(t,e){let n=`${t}Chain`,i=`on${t.capitalize()}`;return e[n]=new r(e),e[i]=function(t,i){e[n].addWithKey(t,i);},{chainName:n,eventName:i}}function f(t,...e){for(let n of e)u(n,t);}function d(t,e){let n=u(t,e),i=`is${t.capitalize()}ed`;e[n.chainName].add((()=>{e[i]=!0;})),e[n.eventName]=function(t){if(e[i])return t(e);e[n.chainName].add(t);};}function p(t,...e){for(let n of e)d(n,t);}String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};const g=t=>t.toString().replace(/[^a-z0-9]/gi,"-").toLowerCase();globalThis.pragmaSpace||(globalThis.pragmaSpace={}),p(globalThis.pragmaSpace,"docLoad");const m=globalThis.pragmaSpace.onDocLoad;function y(){globalThis.pragmaSpace.isDocLoaded||(i("📰 document is loaded."),globalThis.pragmaSpace.docLoadChain.exec());}document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&y();})),document.addEventListener("turbolinks:load",(()=>{i("🚀 TURBOLINKS loaded"),y();}));var v=/[#.]/g;function x(t,e="div"){var n=t||"",i={tag:e},r=0;let s,o,a;for(;r<n.length;)v.lastIndex=r,a=v.exec(n),s=n.slice(r,a?a.index:n.length),s&&(o?"#"===o?i.id=s:i.class?i.class.push(s):i.class=[s]:i.tag=s,r+=s.length),a&&(o=a[0],r++);return i}function b(t,n,i){if(!Array.isArray(t))return e(`Could not ${i} class [${t}] -> [${n}]`);for(let e of t){let t=e.split(" ");t.length>1?b(t,n,i):n.classList[i](e);}}function _(t,e){b(t,e,"add");}function $(t,e){b(t,e,"remove");}function C(t,e){b(t,e,"toggle");}function E(t){t=t.trim();try{let e=document.querySelector(t);if(e)return e}catch{}let e=x(t),n=document.createElement(e.tag||"div");return e.id&&(n.id=e.id),e.class&&_(e.class,n),n}function T(t){return document.createRange().createContextualFragment(t)}function w(t){return t instanceof Element?t:"string"==typeof t?"<"===t[0]?T(t):E(t):e(`Could not find/create element from [${t}]`)}const A={html:(t,e)=>{e.innerHTML=t;},pcss:(t,e)=>{for(let[n,i]of S.cssToDict(t))e.style[c(n)]=i;}},S={cssToDict:t=>{t=t.replace(/\n/g,";").replace(/:/g," ");let n=new Map;for(let e of t.split(";")){if(e.replace(/\s/g,"").length<2)continue;e=e.trim().split(" ");let t=e[0];e.shift(),n.set(t.trim(),e.join(" ").trim());}let i=[];for(const[t,e]of n.entries())CSS.supports(t,e)||i.push(`${t.trim()}: ${e.trim()}`);return i.length>0&&e("CSS syntax error","typos",i),n},css:t=>{let e="";for(let[n,i]of S.cssToDict(t))e+=`${n}:${i};`;return e},html:t=>t};function M(){return globalThis.pragmaSpace.dev}globalThis.pragmaSpace||(globalThis.pragmaSpace={}),globalThis.pragmaSpace.dev=globalThis.pragmaSpace.dev||"undefined"!=typeof process&&process.env&&"development"===process.env.NODE_ENV;var O=Object.freeze({__proto__:null,_deving:M,throwSoft:e,log:n,suc:i,whenDOM:m,parseQuery:x,addClassAryTo:_,removeClassAryFrom:$,toggleClassAryOf:C,selectOrCreateDOM:E,elementFrom:w,toHTMLAttr:g,fragmentFromString:T,fillSVG:function(t,e){j(t).findAll("path").forEach((t=>{const n=t.attr("fill");"none"!=n&&"transparent"!=n&&t.attr("fill",e);}));},generateRandomKey:h,objDiff:l,aryDiff:function(t,e){return t.filter((t=>e.indexOf(t)<0))},_extend:function(t,e){Object.setPrototypeOf(t,l(Object.getPrototypeOf(t),e));},overwrite:function(t,e,n){let i=t[e];t[`_${e}`]=i.bind(t),t[e]=n;},createEventChains:p,createChains:f,snake2camel:c,mimic:function(t,e,n){for(let i of n||Object.keys(e)){let n=Object.getOwnPropertyDescriptor(e,i);if(!n)break;Object.defineProperty(t,i,n);}},bench:function(t,e){console.time(e),t(),console.timeEnd(e);},addStyles:function(t,e="injected-pragma-style"){j(`style#${e}-${s()}`,t).appendTo("head");},rk:a,rk5:s,rk8:o,parse:S,apply:A,createTemplate:t=>(new q).run((function(){f(this,"config"),this.config=function(t){return this.configChain.exec(t),this},this.onConfig(((t={})=>{["events","chains","exports","persistentExports"].forEach((e=>{t[e]&&(this[`_${e}`]=t[e],delete t[e]);})),this._events&&p(this,...this._events),this._chains&&f(this,...this._chains);for(let[e,n]of Object.entries(t))this[e]=n,this.export(e);this._exports&&this.export(...this._exports);})),this.export("exports","config","exportChain","configChain","onConfig");}),(function(){"object"==typeof t&&this.config(t);}))});function k(t){if(null==t||null==t)return e(`Could not find a DOM element for ${t}`);if(t.element)return k(t.element);return w(t)}function j(t,e){let n=k(t);var i,r;return n.constructor===DocumentFragment&&(i=n,(r=document.createElement("template")).appendChild(i.cloneNode(!0)),n=r.firstChild),n instanceof Element&&(n.init(),n._render()),"string"==typeof e&&n.html(e),n}const L={init:function(){this.isPragmaElement=!0,p(this,"docLoad","render"),m((()=>this.docLoadChain.exec(this)));},_render:function(){this.renderChain.exec(this);},appendTo:function(t){return this.onDocLoad((()=>{this._parentElement=k(t),this._parentElement.appendChild(this),this._render();})),this},prependTo:function(t){return this.onDocLoad((()=>{this._parentElement=k(t),this._parentElement.prepend(this),this._render();})),this},append:function(...t){return this.onRender((()=>{for(let e of t){let t=k(e);this.appendChild(t);}})),this},destroy:function(){this.onRender((()=>{this.parentElement&&this.parentElement.removeChild(this);}));},css:function(t){return this.onRender((()=>{A.pcss(t,this);})),this},setText:function(t){return t?(this.onRender((()=>{this.textContent=t;})),this):this.text},html:function(t){return t?(this.onRender((()=>{A.html(t,this);})),this):this.innerHTML},setId:function(t){return this.id=t,this},setData:function(t){for(let[e,n]of Object.entries(t))this.dataset[e]=n;return this},getData:function(t){return this.dataset[t]},addClass:function(...t){return _(t,this),this},removeClass:function(...t){return $(t,this),this},toggleClass:function(...t){return C(t,this),this},listenTo:function(...t){return this.onRender((()=>{this.addEventListener(...t);})),this},attr:function(t,e){if("string"==typeof t){if(void 0===e)return this.getAttribute(t);const n=t;(t={})[n]=e;}for(let[e,n]of Object.entries(t))this.setAttribute(e,n);return this},find:function(){return j(this.query(...arguments))},findAll:function(t){return Array.from(this.queryAll(t)).map((t=>j(t)))},query:function(){return this.querySelector(...arguments)},queryAll:function(t){return this.querySelectorAll(t)},hide:function(){return this.style.display="none",this},show:function(){return this.style.display="",this},deepQueryAll:function(t){let e=Array.from(this.queryAll(t));for(let n of this.children)e=e.concat(n.deepQueryAll(t));return e},deepFindAll:function(t){return this.deepQueryAll(t).map((t=>j(t)))},rect:function(){return "function"==typeof this.getBoundingClientRect?this.getBoundingClientRect():{}},offset:function(t){if(t){["width","height","left","right","top","bottom"].forEach((e=>{e in t&&(this.style[e]=t[e]+"px");}));}var e=this.rect();return {top:e.top+window.scrollY,left:e.left+window.scrollX}},x:function(t){return this.left+this.width/2-t/2}},D={top:function(){return this.offset().top},left:function(){return this.offset().left},width:function(){return this.rect().width},height:function(){return this.rect().height},text:function(){return this.textContent},classArray:function(){return Array.from(this.classList)},childrenArray:function(){return Array.from(this.children)}};for(let[t,e]of Object.entries(L))Element.prototype[t]=e;for(let[t,e]of Object.entries(D))Object.defineProperty(Element.prototype,t,{get:e,configurable:!0});class P{constructor(t){this._childMap=new Map,this.key="string"==typeof t?t:o(),this.containsKey=this.childMap.has;}set childMap(t){for(let[e,n]of t)n instanceof P&&this.add(n);}get childMap(){return this._childMap}get kidsum(){return this.childMap.size}get hasKids(){return this.kidsum>0}get shape(){return this.shapePrefix()}get master(){return null==this.parent||null==this.parent.parent?this.parent:this.parent.master}get children(){return Array.from(this.childMap.values())}get depthKey(){return this.parent?this.parent.depthKey+"<~<"+this.key:this.key}get allChildren(){if(!this.hasKids)return null;let t=this.children;for(let e of t){let n=e.allChildren;n&&(t=t.concat(n));}return t}get(t){return this.childMap.get(t)}find(t){if(this.childMap.has(t))return this.childMap.get(t);for(let e of this.childMap.values()){let n;try{n=e.find(t);}catch{}if(n)return n}}adopt(...t){for(let e of t)this.add(e);return this}add(t,n=!1){return t?!n&&this.childMap.has(t.key)?(t.key=`${t.key}<${s()}`,this.add(t)):(t.parent=this,void this.childMap.set(t.key,t)):e(`Could not add [${t}] to [${this.id}]`)}delete(t){return this.remove(t)}remove(t){this.childMap.get(t)&&this.childMap.delete(t);}shapePrefix(t=""){let e=`${t}| ${this.type} - ${this.key} \n`;if(this.hasKids){t+="| ";for(let n of this.children)e+=n.shapePrefix(t);}return e}}const R={parent:(t,e)=>{t.parent=e;},value:(t,e)=>{t.value=e;},key:(t,e)=>{t.key=e;},class:(t,e)=>{t._class=e;},element:(t,n)=>{if(!(n instanceof Element))return e(`Could not add ${n} as the element of [${t}]`);t.element=n;},children:(t,e)=>{if(e.constructor==Array)return t.buildAry(e);t.build(e);},childTemplate:(t,e)=>{}};function z(t,e){return {val:t,set:e}}function N(t,e){return t=e.min?Math.max(e.min,t):t,t=e.max?Math.min(e.max,t):t}function K(t,n){return function(t){return t&&null!=t.min&&null!=t.max}(n)?(null==t&&(t=n.min),t=(t=t>n.max?n.min:t)<n.min?n.max:t):e(`Could not loop value, since range (${JSON.stringify(n)}) is unbounded`)}class q extends P{constructor(t,e){super(),p(this,"export"),this.actionChain=new r,this._events=new Map,"object"==typeof t?function(t,e){let n=new Map;for(let[i,r]of Object.entries(t))R.hasOwnProperty(i)?R[i](e,r):n.set(i,r);e.element&&e.element.whenInDOM((t=>{for(let[i,r]of n)if(i=i.toLowerCase(),i.includes("on")){let n=i.split("on")[1].trim();t.listenTo(n,(()=>{e.action(r);}));}}));}(t,this):this.key=t,this.element||this.as();}listenTo(t,e){return this.element.listenTo(t,e.bind(this)),this}_addToEventChain(t,...e){let n=this._events.get(t);if(n){let i=n.add(...e);return this._events.set(t,n),i}return null}createEvent(t,...e){let n=new r(this);return this._events.set(t,n),e.length>0&&this.on(t,e),this}createEvents(...t){return t.forEach((t=>{this.createEvent(t);})),this}triggerEvents(t,...e){return t.forEach((t=>{this.triggerEvent(t,...e);})),this}triggerEvent(e,...n){return this._events.has(e)?(this._events.get(e).execAs(this,...n),this):O.throwSoft(`pragma doesnt have ${event} - cannot .triggerEvent("${event}")]`,this)}_on(e,...n){let i=this._addToEventChain(e,...n);return null===i?O.throwSoft(`pragma doesnt have ${e} - cannot .on("${e}")`,this):i}on(){return this._on(...arguments),this}_onNext(t,e){this._on(t,(function(){return e(...arguments),t=>{t.selfDestruct();}}));}onNext(){return this._onNext(...arguments),this}createWires(...t){return t.forEach((t=>this.createWire(t))),this}createWire(t){let e={change:`${t}Change`,set:`${t}Set`};return this.createEvents(e.change,e.set),Object.defineProperty(this,t,{set:n=>{let i=function(t,e,n){if(n)return z(K(t,n),!0);if(e){let n=N(t,e);return z(n,n===t)}return z(t,!0)}(n,this[`_${t}Range`],this[`_${t}Loop`]);const r=this[`_${t}`];i.set&&i.val!==r&&(this[`_${t}`]=i.val,this.triggerEvent(e.change,i.val,r)),this.triggerEvent(e.set,n,r);},get:()=>this[`_${t}`]}),this[`set${t.capitalize()}`]=e=>(this[`${t}`]=e,this),this[`set${t.capitalize()}Silently`]=e=>(this[`_${t}`]=e,this),this[`set${t.capitalize()}Loop`]=(e,n)=>(this[`_${t}Loop`]={min:e,max:n},this),this[`set${t.capitalize()}Range`]=(e,n)=>(this[`_${t}Range`]={min:e,max:n},this),this}get _e(){return this.element}setElement(t,e=!0){return this.elementDOM=t,e&&this.element.id&&(this.id=this.element.id),this}get element(){return this.elementDOM}set element(t){this.setElement(t);}setRange(t=null,e=null){return this.range=this.range||{},this.range.min=null===t?this.range.min:t,this.range.max=null===e?this.range.max:e,this}breakLoop(){return this._loopVal=!1,this}setLoop(t,e){return this.setRange(t,e),this._loopVal=!0,this}get dv(){return this.v-this._lv}get value(){return this.v}setValue(t){return this.value=t,this}set value(t){let e=function(t,e,n){if(!e)return z(t,!0);if(n)return z(K(t,e),!0);let i=N(t,e);return z(i,i==t)}(t,this.range,this._loopVal);e.set&&(this._lv=this.v,this.v=e.val,this.exec());}exec(){return this.actionChain.execAs(this,...arguments),this}setKey(t){return this.key=t,this}set key(t){this._KEY=null==t?h():t;}get key(){return this._KEY}set id(t){this.element&&(this.element.id=this.id);}get id(){return g(this.key)}buildAry(t){for(let e of t)this.add(new q(e,this));return this}build(...t){return this.buildAry(t)}as(t=null,e){return t=t||`div#${this.id}.pragma`,this.setElement(j(t,e),!1),this}addExport(t){this.exports=this.exports||new Set,this.exports.add(t);}export(...t){for(let e of t)this.addExport(e);}import(...e){let n=new r;for(let i of e)"function"==typeof i&&(i=i()),i.exports&&O.mimic(this,i,i.exports),i.exportChain&&n.add((t=>{i.exportChain.exec(this);}));return n.exec(),this}from(e){return e.exports&&O.mimic(this,e,e.exports),e.exportChain&&e.exportChain.exec(this),this}wireTo(t){let e=this;return t.do((function(){e.value=this.value;})),this}do(){return this.actionChain.add(...arguments),this}extend(e,n){return O.overwrite(this,e,n),this}run(...t){let n=t[0];return "function"==typeof n?this._runAry(t):"object"==typeof n?this._runAry(Object.values(n)):e(`Could not run [${t}] as [${this}]`),this}_runAry(t){for(let e of t)this.runAs(e);}runAs(t){return t.bind(this)()}containAry(t,n="append"){for(let i of t)super.add(i),i.isRendered?e(`[${i}] is already appended`):this.element[n](i);return this}contain(...t){return this.containAry(t)}containFirst(...t){return this.containAry(t.reverse(),"prepend")}pragmatize(){return this.element.appendTo(this.parent&&this.parent.element||"body"),this}pragmatizeAt(t){return this.element.appendTo(t),this}addListeners(t){for(let[e,n]of Object.entries(t))this.on(e).do(n);return this}}const W=["html","css","addClass","removeClass","toggleClass","setId","append","prepend","appendTo","prependTo","setData"];for(let t of W)q.prototype[t]=function(){return this.element[t](...arguments),this};const F=["getData"];for(let t of F)q.prototype[t]=function(){return this.element[t](...arguments)};const I=["offset","text","top","left","width","height","x","classArray"];for(let t of I)Object.defineProperty(q.prototype,t,{get:function(){return this.element[t]}});globalThis.pragmaSpace||(globalThis.pragmaSpace={}),globalThis.pragmaSpace.integrateMousetrap=function(t){"function"==typeof t&&(q.prototype.bind=function(e,n,i){let r=this;return t.bind(e,(function(){return r.runAs(n)}),i),this},globalThis.pragmaSpace.mousetrapIntegration=!0,i("Mousetrap configuration detected! Extended Pragmas to support .bind() method!"));};try{globalThis.pragmaSpace.integrateMousetrap(Mousetrap);}catch(t){n("Tried to integrate extensions, but failed. To disable,\n this attempt: globalThis.pragmaSpace.integrate3rdParties = false");}const H=(t,e)=>new q(t,e),J=H; | ||
const isObj = o => (o !== null) && typeof o === 'object'; | ||
function deepMerge(obj, edit) { | ||
if (!isObj(obj) || !isObj(edit)) return edit | ||
for (let [key, value] of Object.entries(edit)) { | ||
if (!(key in edit)) continue | ||
obj[key] = deepMerge(obj[key], edit[key]); | ||
} | ||
return obj | ||
} | ||
class Jolene { | ||
static watcher = J('jolene-watcher') | ||
.createEvents('set', 'get') | ||
static on() { | ||
return Jolene.watcher.on(...arguments) | ||
} | ||
static setLocal(key, value){ | ||
return window.localStorage.setItem("jolene", JSON.stringify({[key]: value})) | ||
} | ||
static getLocal(key=null){ | ||
let jolene = JSON.parse(window.localStorage.getItem("jolene")); | ||
if (jolene == null) return null | ||
if (key == null) return jolene | ||
return jolene[key] | ||
} | ||
static set(key, value) { | ||
Jolene.watcher.triggerEvent("set", key, value); | ||
let keys = key.split(">").map(level => level.trim()); | ||
let shape = keys.reduceRight((dict, current, i) => { | ||
let val = i == keys.length-1 ? value : Object.assign({}, dict); | ||
return { [current]: val, lastModified: new Date() } | ||
} , {}); | ||
let origin_key = keys[0]; | ||
let diff = deepMerge(Jolene._get(origin_key), shape); | ||
Jolene.setLocal(origin_key, diff[origin_key]); | ||
return value | ||
} | ||
static _get(...keys){ | ||
let value = keys.slice(1).reduce((last, current) => { | ||
if (last != null && isObj(last) && (current in last)) { | ||
return last[current] | ||
} else { | ||
return null | ||
} | ||
}, Jolene.getLocal(keys[0])); | ||
return value | ||
} | ||
static get(key=null) { | ||
if (key === null) { return Jolene.getLocal() } | ||
let keys = key.split(">").map(level => level.trim()); | ||
let value = Jolene._get(...keys); | ||
Jolene.watcher.triggerEvent("get", key.trim(), value); | ||
return value | ||
} | ||
} | ||
exports.deepMerge = deepMerge; | ||
exports.isObj = isObj; | ||
exports.jolene = Jolene; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jolenejs={})}(this,(function(t){"use strict";function e(t,e=null,n=["rerun the code 10 times"],i=null,r=!1){if(!M()&&!r)return null;console.error(`%c 🧯 pragma.js %c \n\n encountered a soft error 🔫 %c \n\n \n${i?`Triggered by: [${i.key} ${i}]`:""}\n \n${t} %c\n\n \n${null!=e?`Potential ${e}: \n\t${n.join("\n\t")}`:""}\n `,"font-size:15px","font-size: 12px;","color:whitesmoke","color:white")}function n(){if(!M())return null;console.log(...arguments)}function i(){if(!M())return null;console.log("%c 🌴 [pragma] \n\n ","font-size:12px; color:#86D787;",...arguments,"\n")}class r{constructor(t){this.self=t,this.actions=new Map,this.delete=this.destroy}addWithKey(t,e=null){return e=e||this.actions.size,this.actions.set(e,t),e}add(...t){let e=[];for(let n of t)e.push(this.addWithKey(n));return e.length>1?e:e[0]}forAction(t){for(let[e,n]of this.actions)t(e,n)}exec(...t){this.execAs(this.self,...t)}destroy(...t){t.forEach((t=>this.actions.delete(t)))}execAs(t,...e){this.forAction(((n,i)=>{let r=null;r="function"==typeof i.bind?i.bind(t)(...e):i(...e),"function"==typeof r&&r({key:n,action:i,replaceWith:t=>{},selfDestruct:()=>{this.destroy(n)}})}))}}function s(){return Math.random().toString(36).substring(3,6)+Math.random().toString(36).substring(5,8)}function o(){return a(8)}function a(t=7){return t<5?s():(s()+a(t-5)).substring(0,t)}function l(t){return a(t)}function h(t,e){for(let[n,i]of Object.entries(e))t[n]=i;return t}const c=t=>t.replace(/([-_]\w)/g,(t=>t[1].toUpperCase()));function u(t,e){let n=`${t}Chain`,i=`on${t.capitalize()}`;return e[n]=new r(e),e[i]=function(t,i){e[n].addWithKey(t,i)},{chainName:n,eventName:i}}function f(t,...e){for(let n of e)u(n,t)}function d(t,e){let n=u(t,e),i=`is${t.capitalize()}ed`;e[n.chainName].add((()=>{e[i]=!0})),e[n.eventName]=function(t){if(e[i])return t(e);e[n.chainName].add(t)}}function p(t,...e){for(let n of e)d(n,t)}String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};const g=t=>t.toString().replace(/[^a-z0-9]/gi,"-").toLowerCase();globalThis.pragmaSpace||(globalThis.pragmaSpace={}),p(globalThis.pragmaSpace,"docLoad");const m=globalThis.pragmaSpace.onDocLoad;function y(){globalThis.pragmaSpace.isDocLoaded||(i("📰 document is loaded."),globalThis.pragmaSpace.docLoadChain.exec())}document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&y()})),document.addEventListener("turbolinks:load",(()=>{i("🚀 TURBOLINKS loaded"),y()}));var v=/[#.]/g;function x(t,e="div"){var n=t||"",i={tag:e},r=0;let s,o,a;for(;r<n.length;)v.lastIndex=r,a=v.exec(n),s=n.slice(r,a?a.index:n.length),s&&(o?"#"===o?i.id=s:i.class?i.class.push(s):i.class=[s]:i.tag=s,r+=s.length),a&&(o=a[0],r++);return i}function b(t,n,i){if(!Array.isArray(t))return e(`Could not ${i} class [${t}] -> [${n}]`);for(let e of t){let t=e.split(" ");t.length>1?b(t,n,i):n.classList[i](e)}}function _(t,e){b(t,e,"add")}function C(t,e){b(t,e,"remove")}function $(t,e){b(t,e,"toggle")}function E(t){t=t.trim();try{let e=document.querySelector(t);if(e)return e}catch{}let e=x(t),n=document.createElement(e.tag||"div");return e.id&&(n.id=e.id),e.class&&_(e.class,n),n}function w(t){return document.createRange().createContextualFragment(t)}function A(t){return t instanceof Element?t:"string"==typeof t?"<"===t[0]?w(t):E(t):e(`Could not find/create element from [${t}]`)}const T={html:(t,e)=>{e.innerHTML=t},pcss:(t,e)=>{for(let[n,i]of S.cssToDict(t))e.style[c(n)]=i}},S={cssToDict:t=>{t=t.replace(/\n/g,";").replace(/:/g," ");let n=new Map;for(let e of t.split(";")){if(e.replace(/\s/g,"").length<2)continue;e=e.trim().split(" ");let t=e[0];e.shift(),n.set(t.trim(),e.join(" ").trim())}let i=[];for(const[t,e]of n.entries())CSS.supports(t,e)||i.push(`${t.trim()}: ${e.trim()}`);return i.length>0&&e("CSS syntax error","typos",i),n},css:t=>{let e="";for(let[n,i]of S.cssToDict(t))e+=`${n}:${i};`;return e},html:t=>t};function M(){return globalThis.pragmaSpace.dev}globalThis.pragmaSpace||(globalThis.pragmaSpace={}),globalThis.pragmaSpace.dev=globalThis.pragmaSpace.dev||"undefined"!=typeof process&&process.env&&"development"===process.env.NODE_ENV;var O=Object.freeze({__proto__:null,_deving:M,throwSoft:e,log:n,suc:i,whenDOM:m,parseQuery:x,addClassAryTo:_,removeClassAryFrom:C,toggleClassAryOf:$,selectOrCreateDOM:E,elementFrom:A,toHTMLAttr:g,fragmentFromString:w,fillSVG:function(t,e){L(t).findAll("path").forEach((t=>{const n=t.attr("fill");"none"!=n&&"transparent"!=n&&t.attr("fill",e)}))},generateRandomKey:l,objDiff:h,aryDiff:function(t,e){return t.filter((t=>e.indexOf(t)<0))},_extend:function(t,e){Object.setPrototypeOf(t,h(Object.getPrototypeOf(t),e))},overwrite:function(t,e,n){let i=t[e];t[`_${e}`]=i.bind(t),t[e]=n},createEventChains:p,createChains:f,snake2camel:c,mimic:function(t,e,n){for(let i of n||Object.keys(e)){let n=Object.getOwnPropertyDescriptor(e,i);if(!n)break;Object.defineProperty(t,i,n)}},bench:function(t,e){console.time(e),t(),console.timeEnd(e)},addStyles:function(t,e="injected-pragma-style"){L(`style#${e}-${s()}`,t).appendTo("head")},rk:a,rk5:s,rk8:o,parse:S,apply:T,createTemplate:t=>(new q).run((function(){f(this,"config"),this.config=function(t){return this.configChain.exec(t),this},this.onConfig(((t={})=>{["events","chains","exports","persistentExports"].forEach((e=>{t[e]&&(this[`_${e}`]=t[e],delete t[e])})),this._events&&p(this,...this._events),this._chains&&f(this,...this._chains);for(let[e,n]of Object.entries(t))this[e]=n,this.export(e);this._exports&&this.export(...this._exports)})),this.export("exports","config","exportChain","configChain","onConfig")}),(function(){"object"==typeof t&&this.config(t)}))});function j(t){return null==t||null==t?e(`Could not find a DOM element for ${t}`):t.element?j(t.element):A(t)}function L(t,e){let n=j(t);var i,r;return n.constructor===DocumentFragment&&(i=n,(r=document.createElement("template")).appendChild(i.cloneNode(!0)),n=r.firstChild),n instanceof Element&&(n.init(),n._render()),"string"==typeof e&&n.html(e),n}const k={init:function(){this.isPragmaElement=!0,p(this,"docLoad","render"),m((()=>this.docLoadChain.exec(this)))},_render:function(){this.renderChain.exec(this)},appendTo:function(t){return this.onDocLoad((()=>{this._parentElement=j(t),this._parentElement.appendChild(this),this._render()})),this},prependTo:function(t){return this.onDocLoad((()=>{this._parentElement=j(t),this._parentElement.prepend(this),this._render()})),this},append:function(...t){return this.onRender((()=>{for(let e of t){let t=j(e);this.appendChild(t)}})),this},destroy:function(){this.onRender((()=>{this.parentElement&&this.parentElement.removeChild(this)}))},css:function(t){return this.onRender((()=>{T.pcss(t,this)})),this},setText:function(t){return t?(this.onRender((()=>{this.textContent=t})),this):this.text},html:function(t){return t?(this.onRender((()=>{T.html(t,this)})),this):this.innerHTML},setId:function(t){return this.id=t,this},setData:function(t){for(let[e,n]of Object.entries(t))this.dataset[e]=n;return this},getData:function(t){return this.dataset[t]},addClass:function(...t){return _(t,this),this},removeClass:function(...t){return C(t,this),this},toggleClass:function(...t){return $(t,this),this},listenTo:function(...t){return this.onRender((()=>{this.addEventListener(...t)})),this},attr:function(t,e){if("string"==typeof t){if(void 0===e)return this.getAttribute(t);const n=t;(t={})[n]=e}for(let[e,n]of Object.entries(t))this.setAttribute(e,n);return this},find:function(){return L(this.query(...arguments))},findAll:function(t){return Array.from(this.queryAll(t)).map((t=>L(t)))},query:function(){return this.querySelector(...arguments)},queryAll:function(t){return this.querySelectorAll(t)},hide:function(){return this.style.display="none",this},show:function(){return this.style.display="",this},deepQueryAll:function(t){let e=Array.from(this.queryAll(t));for(let n of this.children)e=e.concat(n.deepQueryAll(t));return e},deepFindAll:function(t){return this.deepQueryAll(t).map((t=>L(t)))},rect:function(){return"function"==typeof this.getBoundingClientRect?this.getBoundingClientRect():{}},offset:function(t){t&&["width","height","left","right","top","bottom"].forEach((e=>{e in t&&(this.style[e]=t[e]+"px")}));var e=this.rect();return{top:e.top+window.scrollY,left:e.left+window.scrollX}},x:function(t){return this.left+this.width/2-t/2}},D={top:function(){return this.offset().top},left:function(){return this.offset().left},width:function(){return this.rect().width},height:function(){return this.rect().height},text:function(){return this.textContent},classArray:function(){return Array.from(this.classList)},childrenArray:function(){return Array.from(this.children)}};for(let[t,e]of Object.entries(k))Element.prototype[t]=e;for(let[t,e]of Object.entries(D))Object.defineProperty(Element.prototype,t,{get:e,configurable:!0});class R{constructor(t){this._childMap=new Map,this.key="string"==typeof t?t:o(),this.containsKey=this.childMap.has}set childMap(t){for(let[e,n]of t)n instanceof R&&this.add(n)}get childMap(){return this._childMap}get kidsum(){return this.childMap.size}get hasKids(){return this.kidsum>0}get shape(){return this.shapePrefix()}get master(){return null==this.parent||null==this.parent.parent?this.parent:this.parent.master}get children(){return Array.from(this.childMap.values())}get depthKey(){return this.parent?this.parent.depthKey+"<~<"+this.key:this.key}get allChildren(){if(!this.hasKids)return null;let t=this.children;for(let e of t){let n=e.allChildren;n&&(t=t.concat(n))}return t}get(t){return this.childMap.get(t)}find(t){if(this.childMap.has(t))return this.childMap.get(t);for(let e of this.childMap.values()){let n;try{n=e.find(t)}catch{}if(n)return n}}adopt(...t){for(let e of t)this.add(e);return this}add(t,n=!1){return t?!n&&this.childMap.has(t.key)?(t.key=`${t.key}<${s()}`,this.add(t)):(t.parent=this,void this.childMap.set(t.key,t)):e(`Could not add [${t}] to [${this.id}]`)}delete(t){return this.remove(t)}remove(t){this.childMap.get(t)&&this.childMap.delete(t)}shapePrefix(t=""){let e=`${t}| ${this.type} - ${this.key} \n`;if(this.hasKids){t+="| ";for(let n of this.children)e+=n.shapePrefix(t)}return e}}const z={parent:(t,e)=>{t.parent=e},value:(t,e)=>{t.value=e},key:(t,e)=>{t.key=e},class:(t,e)=>{t._class=e},element:(t,n)=>{if(!(n instanceof Element))return e(`Could not add ${n} as the element of [${t}]`);t.element=n},children:(t,e)=>{if(e.constructor==Array)return t.buildAry(e);t.build(e)},childTemplate:(t,e)=>{}};function P(t,e){return{val:t,set:e}}function N(t,e){return t=e.min?Math.max(e.min,t):t,e.max?Math.min(e.max,t):t}function K(t,n){return function(t){return t&&null!=t.min&&null!=t.max}(n)?(null==t&&(t=n.min),t=(t=t>n.max?n.min:t)<n.min?n.max:t):e(`Could not loop value, since range (${JSON.stringify(n)}) is unbounded`)}class q extends R{constructor(t,e){super(),p(this,"export"),this.actionChain=new r,this._events=new Map,"object"==typeof t?function(t,e){let n=new Map;for(let[i,r]of Object.entries(t))z.hasOwnProperty(i)?z[i](e,r):n.set(i,r);e.element&&e.element.whenInDOM((t=>{for(let[i,r]of n)if(i=i.toLowerCase(),i.includes("on")){let n=i.split("on")[1].trim();t.listenTo(n,(()=>{e.action(r)}))}}))}(t,this):this.key=t,this.element||this.as()}listenTo(t,e){return this.element.listenTo(t,e.bind(this)),this}_addToEventChain(t,...e){let n=this._events.get(t);if(n){let i=n.add(...e);return this._events.set(t,n),i}return null}createEvent(t,...e){let n=new r(this);return this._events.set(t,n),e.length>0&&this.on(t,e),this}createEvents(...t){return t.forEach((t=>{this.createEvent(t)})),this}triggerEvents(t,...e){return t.forEach((t=>{this.triggerEvent(t,...e)})),this}triggerEvent(t,...e){return this._events.has(t)?(this._events.get(t).execAs(this,...e),this):O.throwSoft(`pragma doesnt have ${event} - cannot .triggerEvent("${event}")]`,this)}_on(t,...e){let n=this._addToEventChain(t,...e);return null===n?O.throwSoft(`pragma doesnt have ${t} - cannot .on("${t}")`,this):n}on(){return this._on(...arguments),this}_onNext(t,e){this._on(t,(function(){return e(...arguments),t=>{t.selfDestruct()}}))}onNext(){return this._onNext(...arguments),this}createWires(...t){return t.forEach((t=>this.createWire(t))),this}createWire(t){let e={change:`${t}Change`,set:`${t}Set`};return this.createEvents(e.change,e.set),Object.defineProperty(this,t,{set:n=>{let i=function(t,e,n){if(n)return P(K(t,n),!0);if(e){let n=N(t,e);return P(n,n===t)}return P(t,!0)}(n,this[`_${t}Range`],this[`_${t}Loop`]);const r=this[`_${t}`];i.set&&i.val!==r&&(this[`_${t}`]=i.val,this.triggerEvent(e.change,i.val,r)),this.triggerEvent(e.set,n,r)},get:()=>this[`_${t}`]}),this[`set${t.capitalize()}`]=e=>(this[`${t}`]=e,this),this[`set${t.capitalize()}Silently`]=e=>(this[`_${t}`]=e,this),this[`set${t.capitalize()}Loop`]=(e,n)=>(this[`_${t}Loop`]={min:e,max:n},this),this[`set${t.capitalize()}Range`]=(e,n)=>(this[`_${t}Range`]={min:e,max:n},this),this}get _e(){return this.element}setElement(t,e=!0){return this.elementDOM=t,e&&this.element.id&&(this.id=this.element.id),this}get element(){return this.elementDOM}set element(t){this.setElement(t)}setRange(t=null,e=null){return this.range=this.range||{},this.range.min=null===t?this.range.min:t,this.range.max=null===e?this.range.max:e,this}breakLoop(){return this._loopVal=!1,this}setLoop(t,e){return this.setRange(t,e),this._loopVal=!0,this}get dv(){return this.v-this._lv}get value(){return this.v}setValue(t){return this.value=t,this}set value(t){let e=function(t,e,n){if(!e)return P(t,!0);if(n)return P(K(t,e),!0);let i=N(t,e);return P(i,i==t)}(t,this.range,this._loopVal);e.set&&(this._lv=this.v,this.v=e.val,this.exec())}exec(){return this.actionChain.execAs(this,...arguments),this}setKey(t){return this.key=t,this}set key(t){this._KEY=null==t?l():t}get key(){return this._KEY}set id(t){this.element&&(this.element.id=this.id)}get id(){return g(this.key)}buildAry(t){for(let e of t)this.add(new q(e,this));return this}build(...t){return this.buildAry(t)}as(t=null,e){return t=t||`div#${this.id}.pragma`,this.setElement(L(t,e),!1),this}addExport(t){this.exports=this.exports||new Set,this.exports.add(t)}export(...t){for(let e of t)this.addExport(e)}import(...t){let e=new r;for(let n of t)"function"==typeof n&&(n=n()),n.exports&&O.mimic(this,n,n.exports),n.exportChain&&e.add((t=>{n.exportChain.exec(this)}));return e.exec(),this}from(t){return t.exports&&O.mimic(this,t,t.exports),t.exportChain&&t.exportChain.exec(this),this}wireTo(t){let e=this;return t.do((function(){e.value=this.value})),this}do(){return this.actionChain.add(...arguments),this}extend(t,e){return O.overwrite(this,t,e),this}run(...t){let n=t[0];return"function"==typeof n?this._runAry(t):"object"==typeof n?this._runAry(Object.values(n)):e(`Could not run [${t}] as [${this}]`),this}_runAry(t){for(let e of t)this.runAs(e)}runAs(t){return t.bind(this)()}containAry(t,n="append"){for(let i of t)super.add(i),i.isRendered?e(`[${i}] is already appended`):this.element[n](i);return this}contain(...t){return this.containAry(t)}containFirst(...t){return this.containAry(t.reverse(),"prepend")}pragmatize(){return this.element.appendTo(this.parent&&this.parent.element||"body"),this}pragmatizeAt(t){return this.element.appendTo(t),this}addListeners(t){for(let[e,n]of Object.entries(t))this.on(e).do(n);return this}}const I=["html","css","addClass","removeClass","toggleClass","setId","append","prepend","appendTo","prependTo","setData"];for(let t of I)q.prototype[t]=function(){return this.element[t](...arguments),this};const F=["getData"];for(let t of F)q.prototype[t]=function(){return this.element[t](...arguments)};const W=["offset","text","top","left","width","height","x","classArray"];for(let t of W)Object.defineProperty(q.prototype,t,{get:function(){return this.element[t]}});globalThis.pragmaSpace||(globalThis.pragmaSpace={}),globalThis.pragmaSpace.integrateMousetrap=function(t){"function"==typeof t&&(q.prototype.bind=function(e,n,i){let r=this;return t.bind(e,(function(){return r.runAs(n)}),i),this},globalThis.pragmaSpace.mousetrapIntegration=!0,i("Mousetrap configuration detected! Extended Pragmas to support .bind() method!"))};try{globalThis.pragmaSpace.integrateMousetrap(Mousetrap)}catch(t){n("Tried to integrate extensions, but failed. To disable,\n this attempt: globalThis.pragmaSpace.integrate3rdParties = false")}const V=(t,e)=>new q(t,e),Q=t=>null!==t&&"object"==typeof t;function B(t,e){if(!Q(t)||!Q(e))return e;for(let[n,i]of Object.entries(e))n in e&&(t[n]=B(t[n],e[n]));return t}class H{static watcher=V("jolene-watcher").createEvents("set","get");static on(){return H.watcher.on(...arguments)}static setLocal(t,e){return window.localStorage.setItem("jolene",JSON.stringify({[t]:e}))}static getLocal(t=null){let e=JSON.parse(window.localStorage.getItem("jolene"));return null==e?null:null==t?e:e[t]}static set(t,e){H.watcher.triggerEvent("set",t,e);let n=t.split(">").map((t=>t.trim())),i=n.reduceRight(((t,i,r)=>({[i]:r==n.length-1?e:Object.assign({},t),lastModified:new Date})),{}),r=n[0],s=B(H._get(r),i);return H.setLocal(r,s[r]),e}static _get(...t){return t.slice(1).reduce(((t,e)=>null!=t&&Q(t)&&e in t?t[e]:null),H.getLocal(t[0]))}static get(t=null){if(null===t)return H.getLocal();let e=t.split(">").map((t=>t.trim())),n=H._get(...e);return H.watcher.triggerEvent("get",t.trim(),n),n}}t.deepMerge=B,t.isObj=Q,t.jolene=H,Object.defineProperty(t,"__esModule",{value:!0})})); |
{ | ||
"name": "jolenejs", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "jolenejs is awesome", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24310
76
1
1