dphelper 3.2.5 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dphelper.umd.js +2 -2
  2. package/index.js +2 -2
  3. package/package.json +1 -1
  4. package/docs/SUMMARY.md +0 -54
  5. package/docs/tools/ai.md +0 -25
  6. package/docs/tools/anchor.md +0 -33
  7. package/docs/tools/array.md +0 -36
  8. package/docs/tools/audio.md +0 -30
  9. package/docs/tools/avoid.md +0 -28
  10. package/docs/tools/browser.md +0 -45
  11. package/docs/tools/check.md +0 -24
  12. package/docs/tools/color.md +0 -28
  13. package/docs/tools/cookie.md +0 -27
  14. package/docs/tools/coords.md +0 -28
  15. package/docs/tools/credits.md +0 -28
  16. package/docs/tools/date.md +0 -44
  17. package/docs/tools/disable.md +0 -28
  18. package/docs/tools/dispatch.md +0 -26
  19. package/docs/tools/element.md +0 -25
  20. package/docs/tools/event.md +0 -27
  21. package/docs/tools/form.md +0 -49
  22. package/docs/tools/format.md +0 -25
  23. package/docs/tools/json.md +0 -28
  24. package/docs/tools/load.md +0 -26
  25. package/docs/tools/logging.md +0 -27
  26. package/docs/tools/math.md +0 -28
  27. package/docs/tools/memory.md +0 -25
  28. package/docs/tools/navigation.md +0 -43
  29. package/docs/tools/net.md +0 -24
  30. package/docs/tools/obj.md +0 -34
  31. package/docs/tools/path.md +0 -46
  32. package/docs/tools/promise.md +0 -24
  33. package/docs/tools/sanitize.md +0 -24
  34. package/docs/tools/screen.md +0 -25
  35. package/docs/tools/scrollbar.md +0 -29
  36. package/docs/tools/security.md +0 -32
  37. package/docs/tools/shortcut.md +0 -24
  38. package/docs/tools/socket.md +0 -29
  39. package/docs/tools/svg.md +0 -29
  40. package/docs/tools/sync.md +0 -25
  41. package/docs/tools/system.md +0 -32
  42. package/docs/tools/terminal.md +0 -28
  43. package/docs/tools/text.md +0 -28
  44. package/docs/tools/timer.md +0 -25
  45. package/docs/tools/tools.md +0 -26
  46. package/docs/tools/translators.md +0 -24
  47. package/docs/tools/trigger.md +0 -26
  48. package/docs/tools/type.md +0 -27
  49. package/docs/tools/ui.md +0 -45
  50. package/docs/tools/window.md +0 -30
package/dphelper.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var U={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var F="3.2.5",I=globalThis.dphelper;if(I&&I.version&&I.version<F)try{delete globalThis.dphelper}catch{}var R=Object.getOwnPropertyDescriptor(globalThis,"dphelper");R&&!R.configurable?R.writable&&globalThis.dphelper===void 0&&(globalThis.dphelper={}):Object.defineProperty(globalThis,"dphelper",{value:globalThis.dphelper||{},writable:!0,configurable:!0,enumerable:!1});globalThis.dphelper&&Object.defineProperties(globalThis.dphelper,{_list:{value:{scripts:[],sockets:[],...U},configurable:!0,writable:!0},version:{value:F,configurable:!0,writable:!0},isServer:{value:typeof window>"u",configurable:!0,writable:!0},isBrowser:{value:typeof window<"u",configurable:!0,writable:!0}});var C=globalThis.dphelper;Object.defineProperty(C,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:!1,configurable:!1,enumerable:!1}),r?.lock&&Object.freeze(e[t.name])},writable:!1,configurable:!1,enumerable:!1});Object.defineProperty(C,"setDescription",{value:(e,t)=>{Object.defineProperties(C,{[e.name]:{value:t,writable:!1,configurable:!1,enumerable:!1}}),Object.keys(t).map(r=>(Object.defineProperties(C[e.name],{[r]:{writable:!1,configurable:!1,enumerable:!1}}),null)),C.setProps(C,e,{writable:!1,configurable:!1,enumerable:!1}),C._list.scripts.push(e)}});var ee={name:"ai",active:!0,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:!0,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:!0,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},_=e=>e===null||typeof e!="object",L=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
1
+ "use strict";(()=>{var U={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var F="3.2.6",I=globalThis.dphelper;if(I&&I.version&&I.version<F)try{delete globalThis.dphelper}catch{}var R=Object.getOwnPropertyDescriptor(globalThis,"dphelper");R&&!R.configurable?R.writable&&globalThis.dphelper===void 0&&(globalThis.dphelper={}):Object.defineProperty(globalThis,"dphelper",{value:globalThis.dphelper||{},writable:!0,configurable:!0,enumerable:!1});globalThis.dphelper&&Object.defineProperties(globalThis.dphelper,{_list:{value:{scripts:[],sockets:[],...U},configurable:!0,writable:!0},version:{value:F,configurable:!0,writable:!0},isServer:{value:typeof window>"u",configurable:!0,writable:!0},isBrowser:{value:typeof window<"u",configurable:!0,writable:!0}});var C=globalThis.dphelper;Object.defineProperty(C,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:!1,configurable:!1,enumerable:!1}),r?.lock&&Object.freeze(e[t.name])},writable:!1,configurable:!1,enumerable:!1});Object.defineProperty(C,"setDescription",{value:(e,t)=>{Object.defineProperties(C,{[e.name]:{value:t,writable:!1,configurable:!1,enumerable:!1}}),Object.keys(t).map(r=>(Object.defineProperties(C[e.name],{[r]:{writable:!1,configurable:!1,enumerable:!1}}),null)),C.setProps(C,e,{writable:!1,configurable:!1,enumerable:!1}),C._list.scripts.push(e)}});var ee={name:"ai",active:!0,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:!0,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:!0,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},_=e=>e===null||typeof e!="object",L=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
2
2
  `)||e.trim()!==e?`"${e.replace(/"/g,'\\"')}"`:e||'""':String(e),A=(e,t=0)=>{let r=" ".repeat(t);if(_(e))return L(e);if(Array.isArray(e)){if(e.length===0)return"[0]:";let n=e[0];if(!_(n)&&!Array.isArray(n)){let o=Object.keys(n),a=`[${e.length}]{${o.join(",")}}:`;for(let i of e){let s=o.map(l=>L(i[l])).join(",");a+=`
3
3
  ${r} ${s}`}return a}else return`[${e.length}]: `+e.map(L).join(",")}else return Object.entries(e).map(([n,o])=>{let a=n.includes(" ")||n.includes(":")?`"${n}"`:n;if(!_(o)){let i=A(o,t+1);return i.startsWith("[")?`${a}${i}`:`${a}:
4
4
  ${r}${i}`}return`${a}: ${L(o)}`}).join(`
@@ -160,4 +160,4 @@ ${t(i,`${n} `)}${n}</${a}>
160
160
  height=${o/d},
161
161
  top=${u},
162
162
  left=${c}
163
- `);onfocus=()=>p?.focus()},onBeforeUnLoad:e=>{let t="You have made some changes which you might want to save.",r=o=>(o.preventDefault(),t),n=e?document.querySelector(e):null;n&&n.addEventListener("input",()=>{n.value!==""?(P=!0,addEventListener("beforeunload",r,{capture:!0})):(P=!1,removeEventListener("beforeunload",r,{capture:!0}))}),X===!1&&(document.body.addEventListener("click",o=>{let a=o.target;if(a&&a.tagName.toLowerCase()==="img"&&P===!0){if(confirm(t)===!0){P=!1;return}o.preventDefault()}}),X=!0),addEventListener("popstate",o=>{if(P===!0){if(confirm(t)===!0){P=!1;return}o.stopImmediatePropagation(),o.preventDefault();return}}),onbeforeunload=o=>{if(P===!0)return o.preventDefault(),o.returnValue=t}},purge:(e=document,t=1e4)=>{setTimeout(()=>{if(!e)return;let r=e.attributes;if(r){let n=r.length;for(let o=0;o<n;o+=1){let a=r[o].name;typeof e[a]=="function"&&(e[a]=null),typeof e[a]>"u"&&(e[a]=null)}}if(r=e.childNodes,r){let n=r.length;for(let o=0;o<n;o+=1)dphelper.purge(e.childNodes[o])}},t)},stopZoomWheel:()=>{addEventListener("wheel",e=>{e.ctrlKey&&e.preventDefault()},{passive:!1}),addEventListener("keydown",e=>{let t=dphelper.event.keys(e);["+","-","="].includes(t.key)&&t.ctrl&&e.preventDefault()})},setZoom:(e="html",t=1)=>{t<0&&(t=1);let r=document.querySelector(e);return r&&(r.style.zoom=String(t)),`New zoom value: ${t*100}% (css: ${t})`},getZoom:(e="html")=>{let t=document.querySelector(e);return Number(t?.style.zoom||1)}};dphelper?.setDescription(Kt,Zt);var Xt=setInterval(()=>{let e=dphelper?.socket?.list(),t=[];e&&(e.map(r=>(t.push(r.url),!1)),dphelper._list.sockets=t,t&&clearInterval(Xt))},1e3);Object.preventExtensions(dphelper);Object.seal(dphelper);var tn=dphelper;})();
163
+ `);onfocus=()=>p?.focus()},onBeforeUnLoad:e=>{let t="You have made some changes which you might want to save.",r=o=>(o.preventDefault(),t),n=e?document.querySelector(e):null;n&&n.addEventListener("input",()=>{n.value!==""?(P=!0,addEventListener("beforeunload",r,{capture:!0})):(P=!1,removeEventListener("beforeunload",r,{capture:!0}))}),X===!1&&(document.body.addEventListener("click",o=>{let a=o.target;if(a&&a.tagName.toLowerCase()==="img"&&P===!0){if(confirm(t)===!0){P=!1;return}o.preventDefault()}}),X=!0),addEventListener("popstate",o=>{if(P===!0){if(confirm(t)===!0){P=!1;return}o.stopImmediatePropagation(),o.preventDefault();return}}),onbeforeunload=o=>{if(P===!0)return o.preventDefault(),o.returnValue=t}},purge:(e=document,t=1e4)=>{setTimeout(()=>{if(!e)return;let r=e.attributes;if(r){let n=r.length;for(let o=0;o<n;o+=1){let a=r[o].name;typeof e[a]=="function"&&(e[a]=null),typeof e[a]>"u"&&(e[a]=null)}}if(r=e.childNodes,r){let n=r.length;for(let o=0;o<n;o+=1)dphelper.purge(e.childNodes[o])}},t)},stopZoomWheel:()=>{addEventListener("wheel",e=>{e.ctrlKey&&e.preventDefault()},{passive:!1}),addEventListener("keydown",e=>{let t=dphelper.event.keys(e);["+","-","="].includes(t.key)&&t.ctrl&&e.preventDefault()})},setZoom:(e="html",t=1)=>{t<0&&(t=1);let r=document.querySelector(e);return r&&(r.style.zoom=String(t)),`New zoom value: ${t*100}% (css: ${t})`},getZoom:(e="html")=>{let t=document.querySelector(e);return Number(t?.style.zoom||1)}};dphelper?.setDescription(Kt,Zt);var Xt=setInterval(()=>{dphelper._list||(dphelper._list={sockets:[],scripts:[]});let e=dphelper?.socket?.list(),t=[];e&&(e.map(r=>(t.push(r.url),!1)),dphelper._list.sockets=t,t&&clearInterval(Xt))},1e3);Object.preventExtensions(dphelper);Object.seal(dphelper);var tn=dphelper;})();
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var U={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var F="3.2.5",I=globalThis.dphelper;if(I&&I.version&&I.version<F)try{delete globalThis.dphelper}catch{}var R=Object.getOwnPropertyDescriptor(globalThis,"dphelper");R&&!R.configurable?R.writable&&globalThis.dphelper===void 0&&(globalThis.dphelper={}):Object.defineProperty(globalThis,"dphelper",{value:globalThis.dphelper||{},writable:!0,configurable:!0,enumerable:!1});globalThis.dphelper&&Object.defineProperties(globalThis.dphelper,{_list:{value:{scripts:[],sockets:[],...U},configurable:!0,writable:!0},version:{value:F,configurable:!0,writable:!0},isServer:{value:typeof window>"u",configurable:!0,writable:!0},isBrowser:{value:typeof window<"u",configurable:!0,writable:!0}});var C=globalThis.dphelper;Object.defineProperty(C,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:!1,configurable:!1,enumerable:!1}),r?.lock&&Object.freeze(e[t.name])},writable:!1,configurable:!1,enumerable:!1});Object.defineProperty(C,"setDescription",{value:(e,t)=>{Object.defineProperties(C,{[e.name]:{value:t,writable:!1,configurable:!1,enumerable:!1}}),Object.keys(t).map(r=>(Object.defineProperties(C[e.name],{[r]:{writable:!1,configurable:!1,enumerable:!1}}),null)),C.setProps(C,e,{writable:!1,configurable:!1,enumerable:!1}),C._list.scripts.push(e)}});var ee={name:"ai",active:!0,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:!0,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:!0,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},_=e=>e===null||typeof e!="object",L=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
1
+ var U={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var F="3.2.6",I=globalThis.dphelper;if(I&&I.version&&I.version<F)try{delete globalThis.dphelper}catch{}var R=Object.getOwnPropertyDescriptor(globalThis,"dphelper");R&&!R.configurable?R.writable&&globalThis.dphelper===void 0&&(globalThis.dphelper={}):Object.defineProperty(globalThis,"dphelper",{value:globalThis.dphelper||{},writable:!0,configurable:!0,enumerable:!1});globalThis.dphelper&&Object.defineProperties(globalThis.dphelper,{_list:{value:{scripts:[],sockets:[],...U},configurable:!0,writable:!0},version:{value:F,configurable:!0,writable:!0},isServer:{value:typeof window>"u",configurable:!0,writable:!0},isBrowser:{value:typeof window<"u",configurable:!0,writable:!0}});var C=globalThis.dphelper;Object.defineProperty(C,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:!1,configurable:!1,enumerable:!1}),r?.lock&&Object.freeze(e[t.name])},writable:!1,configurable:!1,enumerable:!1});Object.defineProperty(C,"setDescription",{value:(e,t)=>{Object.defineProperties(C,{[e.name]:{value:t,writable:!1,configurable:!1,enumerable:!1}}),Object.keys(t).map(r=>(Object.defineProperties(C[e.name],{[r]:{writable:!1,configurable:!1,enumerable:!1}}),null)),C.setProps(C,e,{writable:!1,configurable:!1,enumerable:!1}),C._list.scripts.push(e)}});var ee={name:"ai",active:!0,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:!0,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:!0,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:!0,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},_=e=>e===null||typeof e!="object",L=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
2
2
  `)||e.trim()!==e?`"${e.replace(/"/g,'\\"')}"`:e||'""':String(e),A=(e,t=0)=>{let r=" ".repeat(t);if(_(e))return L(e);if(Array.isArray(e)){if(e.length===0)return"[0]:";let n=e[0];if(!_(n)&&!Array.isArray(n)){let o=Object.keys(n),a=`[${e.length}]{${o.join(",")}}:`;for(let i of e){let s=o.map(l=>L(i[l])).join(",");a+=`
3
3
  ${r} ${s}`}return a}else return`[${e.length}]: `+e.map(L).join(",")}else return Object.entries(e).map(([n,o])=>{let a=n.includes(" ")||n.includes(":")?`"${n}"`:n;if(!_(o)){let i=A(o,t+1);return i.startsWith("[")?`${a}${i}`:`${a}:
4
4
  ${r}${i}`}return`${a}: ${L(o)}`}).join(`
@@ -160,4 +160,4 @@ ${t(i,`${n} `)}${n}</${a}>
160
160
  height=${o/d},
161
161
  top=${u},
162
162
  left=${c}
163
- `);onfocus=()=>p?.focus()},onBeforeUnLoad:e=>{let t="You have made some changes which you might want to save.",r=o=>(o.preventDefault(),t),n=e?document.querySelector(e):null;n&&n.addEventListener("input",()=>{n.value!==""?(P=!0,addEventListener("beforeunload",r,{capture:!0})):(P=!1,removeEventListener("beforeunload",r,{capture:!0}))}),X===!1&&(document.body.addEventListener("click",o=>{let a=o.target;if(a&&a.tagName.toLowerCase()==="img"&&P===!0){if(confirm(t)===!0){P=!1;return}o.preventDefault()}}),X=!0),addEventListener("popstate",o=>{if(P===!0){if(confirm(t)===!0){P=!1;return}o.stopImmediatePropagation(),o.preventDefault();return}}),onbeforeunload=o=>{if(P===!0)return o.preventDefault(),o.returnValue=t}},purge:(e=document,t=1e4)=>{setTimeout(()=>{if(!e)return;let r=e.attributes;if(r){let n=r.length;for(let o=0;o<n;o+=1){let a=r[o].name;typeof e[a]=="function"&&(e[a]=null),typeof e[a]>"u"&&(e[a]=null)}}if(r=e.childNodes,r){let n=r.length;for(let o=0;o<n;o+=1)dphelper.purge(e.childNodes[o])}},t)},stopZoomWheel:()=>{addEventListener("wheel",e=>{e.ctrlKey&&e.preventDefault()},{passive:!1}),addEventListener("keydown",e=>{let t=dphelper.event.keys(e);["+","-","="].includes(t.key)&&t.ctrl&&e.preventDefault()})},setZoom:(e="html",t=1)=>{t<0&&(t=1);let r=document.querySelector(e);return r&&(r.style.zoom=String(t)),`New zoom value: ${t*100}% (css: ${t})`},getZoom:(e="html")=>{let t=document.querySelector(e);return Number(t?.style.zoom||1)}};dphelper?.setDescription(Kt,Zt);var Xt=setInterval(()=>{let e=dphelper?.socket?.list(),t=[];e&&(e.map(r=>(t.push(r.url),!1)),dphelper._list.sockets=t,t&&clearInterval(Xt))},1e3);Object.preventExtensions(dphelper);Object.seal(dphelper);var tn=dphelper;export{tn as default};
163
+ `);onfocus=()=>p?.focus()},onBeforeUnLoad:e=>{let t="You have made some changes which you might want to save.",r=o=>(o.preventDefault(),t),n=e?document.querySelector(e):null;n&&n.addEventListener("input",()=>{n.value!==""?(P=!0,addEventListener("beforeunload",r,{capture:!0})):(P=!1,removeEventListener("beforeunload",r,{capture:!0}))}),X===!1&&(document.body.addEventListener("click",o=>{let a=o.target;if(a&&a.tagName.toLowerCase()==="img"&&P===!0){if(confirm(t)===!0){P=!1;return}o.preventDefault()}}),X=!0),addEventListener("popstate",o=>{if(P===!0){if(confirm(t)===!0){P=!1;return}o.stopImmediatePropagation(),o.preventDefault();return}}),onbeforeunload=o=>{if(P===!0)return o.preventDefault(),o.returnValue=t}},purge:(e=document,t=1e4)=>{setTimeout(()=>{if(!e)return;let r=e.attributes;if(r){let n=r.length;for(let o=0;o<n;o+=1){let a=r[o].name;typeof e[a]=="function"&&(e[a]=null),typeof e[a]>"u"&&(e[a]=null)}}if(r=e.childNodes,r){let n=r.length;for(let o=0;o<n;o+=1)dphelper.purge(e.childNodes[o])}},t)},stopZoomWheel:()=>{addEventListener("wheel",e=>{e.ctrlKey&&e.preventDefault()},{passive:!1}),addEventListener("keydown",e=>{let t=dphelper.event.keys(e);["+","-","="].includes(t.key)&&t.ctrl&&e.preventDefault()})},setZoom:(e="html",t=1)=>{t<0&&(t=1);let r=document.querySelector(e);return r&&(r.style.zoom=String(t)),`New zoom value: ${t*100}% (css: ${t})`},getZoom:(e="html")=>{let t=document.querySelector(e);return Number(t?.style.zoom||1)}};dphelper?.setDescription(Kt,Zt);var Xt=setInterval(()=>{dphelper._list||(dphelper._list={sockets:[],scripts:[]});let e=dphelper?.socket?.list(),t=[];e&&(e.map(r=>(t.push(r.url),!1)),dphelper._list.sockets=t,t&&clearInterval(Xt))},1e3);Object.preventExtensions(dphelper);Object.seal(dphelper);var tn=dphelper;export{tn as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dphelper",
3
- "version": "3.2.5",
3
+ "version": "3.2.6",
4
4
  "description": "dphelper devtools for developers",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/docs/SUMMARY.md DELETED
@@ -1,54 +0,0 @@
1
- # Table of contents
2
-
3
- * [dpHelper](../README.md)
4
-
5
- ## General
6
-
7
- ## Tools
8
-
9
- * [anchor](tools/anchor.md)
10
- * [ai](tools/ai.md)
11
- * [array](tools/array.md)
12
- * [audio](tools/audio.md)
13
- * [avoid](tools/avoid.md)
14
- * [browser](tools/browser.md)
15
- * [check](tools/check.md)
16
- * [color](tools/color.md)
17
- * [cookie](tools/cookie.md)
18
- * [coords](tools/coords.md)
19
- * [credits](tools/credits.md)
20
- * [date](tools/date.md)
21
- * [disable](tools/disable.md)
22
- * [dispatch](tools/dispatch.md)
23
- * [element](tools/element.md)
24
- * [event](tools/event.md)
25
- * [form](tools/form.md)
26
- * [format](tools/format.md)
27
- * [json](tools/json.md)
28
- * [load](tools/load.md)
29
- * [logging](tools/logging.md)
30
- * [math](tools/math.md)
31
- * [memory](tools/memory.md)
32
- * [navigation](tools/navigation.md)
33
- * [net](tools/net.md)
34
- * [obj](tools/obj.md)
35
- * [path](tools/path.md)
36
- * [promise](tools/promise.md)
37
- * [sanitize](tools/sanitize.md)
38
- * [screen](tools/screen.md)
39
- * [scrollbar](tools/scrollbar.md)
40
- * [security](tools/security.md)
41
- * [shortcut](tools/shortcut.md)
42
- * [socket](tools/socket.md)
43
- * [svg](tools/svg.md)
44
- * [sync](tools/sync.md)
45
- * [system](tools/system.md)
46
- * [terminal](tools/terminal.md)
47
- * [text](tools/text.md)
48
- * [timer](tools/timer.md)
49
- * [tools](tools/tools.md)
50
- * [translators](tools/translators.md)
51
- * [trigger](tools/trigger.md)
52
- * [type](tools/type.md)
53
- * [ui](tools/ui.md)
54
- * [window](tools/window.md)
package/docs/tools/ai.md DELETED
@@ -1,25 +0,0 @@
1
- # ai
2
-
3
- AI-related utilities and LLM helpers.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `tokenCount` | Estimates token count for LLMs (approx 4 chars/token) | `dphelper.ai.tokenCount(text)` |
10
- | `smartSanitize` | Removes PII (emails, phones, CC) for AI privacy | `dphelper.ai.smartSanitize(text)` |
11
-
12
- ## Description
13
-
14
- The AI module provides lightweight helpers to interact with LLMs, including privacy sanitization and token estimation to optimize API costs and security.
15
-
16
- ## Details
17
-
18
- - **Author:** Dario Passariello & Jo
19
- - **Version:** 0.0.1
20
- - **Creation Date:** 20260220
21
- - **Last Modified:** 20260220
22
-
23
- ---
24
-
25
- *Automatically generated document*
@@ -1,33 +0,0 @@
1
- # anchor
2
-
3
- Tool for managing HTML links and converting them into onclick events.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `toOnClick` | Converts all links in an element into onclick events | `dphelper.anchor.toOnClick('#container')` |
10
-
11
- ## Description
12
-
13
- This tool allows you to convert all links in an element into 'onclick'. Useful for working with SPAs while maintaining full compatibility with all browsers.
14
-
15
- ## Usage Examples
16
-
17
- ### Automatic link conversion
18
-
19
- ```javascript
20
- // Converts all links in the #main-content div
21
- dphelper.anchor.toOnClick('#main-content');
22
- ```
23
-
24
- ## Details
25
-
26
- - **Author:** Dario Passariello
27
- - **Version:** 0.0.1
28
- - **Creation Date:** 20210101
29
- - **Last Modified:** 20210101
30
-
31
- ---
32
-
33
- *Automatically generated document*
@@ -1,36 +0,0 @@
1
- # array
2
-
3
- Advanced utilities for JavaScript array manipulation.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `find` | Finds an element recursively | `dphelper.array.find(array, 'key')` |
10
- | `delete` | Deletes an element recursively by key | `dphelper.array.delete(array, 'key')` |
11
- | `merge` | Merges two objects/arrays recursively | `dphelper.array.merge(arrA, arrB)` |
12
- | `mergeByKey` | Merges two arrays of objects via a specific key | `dphelper.array.mergeByKey(arrA, arrB, 'id')` |
13
- | `duplicates` | Finds duplicate elements in an array | `dphelper.array.duplicates(array)` |
14
- | `even` / `odd` | Filters even or odd numbers | `dphelper.array.even(array)` |
15
- | `sumColumn` | Sums values of a column in a multidimensional array | `dphelper.array.sumColumn(arr, 0)` |
16
- | `shuffle` | Randomly shuffles elements | `dphelper.array.shuffle(array)` |
17
- | `generate` | Generates an array of random numbers | `dphelper.array.generate(10)` |
18
- | `testArrayInt` | Checks for missing numbers in a sequence | `dphelper.array.testArrayInt([1,2,4])` |
19
- | `rand32` | Generates an array of random 32-bit integers | `dphelper.array.rand32(5)` |
20
- | `match` | Finds intersections between two arrays of words | `dphelper.array.match(arrA, arrB)` |
21
- | `pathToJson` | Converts an array of paths into a JSON object | `dphelper.array.pathToJson(paths, '/')` |
22
-
23
- ## Description
24
-
25
- Tool for advanced array manipulation. Native functions (such as `unique` via Set, `sort`, or `structuredClone`) have been removed to encourage the use of modern JavaScript APIs.
26
-
27
- ## Details
28
-
29
- - **Author:** Dario Passariello
30
- - **Version:** 0.0.2
31
- - **Creation Date:** 20210101
32
- - **Last Modified:** 20260220
33
-
34
- ---
35
-
36
- *Automatically generated document*
@@ -1,30 +0,0 @@
1
- # audio
2
-
3
- Management of audio playback in web pages.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `play` | Plays an audio file or stops existing ones | `dphelper.audio.play('sound.mp3')` |
10
-
11
- ## Description
12
-
13
- Plays an audio file if it is not already playing. If called without arguments, it stops and removes **only** the audio elements previously created by `dphelper`, protecting other players on the page.
14
-
15
- ## Parameters
16
-
17
- - `file` - (Optional) Name of the audio file. If omitted, cleans up its own audio elements.
18
- - `path` - File path (default: "").
19
- - `loop` - Continuous playback (default: false).
20
-
21
- ## Details
22
-
23
- - **Author:** Dario Passariello
24
- - **Version:** 0.0.2
25
- - **Creation Date:** 20240924
26
- - **Last Modified:** 20260220
27
-
28
- ---
29
-
30
- *Automatically generated document*
@@ -1,28 +0,0 @@
1
- # avoid
2
-
3
- Utilities for preventing browser caching.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `cache` | Adds a cache-busting parameter to the URI | `dphelper.avoid.cache(uri)` |
10
-
11
- ## Description
12
-
13
- Appends a unique query parameter to a given URI to prevent the browser from using a cached version of the resource.
14
-
15
- ## Parameters
16
-
17
- - `uri` - The URI to which the cache-busting parameter will be added.
18
-
19
- ## Details
20
-
21
- - **Author:** Dario Passariello
22
- - **Version:** 0.0.1
23
- - **Creation Date:** 20210101
24
- - **Last Modified:** 20210101
25
-
26
- ---
27
-
28
- *Automatically generated document*
@@ -1,45 +0,0 @@
1
- # browser
2
-
3
- Functionality for navigation and browser state.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `state` | Pushes a new state to the history | `dphelper.browser.state([state, title, url])` |
10
- | `forw` | Moves forward in the history | `dphelper.browser.forw([number])` |
11
- | `back` | Moves backward in the history | `dphelper.browser.back([number])` |
12
- | `reload` | Reloads the page | `dphelper.browser.reload()` |
13
- | `href` | Navigates to a URL | `dphelper.browser.href()` |
14
- | `offLine` | Shows an offline message | `dphelper.browser.offLine()` |
15
- | `zoom` | Returns the zoom level | `dphelper.browser.zoom()` |
16
- | `status` | Returns a description of the HTTP status | `dphelper.browser.status()` |
17
-
18
- ## Description
19
-
20
- A complete tool for managing browser navigation, including history, URLs, and connection status.
21
-
22
- ## Usage Examples
23
-
24
- ### Change URL without reloading
25
-
26
- ```javascript
27
- dphelper.browser.state({ id: 1 }, "Page Title", "/new-url");
28
- ```
29
-
30
- ### Forced navigation
31
-
32
- ```javascript
33
- dphelper.browser.href("https://google.com");
34
- ```
35
-
36
- ## Details
37
-
38
- - **Author:** Dario Passariello
39
- - **Version:** 0.0.1
40
- - **Creation Date:** 20210101
41
- - **Last Modified:** 20210101
42
-
43
- ---
44
-
45
- *Automatically generated document*
@@ -1,24 +0,0 @@
1
- # check
2
-
3
- Validation and check utilities.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `version` | Compares two version strings | `dphelper.check.version([v1], [v2], [opts])` |
10
-
11
- ## Description
12
-
13
- Tool for validating versions and performing other checks.
14
-
15
- ## Details
16
-
17
- - **Author:** Dario Passariello
18
- - **Version:** 0.0.1
19
- - **Creation Date:** 20240829
20
- - **Last Modified:** 20240829
21
-
22
- ---
23
-
24
- *Automatically generated document*
@@ -1,28 +0,0 @@
1
- # color
2
-
3
- Utilities for color conversion and management.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `hex` | Converts a number (0-255) into a two-digit hexadecimal string | `dphelper.color.hex(255)` |
10
- | `toHex` | Converts an RGB array to a hexadecimal string | `dphelper.color.toHex([255, 0, 0])` |
11
- | `toRGB` | Converts a hexadecimal string to an RGB array | `dphelper.color.toRGB('#FF0000')` |
12
- | `oleColor` | Converts a hex color to OLE decimal format (used in legacy Windows) | `dphelper.color.oleColor('#FFFFFF')` |
13
- | `gradient` | Generates a color scale (array) between two shades | `dphelper.color.gradient('#000', '#FFF', 10)` |
14
-
15
- ## Description
16
-
17
- Tool for conversion between different color formats. Hexadecimal conversion logic has been modernized using native JavaScript methods.
18
-
19
- ## Details
20
-
21
- - **Author:** Dario Passariello
22
- - **Version:** 0.0.2
23
- - **Creation Date:** 20210101
24
- - **Last Modified:** 20260220
25
-
26
- ---
27
-
28
- *Automatically generated document*
@@ -1,27 +0,0 @@
1
- # cookie
2
-
3
- Management of browser cookies.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `set` | Creates a cookie with specified properties | `dphelper.cookie.set({name, value, time, path = '/'})` |
10
- | `get` | Retrieves the value of a cookie | `dphelper.cookie.get(name)` |
11
- | `delete` | Deletes a specific cookie | `dphelper.cookie.delete(name)` |
12
- | `removeAll` | Removes all cookies | `dphelper.cookie.removeAll()` |
13
-
14
- ## Description
15
-
16
- Complete tool for cookie management: creation, reading, and deletion.
17
-
18
- ## Details
19
-
20
- - **Author:** Dario Passariello
21
- - **Version:** 0.0.1
22
- - **Creation Date:** 20210101
23
- - **Last Modified:** 20240613
24
-
25
- ---
26
-
27
- *Automatically generated document*
@@ -1,28 +0,0 @@
1
- # coords
2
-
3
- Utilities for geographic calculations, coordinate conversions, and spatial mappings.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `degreesToRadians` | Converts degrees to radians | `dphelper.coords.degreesToRadians(180)` |
10
- | `latToMeters` | Approximates conversion from latitude to meters | `dphelper.coords.latToMeters([lat, lng])` |
11
- | `distance` | Calculates distance between two points (Haversine) in Km, Mi, and NMi | `dphelper.coords.distance(p1, p2)` |
12
- | `polarToCartesian` | Converts polar coordinates to Cartesian (X, Y) | `dphelper.coords.polarToCartesian(cx, cy, r, angle)` |
13
- | `mapDegreesToPixels` | Maps geographic degrees to pixel coordinates with padding | `dphelper.coords.mapDegreesToPixels(deg, min, max, pMin, pMax, pad)` |
14
-
15
- ## Description
16
-
17
- Specialized tool for trigonometric and geographic calculations. Mapping formulas (pixel/degrees) have been optimized and commented for better readability and geometric precision.
18
-
19
- ## Details
20
-
21
- - **Author:** Dario Passariello
22
- - **Version:** 0.0.2
23
- - **Creation Date:** 20210101
24
- - **Last Modified:** 20260220
25
-
26
- ---
27
-
28
- *Automatically generated document*
@@ -1,28 +0,0 @@
1
- # credits
2
-
3
- Log project information to the console.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `credits` | Logs project properties | `dphelper.credits(props)` |
10
-
11
- ## Description
12
-
13
- Logs various properties about a project to the console in a formatted manner.
14
-
15
- ## Parameters
16
-
17
- - `props` - The project properties (name, version, description, license, author, email).
18
-
19
- ## Details
20
-
21
- - **Author:** Dario Passariello
22
- - **Version:** 0.0.1
23
- - **Creation Date:** 20210101
24
- - **Last Modified:** 20210101
25
-
26
- ---
27
-
28
- *Automatically generated document*
@@ -1,44 +0,0 @@
1
- # date
2
-
3
- Advanced utilities for date management.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `toIso` | Converts a date to ISO format | `dphelper.date.toIso([value, int = 'en'])` |
10
- | `toMMDDYYYY` | Converts to MMDDYYYY format | `dphelper.date.toMMDDYYYY([value])` |
11
- | `toYYYYMMDD` | Converts to YYYYMMDD format | `dphelper.date.toYYYYMMDD([value])` |
12
- | `toHuman` | Converts to a human-readable format | `dphelper.date.toHuman([value])` |
13
- | `convert` | Converts dates between formats | `dphelper.date.convert()` |
14
-
15
- ## Description
16
-
17
- Complete tool for converting and formatting dates in various formats.
18
-
19
- ## Usage Examples
20
-
21
- ### Database Format
22
-
23
- ```javascript
24
- const dbDate = dphelper.date.toYYYYMMDD(new Date());
25
- console.log(dbDate); // '20260223'
26
- ```
27
-
28
- ### Human-Readable Format
29
-
30
- ```javascript
31
- const humanDate = dphelper.date.toHuman("20260223");
32
- console.log(humanDate); // '23 February 2026' (depends on locale)
33
- ```
34
-
35
- ## Details
36
-
37
- - **Author:** Dario Passariello
38
- - **Version:** 0.0.1
39
- - **Creation Date:** 20210101
40
- - **Last Modified:** 20230101
41
-
42
- ---
43
-
44
- *Automatically generated document*
@@ -1,28 +0,0 @@
1
- # disable
2
-
3
- Disabling browser functionalities on DOM elements.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `select` | Disables text selection | `dphelper.disable.select([el = 'body'])` |
10
- | `spellCheck` | Disables spell checking | `dphelper.disable.spellCheck([tmr = 5000])` |
11
- | `rightClick` | Disables the context menu | `dphelper.disable.rightClick([el = 'body'])` |
12
- | `copy` | Disables copy functionality | `dphelper.disable.copy([el = 'body'])` |
13
- | `paste` | Disables paste functionality | `dphelper.disable.paste([el = 'body'])` |
14
-
15
- ## Description
16
-
17
- Tool for disabling browser features on specific elements: text selection, copy, paste, right-click, and spell-check.
18
-
19
- ## Details
20
-
21
- - **Author:** Dario Passariello
22
- - **Version:** 0.0.1
23
- - **Creation Date:** 20210101
24
- - **Last Modified:** 20210101
25
-
26
- ---
27
-
28
- *Automatically generated document*
@@ -1,26 +0,0 @@
1
- # dispatch
2
-
3
- Custom event dispatching system.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `set` | Dispatches a custom event | `dphelper.dispatch.set([name, value])` |
10
- | `listen` | Listens for specified events | `dphelper.dispatch.listen([eventNames, callback=null], flag = true)` |
11
- | `remove` | Removes an event listener | `dphelper.dispatch.remove([eventNames, callback=null], flag = true)` |
12
-
13
- ## Description
14
-
15
- Tool for managing custom events: dispatch, listen, and remove.
16
-
17
- ## Details
18
-
19
- - **Author:** Dario Passariello
20
- - **Version:** 0.0.1
21
- - **Creation Date:** 20231231
22
- - **Last Modified:** 20240612
23
-
24
- ---
25
-
26
- *Automatically generated document*
@@ -1,25 +0,0 @@
1
- # element
2
-
3
- Advanced manipulation of DOM elements.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `fitScale` | Scales an element based on the window | `dphelper.element.fitScale([el = 'root', scale = 1, fit = false])` |
10
- | `scaleBasedOnWindow` | Scales based on window dimensions | `dphelper.element.scaleBasedOnWindow(elm, scale, fit)` |
11
-
12
- ## Description
13
-
14
- Tool for responsive scaling of DOM elements based on window size.
15
-
16
- ## Details
17
-
18
- - **Author:** Dario Passariello
19
- - **Version:** 0.0.1
20
- - **Creation Date:** 20230527
21
- - **Last Modified:** 20230527
22
-
23
- ---
24
-
25
- *Automatically generated document*
@@ -1,27 +0,0 @@
1
- # event
2
-
3
- Advanced management of DOM events.
4
-
5
- ## Functions
6
-
7
- | Function | Description | Example |
8
- |----------|-------------|---------|
9
- | `list` | Lists attached events | `dphelper.event.list([element])` |
10
- | `multi` | Attaches multiple event listeners | `dphelper.event.multi([element, eventNames, listener])` |
11
- | `copy` | Copies content to clipboard | `dphelper.event.copy([element])` |
12
- | `onDrag` | Manages drag functionality | `dphelper.event.onDrag([element])` |
13
-
14
- ## Description
15
-
16
- Tool for advanced event management: event listing, multiple listeners, and drag-and-drop support.
17
-
18
- ## Details
19
-
20
- - **Author:** Dario Passariello
21
- - **Version:** 0.0.1
22
- - **Creation Date:** 20210101
23
- - **Last Modified:** 20210101
24
-
25
- ---
26
-
27
- *Automatically generated document*