dphelper 4.5.2 → 4.6.0

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 (170) hide show
  1. package/COPYRIGHT.md +6 -6
  2. package/FUNDING.yml +12 -12
  3. package/LICENSE.md +21 -21
  4. package/README.md +397 -397
  5. package/SECURITY.md +26 -26
  6. package/SUMMARY.md +83 -83
  7. package/index.cjs +2 -2
  8. package/index.d.ts +1 -1
  9. package/index.js +2 -2
  10. package/llms.txt +73 -73
  11. package/modules/ai.cjs +1 -1
  12. package/modules/ai.d.ts +11 -11
  13. package/modules/ai.js +1 -1
  14. package/modules/anchor.cjs +1 -1
  15. package/modules/anchor.d.ts +6 -6
  16. package/modules/anchor.js +1 -1
  17. package/modules/array.cjs +1 -1
  18. package/modules/array.d.ts +21 -21
  19. package/modules/array.js +1 -1
  20. package/modules/audio.cjs +1 -1
  21. package/modules/audio.d.ts +10 -10
  22. package/modules/audio.js +1 -1
  23. package/modules/avoid.cjs +1 -1
  24. package/modules/avoid.d.ts +2 -2
  25. package/modules/avoid.js +1 -1
  26. package/modules/biometric.cjs +1 -1
  27. package/modules/biometric.d.ts +14 -14
  28. package/modules/biometric.js +1 -1
  29. package/modules/browser.cjs +1 -1
  30. package/modules/browser.d.ts +10 -10
  31. package/modules/browser.js +1 -1
  32. package/modules/check.cjs +1 -1
  33. package/modules/check.d.ts +4 -4
  34. package/modules/check.js +1 -1
  35. package/modules/color.cjs +1 -1
  36. package/modules/color.d.ts +6 -6
  37. package/modules/color.js +1 -1
  38. package/modules/compress.cjs +1 -1
  39. package/modules/compress.d.ts +13 -13
  40. package/modules/compress.js +1 -1
  41. package/modules/cookie.cjs +1 -1
  42. package/modules/cookie.d.ts +12 -12
  43. package/modules/cookie.js +1 -1
  44. package/modules/coords.cjs +1 -1
  45. package/modules/coords.d.ts +8 -8
  46. package/modules/coords.js +1 -1
  47. package/modules/credits.cjs +1 -1
  48. package/modules/credits.d.ts +11 -11
  49. package/modules/credits.js +1 -1
  50. package/modules/date.cjs +1 -1
  51. package/modules/date.d.ts +25 -25
  52. package/modules/date.js +1 -1
  53. package/modules/disable.cjs +1 -1
  54. package/modules/disable.d.ts +8 -8
  55. package/modules/disable.js +1 -1
  56. package/modules/dispatch.cjs +1 -1
  57. package/modules/dispatch.d.ts +4 -4
  58. package/modules/dispatch.js +1 -1
  59. package/modules/elements.cjs +1 -1
  60. package/modules/elements.d.ts +3 -3
  61. package/modules/elements.js +1 -1
  62. package/modules/events.cjs +1 -1
  63. package/modules/events.d.ts +6 -6
  64. package/modules/events.js +1 -1
  65. package/modules/fetch.cjs +1 -1
  66. package/modules/fetch.d.ts +15 -15
  67. package/modules/fetch.js +1 -1
  68. package/modules/form.cjs +1 -1
  69. package/modules/form.d.ts +13 -13
  70. package/modules/form.js +1 -1
  71. package/modules/format.cjs +1 -1
  72. package/modules/format.d.ts +3 -3
  73. package/modules/format.js +1 -1
  74. package/modules/i18n.cjs +1 -1
  75. package/modules/i18n.d.ts +11 -11
  76. package/modules/i18n.js +1 -1
  77. package/modules/image.cjs +1 -1
  78. package/modules/image.d.ts +13 -13
  79. package/modules/image.js +1 -1
  80. package/modules/json.cjs +1 -1
  81. package/modules/json.d.ts +8 -8
  82. package/modules/json.js +1 -1
  83. package/modules/load.cjs +1 -1
  84. package/modules/load.d.ts +8 -8
  85. package/modules/load.js +1 -1
  86. package/modules/logging.cjs +1 -1
  87. package/modules/logging.d.ts +8 -8
  88. package/modules/logging.js +1 -1
  89. package/modules/math.cjs +1 -1
  90. package/modules/math.d.ts +13 -13
  91. package/modules/math.js +1 -1
  92. package/modules/memory.cjs +1 -1
  93. package/modules/memory.d.ts +3 -3
  94. package/modules/memory.js +1 -1
  95. package/modules/navigation.cjs +1 -1
  96. package/modules/navigation.d.ts +4 -4
  97. package/modules/navigation.js +1 -1
  98. package/modules/net.cjs +1 -1
  99. package/modules/net.d.ts +10 -10
  100. package/modules/net.js +1 -1
  101. package/modules/objects.cjs +1 -1
  102. package/modules/objects.d.ts +15 -15
  103. package/modules/objects.js +1 -1
  104. package/modules/path.cjs +1 -1
  105. package/modules/path.d.ts +4 -4
  106. package/modules/path.js +1 -1
  107. package/modules/promise.cjs +1 -1
  108. package/modules/promise.d.ts +3 -3
  109. package/modules/promise.js +1 -1
  110. package/modules/sanitize.cjs +1 -1
  111. package/modules/sanitize.d.ts +2 -2
  112. package/modules/sanitize.js +1 -1
  113. package/modules/screen.cjs +1 -1
  114. package/modules/screen.d.ts +11 -11
  115. package/modules/screen.js +1 -1
  116. package/modules/scrollbar.cjs +1 -1
  117. package/modules/scrollbar.d.ts +9 -9
  118. package/modules/scrollbar.js +1 -1
  119. package/modules/security.cjs +1 -1
  120. package/modules/security.d.ts +15 -15
  121. package/modules/security.js +1 -1
  122. package/modules/shortcut.cjs +1 -1
  123. package/modules/shortcut.d.ts +2 -2
  124. package/modules/shortcut.js +1 -1
  125. package/modules/socket.cjs +1 -1
  126. package/modules/socket.d.ts +13 -13
  127. package/modules/socket.js +1 -1
  128. package/modules/sse.cjs +1 -1
  129. package/modules/sse.d.ts +8 -8
  130. package/modules/sse.js +1 -1
  131. package/modules/svg.cjs +1 -1
  132. package/modules/svg.d.ts +12 -12
  133. package/modules/svg.js +1 -1
  134. package/modules/sync.cjs +1 -1
  135. package/modules/sync.d.ts +13 -13
  136. package/modules/sync.js +1 -1
  137. package/modules/system.cjs +1 -1
  138. package/modules/system.d.ts +2 -2
  139. package/modules/system.js +1 -1
  140. package/modules/text.cjs +2 -2
  141. package/modules/text.d.ts +13 -12
  142. package/modules/text.js +2 -2
  143. package/modules/timer.cjs +1 -1
  144. package/modules/timer.d.ts +3 -3
  145. package/modules/timer.js +1 -1
  146. package/modules/tools.cjs +1 -1
  147. package/modules/tools.d.ts +5 -5
  148. package/modules/tools.js +1 -1
  149. package/modules/translators.cjs +1 -1
  150. package/modules/translators.d.ts +2 -2
  151. package/modules/translators.js +1 -1
  152. package/modules/triggers.cjs +1 -1
  153. package/modules/triggers.d.ts +43 -43
  154. package/modules/triggers.js +1 -1
  155. package/modules/types.cjs +1 -1
  156. package/modules/types.d.ts +5 -5
  157. package/modules/types.js +1 -1
  158. package/modules/ui.cjs +1 -1
  159. package/modules/ui.d.ts +3 -3
  160. package/modules/ui.js +1 -1
  161. package/modules/window.cjs +1 -1
  162. package/modules/window.d.ts +9 -9
  163. package/modules/window.js +1 -1
  164. package/modules/worker.cjs +1 -1
  165. package/modules/worker.d.ts +16 -16
  166. package/modules/worker.js +1 -1
  167. package/package.json +2 -2
  168. package/sbom.json +14 -9
  169. package/types/dphelper.d.ts +546 -545
  170. package/types/global.d.ts +8 -8
@@ -1,2 +1,2 @@
1
- 'use strict';var d={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var u={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...d},configurable:true,writable:true},version:{value:u.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var s=dphelper;Object.defineProperty(s,"setProps",{value:(e,n,a)=>{Object.defineProperty(e,n.name,a||{writable:false,configurable:false,enumerable:false}),a?.lock&&Object.freeze(e[n.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(s,"setDescription",{value:(e,n)=>{Object.defineProperties(s,{[e.name]:{value:n,writable:false,configurable:false,enumerable:false}}),Object.keys(n).map(a=>(Object.defineProperties(s[e.name],{[a]:{writable:false,configurable:false,enumerable:false}}),null)),s.setProps(s,e,{writable:false,configurable:false,enumerable:false}),s._list.scripts.push(e);}});var w={name:"navigation",active:true,subCommand:[{name:"ajax",version:"0.0.2",example:"dphelper.navigation.ajax()",author:"Dario Passariello",creationDate:"20260223",lastMod:"20260223",type:"function",active:true,description:"Vanilla AJAX Single Page Application (SPA) navigation engine.",env:"client",subCommand:[]},{name:"load",version:"0.0.1",example:"dphelper.navigation.load('/home')",author:"Dario Passariello",creationDate:"20260223",lastMod:"20260223",type:"function",active:true,description:"Loads a page via AJAX and injects it into the body.",env:"client",subCommand:[]}]},y={load:async e=>{let a=document.body,o=e.startsWith("/")?e.split("/")[1]||"home":e;if((!o||o==="")&&(o="home"),!document.querySelector(".loader")){let t=document.createElement("div");t.className="loader",t.innerHTML="<i></i>",t.style.opacity="0",t.style.transition="opacity 1000ms",a.appendChild(t),setTimeout(()=>t.style.opacity="1",10);}try{let t=await fetch(`${o}/`);if(!t.ok)throw new Error("Page not found");let i=await t.text(),r=i.match(/<body[^>]*>([\s\S]*)<\/body>/i),p=r?r[1]:i,m=f=>{let h=document.createElement("div");return h.textContent=f,h.innerHTML},b=dphelper?.sanitize?.html?dphelper.sanitize.html(p||""):m(p||"");a.innerHTML=b,window.scrollTo({top:0,behavior:"smooth"}),document.title=o.charAt(0).toUpperCase()+o.slice(1);let l=dphelper.path.rail();l&&l.length>0&&(a.className=a.className.replace(/path-\w+/g,"").trim(),a.classList.add(`path-${l[l.length-1]}`)),dphelper.navigation.ajax_running&&dphelper.navigation.ajax();}catch(t){console.error("Navigation error:",t);let i=window.location.origin;e.startsWith("/")&&!e.startsWith("//")&&!e.match(/^[a-zA-Z]:/)&&new URL(e,i).href.startsWith(i)&&(window.location.href=e);}},_bind:e=>{document.querySelectorAll(e).forEach(a=>{let o=a.getAttribute("href");if(!o||!o.startsWith("/")||o.includes("#"))return;let t=a.cloneNode(true);a.parentNode?.replaceChild(t,a),t.addEventListener("mouseup",i=>{let r=t.getAttribute("data-href")||o;history.pushState({href:r},"",r),dphelper.navigation.load(r),t.removeAttribute("href"),i.stopPropagation();});});},ajax:()=>{if(dphelper.navigation.ajax_running){dphelper.navigation._bind("a");return}dphelper.navigation.ajax_running=true,window.onpopstate=()=>dphelper.navigation.load(window.location.pathname),dphelper.navigation._bind("a"),globalThis.dp_hash_listener_set||(window.addEventListener("hashchange",()=>{let e=window.location.hash.substring(1);e&&document.getElementById(e)?.scrollIntoView({behavior:"smooth"});}),globalThis.dp_hash_listener_set=true);}};dphelper?.setDescription(w,y);var C=dphelper.navigation;
1
+ 'use strict';var d={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var u={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...d},configurable:true,writable:true},version:{value:u.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var s=dphelper;Object.defineProperty(s,"setProps",{value:(e,n,a)=>{Object.defineProperty(e,n.name,a||{writable:false,configurable:false,enumerable:false}),a?.lock&&Object.freeze(e[n.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(s,"setDescription",{value:(e,n)=>{Object.defineProperties(s,{[e.name]:{value:n,writable:false,configurable:false,enumerable:false}}),Object.keys(n).map(a=>(Object.defineProperties(s[e.name],{[a]:{writable:false,configurable:false,enumerable:false}}),null)),s.setProps(s,e,{writable:false,configurable:false,enumerable:false}),s._list.scripts.push(e);}});var w={name:"navigation",active:true,subCommand:[{name:"ajax",version:"0.0.2",example:"dphelper.navigation.ajax()",author:"Dario Passariello",creationDate:"20260223",lastMod:"20260223",type:"function",active:true,description:"Vanilla AJAX Single Page Application (SPA) navigation engine.",env:"client",subCommand:[]},{name:"load",version:"0.0.1",example:"dphelper.navigation.load('/home')",author:"Dario Passariello",creationDate:"20260223",lastMod:"20260223",type:"function",active:true,description:"Loads a page via AJAX and injects it into the body.",env:"client",subCommand:[]}]},y={load:async e=>{let a=document.body,o=e.startsWith("/")?e.split("/")[1]||"home":e;if((!o||o==="")&&(o="home"),!document.querySelector(".loader")){let t=document.createElement("div");t.className="loader",t.innerHTML="<i></i>",t.style.opacity="0",t.style.transition="opacity 1000ms",a.appendChild(t),setTimeout(()=>t.style.opacity="1",10);}try{let t=await fetch(`${o}/`);if(!t.ok)throw new Error("Page not found");let i=await t.text(),r=i.match(/<body[^>]*>([\s\S]*)<\/body>/i),p=r?r[1]:i,m=f=>{let h=document.createElement("div");return h.textContent=f,h.innerHTML},b=dphelper?.sanitize?.html?dphelper.sanitize.html(p||""):m(p||"");a.innerHTML=b,window.scrollTo({top:0,behavior:"smooth"}),document.title=o.charAt(0).toUpperCase()+o.slice(1);let l=dphelper.path.rail();l&&l.length>0&&(a.className=a.className.replace(/path-\w+/g,"").trim(),a.classList.add(`path-${l[l.length-1]}`)),dphelper.navigation.ajax_running&&dphelper.navigation.ajax();}catch(t){console.error("Navigation error:",t);let i=window.location.origin;e.startsWith("/")&&!e.startsWith("//")&&!e.match(/^[a-zA-Z]:/)&&new URL(e,i).href.startsWith(i)&&(window.location.href=e);}},_bind:e=>{document.querySelectorAll(e).forEach(a=>{let o=a.getAttribute("href");if(!o||!o.startsWith("/")||o.includes("#"))return;let t=a.cloneNode(true);a.parentNode?.replaceChild(t,a),t.addEventListener("mouseup",i=>{let r=t.getAttribute("data-href")||o;history.pushState({href:r},"",r),dphelper.navigation.load(r),t.removeAttribute("href"),i.stopPropagation();});});},ajax:()=>{if(dphelper.navigation.ajax_running){dphelper.navigation._bind("a");return}dphelper.navigation.ajax_running=true,window.onpopstate=()=>dphelper.navigation.load(window.location.pathname),dphelper.navigation._bind("a"),globalThis.dp_hash_listener_set||(window.addEventListener("hashchange",()=>{let e=window.location.hash.substring(1);e&&document.getElementById(e)?.scrollIntoView({behavior:"smooth"});}),globalThis.dp_hash_listener_set=true);}};dphelper?.setDescription(w,y);var C=dphelper.navigation;
2
2
  exports.navigation=C;
@@ -1,8 +1,8 @@
1
1
  /// <reference path="../types/dphelper.d.ts" />
2
- export interface NavigationTool {
3
- load(url: string): Promise<void>
4
- ajax(): void
5
- ajax_running?: boolean
2
+ export interface NavigationTool {
3
+ load(url: string): Promise<void>
4
+ ajax(): void
5
+ ajax_running?: boolean
6
6
  }
7
7
 
8
8
  export const navigation: NavigationTool
@@ -1,2 +1,2 @@
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 m={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...u},configurable:true,writable:true},version:{value:m.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var s=dphelper;Object.defineProperty(s,"setProps",{value:(e,n,a)=>{Object.defineProperty(e,n.name,a||{writable:false,configurable:false,enumerable:false}),a?.lock&&Object.freeze(e[n.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(s,"setDescription",{value:(e,n)=>{Object.defineProperties(s,{[e.name]:{value:n,writable:false,configurable:false,enumerable:false}}),Object.keys(n).map(a=>(Object.defineProperties(s[e.name],{[a]:{writable:false,configurable:false,enumerable:false}}),null)),s.setProps(s,e,{writable:false,configurable:false,enumerable:false}),s._list.scripts.push(e);}});var y={name:"navigation",active:true,subCommand:[{name:"ajax",version:"0.0.2",example:"dphelper.navigation.ajax()",author:"Dario Passariello",creationDate:"20260223",lastMod:"20260223",type:"function",active:true,description:"Vanilla AJAX Single Page Application (SPA) navigation engine.",env:"client",subCommand:[]},{name:"load",version:"0.0.1",example:"dphelper.navigation.load('/home')",author:"Dario Passariello",creationDate:"20260223",lastMod:"20260223",type:"function",active:true,description:"Loads a page via AJAX and injects it into the body.",env:"client",subCommand:[]}]},j={load:async e=>{let a=document.body,o=e.startsWith("/")?e.split("/")[1]||"home":e;if((!o||o==="")&&(o="home"),!document.querySelector(".loader")){let t=document.createElement("div");t.className="loader",t.innerHTML="<i></i>",t.style.opacity="0",t.style.transition="opacity 1000ms",a.appendChild(t),setTimeout(()=>t.style.opacity="1",10);}try{let t=await fetch(`${o}/`);if(!t.ok)throw new Error("Page not found");let i=await t.text(),r=i.match(/<body[^>]*>([\s\S]*)<\/body>/i),h=r?r[1]:i,b=g=>{let d=document.createElement("div");return d.textContent=g,d.innerHTML},f=dphelper?.sanitize?.html?dphelper.sanitize.html(h||""):b(h||"");a.innerHTML=f,window.scrollTo({top:0,behavior:"smooth"}),document.title=o.charAt(0).toUpperCase()+o.slice(1);let l=dphelper.path.rail();l&&l.length>0&&(a.className=a.className.replace(/path-\w+/g,"").trim(),a.classList.add(`path-${l[l.length-1]}`)),dphelper.navigation.ajax_running&&dphelper.navigation.ajax();}catch(t){console.error("Navigation error:",t);let i=window.location.origin;e.startsWith("/")&&!e.startsWith("//")&&!e.match(/^[a-zA-Z]:/)&&new URL(e,i).href.startsWith(i)&&(window.location.href=e);}},_bind:e=>{document.querySelectorAll(e).forEach(a=>{let o=a.getAttribute("href");if(!o||!o.startsWith("/")||o.includes("#"))return;let t=a.cloneNode(true);a.parentNode?.replaceChild(t,a),t.addEventListener("mouseup",i=>{let r=t.getAttribute("data-href")||o;history.pushState({href:r},"",r),dphelper.navigation.load(r),t.removeAttribute("href"),i.stopPropagation();});});},ajax:()=>{if(dphelper.navigation.ajax_running){dphelper.navigation._bind("a");return}dphelper.navigation.ajax_running=true,window.onpopstate=()=>dphelper.navigation.load(window.location.pathname),dphelper.navigation._bind("a"),globalThis.dp_hash_listener_set||(window.addEventListener("hashchange",()=>{let e=window.location.hash.substring(1);e&&document.getElementById(e)?.scrollIntoView({behavior:"smooth"});}),globalThis.dp_hash_listener_set=true);}};dphelper?.setDescription(y,j);var N=dphelper.navigation;
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 m={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...u},configurable:true,writable:true},version:{value:m.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var s=dphelper;Object.defineProperty(s,"setProps",{value:(e,n,a)=>{Object.defineProperty(e,n.name,a||{writable:false,configurable:false,enumerable:false}),a?.lock&&Object.freeze(e[n.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(s,"setDescription",{value:(e,n)=>{Object.defineProperties(s,{[e.name]:{value:n,writable:false,configurable:false,enumerable:false}}),Object.keys(n).map(a=>(Object.defineProperties(s[e.name],{[a]:{writable:false,configurable:false,enumerable:false}}),null)),s.setProps(s,e,{writable:false,configurable:false,enumerable:false}),s._list.scripts.push(e);}});var y={name:"navigation",active:true,subCommand:[{name:"ajax",version:"0.0.2",example:"dphelper.navigation.ajax()",author:"Dario Passariello",creationDate:"20260223",lastMod:"20260223",type:"function",active:true,description:"Vanilla AJAX Single Page Application (SPA) navigation engine.",env:"client",subCommand:[]},{name:"load",version:"0.0.1",example:"dphelper.navigation.load('/home')",author:"Dario Passariello",creationDate:"20260223",lastMod:"20260223",type:"function",active:true,description:"Loads a page via AJAX and injects it into the body.",env:"client",subCommand:[]}]},j={load:async e=>{let a=document.body,o=e.startsWith("/")?e.split("/")[1]||"home":e;if((!o||o==="")&&(o="home"),!document.querySelector(".loader")){let t=document.createElement("div");t.className="loader",t.innerHTML="<i></i>",t.style.opacity="0",t.style.transition="opacity 1000ms",a.appendChild(t),setTimeout(()=>t.style.opacity="1",10);}try{let t=await fetch(`${o}/`);if(!t.ok)throw new Error("Page not found");let i=await t.text(),r=i.match(/<body[^>]*>([\s\S]*)<\/body>/i),h=r?r[1]:i,b=g=>{let d=document.createElement("div");return d.textContent=g,d.innerHTML},f=dphelper?.sanitize?.html?dphelper.sanitize.html(h||""):b(h||"");a.innerHTML=f,window.scrollTo({top:0,behavior:"smooth"}),document.title=o.charAt(0).toUpperCase()+o.slice(1);let l=dphelper.path.rail();l&&l.length>0&&(a.className=a.className.replace(/path-\w+/g,"").trim(),a.classList.add(`path-${l[l.length-1]}`)),dphelper.navigation.ajax_running&&dphelper.navigation.ajax();}catch(t){console.error("Navigation error:",t);let i=window.location.origin;e.startsWith("/")&&!e.startsWith("//")&&!e.match(/^[a-zA-Z]:/)&&new URL(e,i).href.startsWith(i)&&(window.location.href=e);}},_bind:e=>{document.querySelectorAll(e).forEach(a=>{let o=a.getAttribute("href");if(!o||!o.startsWith("/")||o.includes("#"))return;let t=a.cloneNode(true);a.parentNode?.replaceChild(t,a),t.addEventListener("mouseup",i=>{let r=t.getAttribute("data-href")||o;history.pushState({href:r},"",r),dphelper.navigation.load(r),t.removeAttribute("href"),i.stopPropagation();});});},ajax:()=>{if(dphelper.navigation.ajax_running){dphelper.navigation._bind("a");return}dphelper.navigation.ajax_running=true,window.onpopstate=()=>dphelper.navigation.load(window.location.pathname),dphelper.navigation._bind("a"),globalThis.dp_hash_listener_set||(window.addEventListener("hashchange",()=>{let e=window.location.hash.substring(1);e&&document.getElementById(e)?.scrollIntoView({behavior:"smooth"});}),globalThis.dp_hash_listener_set=true);}};dphelper?.setDescription(y,j);var N=dphelper.navigation;
2
2
  export{N as navigation};
package/modules/net.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var i={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var n={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...i},configurable:true,writable:true},version:{value:n.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var o=dphelper;Object.defineProperty(o,"setProps",{value:(e,r,t)=>{Object.defineProperty(e,r.name,t||{writable:false,configurable:false,enumerable:false}),t?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(o,"setDescription",{value:(e,r)=>{Object.defineProperties(o,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(t=>(Object.defineProperties(o[e.name],{[t]:{writable:false,configurable:false,enumerable:false}}),null)),o.setProps(o,e,{writable:false,configurable:false,enumerable:false}),o._list.scripts.push(e);}});var f={name:"net",active:true,subCommand:[{name:"smartFetch",version:"0.0.1",example:"dphelper.net.smartFetch(url, options)",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Fetch with automatic retry and exponential backoff",env:"both",subCommand:[]}]},p={smartFetch:async(e,r={},t=3,l=1e3)=>{try{let a=await fetch(e,r);if(!a.ok&&t>0)throw new Error(`HTTP ${a.status}: ${a.statusText}`);return a}catch(a){if(t===0)throw a;return console.warn(`[dphelper.net] Fetch failed, retrying in ${l}ms... (${t} retries left)`,a),await new Promise(c=>setTimeout(c,l)),p.smartFetch(e,r,t-1,l*2)}}};dphelper?.setDescription(f,p);var k=dphelper.net;exports.net=k;
1
+ 'use strict';var i={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var n={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...i},configurable:true,writable:true},version:{value:n.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var o=dphelper;Object.defineProperty(o,"setProps",{value:(e,r,t)=>{Object.defineProperty(e,r.name,t||{writable:false,configurable:false,enumerable:false}),t?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(o,"setDescription",{value:(e,r)=>{Object.defineProperties(o,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(t=>(Object.defineProperties(o[e.name],{[t]:{writable:false,configurable:false,enumerable:false}}),null)),o.setProps(o,e,{writable:false,configurable:false,enumerable:false}),o._list.scripts.push(e);}});var f={name:"net",active:true,subCommand:[{name:"smartFetch",version:"0.0.1",example:"dphelper.net.smartFetch(url, options)",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Fetch with automatic retry and exponential backoff",env:"both",subCommand:[]}]},p={smartFetch:async(e,r={},t=3,l=1e3)=>{try{let a=await fetch(e,r);if(!a.ok&&t>0)throw new Error(`HTTP ${a.status}: ${a.statusText}`);return a}catch(a){if(t===0)throw a;return console.warn(`[dphelper.net] Fetch failed, retrying in ${l}ms... (${t} retries left)`,a),await new Promise(c=>setTimeout(c,l)),p.smartFetch(e,r,t-1,l*2)}}};dphelper?.setDescription(f,p);var k=dphelper.net;exports.net=k;
package/modules/net.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  /// <reference path="../types/dphelper.d.ts" />
2
- export interface NetTool {
3
- /**
4
- * Smart Fetch with automatic retry and exponential backoff.
5
- * @param url The URL to fetch.
6
- * @param options Fetch options (method, headers, body, etc.)
7
- * @param retries Number of retry attempts (default: 3)
8
- * @param backoff Initial backoff delay in ms (default: 1000)
9
- * @returns Promise resolving to the Response
10
- */
11
- smartFetch(url: string, options?: RequestInit, retries?: number, backoff?: number): Promise<Response>
2
+ export interface NetTool {
3
+ /**
4
+ * Smart Fetch with automatic retry and exponential backoff.
5
+ * @param url The URL to fetch.
6
+ * @param options Fetch options (method, headers, body, etc.)
7
+ * @param retries Number of retry attempts (default: 3)
8
+ * @param backoff Initial backoff delay in ms (default: 1000)
9
+ * @returns Promise resolving to the Response
10
+ */
11
+ smartFetch(url: string, options?: RequestInit, retries?: number, backoff?: number): Promise<Response>
12
12
  }
13
13
 
14
14
  export const net: NetTool
package/modules/net.js CHANGED
@@ -1 +1 @@
1
- var n={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var p={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...n},configurable:true,writable:true},version:{value:p.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var o=dphelper;Object.defineProperty(o,"setProps",{value:(e,r,t)=>{Object.defineProperty(e,r.name,t||{writable:false,configurable:false,enumerable:false}),t?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(o,"setDescription",{value:(e,r)=>{Object.defineProperties(o,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(t=>(Object.defineProperties(o[e.name],{[t]:{writable:false,configurable:false,enumerable:false}}),null)),o.setProps(o,e,{writable:false,configurable:false,enumerable:false}),o._list.scripts.push(e);}});var h={name:"net",active:true,subCommand:[{name:"smartFetch",version:"0.0.1",example:"dphelper.net.smartFetch(url, options)",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Fetch with automatic retry and exponential backoff",env:"both",subCommand:[]}]},c={smartFetch:async(e,r={},t=3,l=1e3)=>{try{let a=await fetch(e,r);if(!a.ok&&t>0)throw new Error(`HTTP ${a.status}: ${a.statusText}`);return a}catch(a){if(t===0)throw a;return console.warn(`[dphelper.net] Fetch failed, retrying in ${l}ms... (${t} retries left)`,a),await new Promise(u=>setTimeout(u,l)),c.smartFetch(e,r,t-1,l*2)}}};dphelper?.setDescription(h,c);var x=dphelper.net;export{x as net};
1
+ var n={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var p={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...n},configurable:true,writable:true},version:{value:p.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var o=dphelper;Object.defineProperty(o,"setProps",{value:(e,r,t)=>{Object.defineProperty(e,r.name,t||{writable:false,configurable:false,enumerable:false}),t?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(o,"setDescription",{value:(e,r)=>{Object.defineProperties(o,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(t=>(Object.defineProperties(o[e.name],{[t]:{writable:false,configurable:false,enumerable:false}}),null)),o.setProps(o,e,{writable:false,configurable:false,enumerable:false}),o._list.scripts.push(e);}});var h={name:"net",active:true,subCommand:[{name:"smartFetch",version:"0.0.1",example:"dphelper.net.smartFetch(url, options)",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Fetch with automatic retry and exponential backoff",env:"both",subCommand:[]}]},c={smartFetch:async(e,r={},t=3,l=1e3)=>{try{let a=await fetch(e,r);if(!a.ok&&t>0)throw new Error(`HTTP ${a.status}: ${a.statusText}`);return a}catch(a){if(t===0)throw a;return console.warn(`[dphelper.net] Fetch failed, retrying in ${l}ms... (${t} retries left)`,a),await new Promise(u=>setTimeout(u,l)),c.smartFetch(e,r,t-1,l*2)}}};dphelper?.setDescription(h,c);var x=dphelper.net;export{x as net};
@@ -1,4 +1,4 @@
1
- 'use strict';var c={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var p={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...c},configurable:true,writable:true},version:{value:p.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var n=dphelper;Object.defineProperty(n,"setProps",{value:(e,t,o)=>{Object.defineProperty(e,t.name,o||{writable:false,configurable:false,enumerable:false}),o?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(n,"setDescription",{value:(e,t)=>{Object.defineProperties(n,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(o=>(Object.defineProperties(n[e.name],{[o]:{writable:false,configurable:false,enumerable:false}}),null)),n.setProps(n,e,{writable:false,configurable:false,enumerable:false}),n._list.scripts.push(e);}});var f={name:"obj",active:true,subCommand:[{name:"replaceNullObjects",version:"0.0.2",example:"dphelper.obj.replaceNullObjects([obj])",description:"Replace null values in an object with empty objects.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"serialize",version:"0.0.2",example:"dphelper.obj.serialize([obj])",description:"Serialize an object to a JSON string.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"deSerialize",version:"0.0.2",example:"dphelper.obj.deSerialize([obj])",description:"Deserialize a JSON string to an object.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"toXML",version:"0.0.2",example:"dphelper.obj.toXML([obj])",description:"Convert an object to an XML string.",author:"Dario Passariello",creationDate:"20240315",lastMod:"20240315",type:"function",active:true,env:"both",subCommand:[]},{name:"updateByKey",version:"0.0.2",example:"dphelper.obj.updateByKey([obj, key, newValue])",description:"Update an object's property by key.",author:"Dario Passariello",creationDate:"20240929",lastMod:"20240929",type:"function",active:true,env:"both",subCommand:[]},{name:"parse",version:"0.0.2",example:"dphelper.obj.parse(val)",description:"Check if value is an object or another type. Return object after parse or a different type. Used instead of JSON.parse to avoid crash.",author:"Dario Passariello",creationDate:"20241027",lastMod:"20240927",type:"function",active:true,env:"both",subCommand:[]},{name:"diff",version:"0.0.2",example:"dphelper.obj.diff([obj1, obj2])",description:"Show the differences between two objects.",author:"Dario Passariello",creationDate:"20250101",lastMod:"20250101",type:"function",active:true,env:"both",subCommand:[]},{name:"setProps",version:"0.0.2",example:"dphelper.obj.setProps( [object], {options} )",author:"Dario Passariello",creationDate:"20251224",lastMod:"20251224",type:"function",active:true,description:"Set properties of an object.",env:"both",subCommand:[]}]},d={replaceNullObjects:e=>{let t={...e};for(let o of Object.keys(e))t[o]===null&&(t[o]="");},serialize:e=>{if(typeof e=="function")return e.toString();if(typeof e=="object"){let t={};for(let[o,r]of Object.entries(e))t[o]=dphelper.obj.serialize(r);return t}return e},deSerialize:e=>{if(typeof e=="object"){let t={};for(let[o,r]of Object.entries(e))t[o]=dphelper.obj.deSerialize(r);return t}return e},sort:e=>Object.keys(e).sort().reduce((t,o)=>(t[o]=e[o],t),{}),toXML:e=>{let t=(o,r="")=>{let a="";for(let i in o)if(Object.hasOwn(o,i)){let s=o[i];typeof s=="object"&&s!==null?a+=`${r}<${i}>
1
+ 'use strict';var c={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var p={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...c},configurable:true,writable:true},version:{value:p.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var n=dphelper;Object.defineProperty(n,"setProps",{value:(e,t,o)=>{Object.defineProperty(e,t.name,o||{writable:false,configurable:false,enumerable:false}),o?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(n,"setDescription",{value:(e,t)=>{Object.defineProperties(n,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(o=>(Object.defineProperties(n[e.name],{[o]:{writable:false,configurable:false,enumerable:false}}),null)),n.setProps(n,e,{writable:false,configurable:false,enumerable:false}),n._list.scripts.push(e);}});var f={name:"obj",active:true,subCommand:[{name:"replaceNullObjects",version:"0.0.2",example:"dphelper.obj.replaceNullObjects([obj])",description:"Replace null values in an object with empty objects.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"serialize",version:"0.0.2",example:"dphelper.obj.serialize([obj])",description:"Serialize an object to a JSON string.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"deSerialize",version:"0.0.2",example:"dphelper.obj.deSerialize([obj])",description:"Deserialize a JSON string to an object.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"toXML",version:"0.0.2",example:"dphelper.obj.toXML([obj])",description:"Convert an object to an XML string.",author:"Dario Passariello",creationDate:"20240315",lastMod:"20240315",type:"function",active:true,env:"both",subCommand:[]},{name:"updateByKey",version:"0.0.2",example:"dphelper.obj.updateByKey([obj, key, newValue])",description:"Update an object's property by key.",author:"Dario Passariello",creationDate:"20240929",lastMod:"20240929",type:"function",active:true,env:"both",subCommand:[]},{name:"parse",version:"0.0.2",example:"dphelper.obj.parse(val)",description:"Check if value is an object or another type. Return object after parse or a different type. Used instead of JSON.parse to avoid crash.",author:"Dario Passariello",creationDate:"20241027",lastMod:"20240927",type:"function",active:true,env:"both",subCommand:[]},{name:"diff",version:"0.0.2",example:"dphelper.obj.diff([obj1, obj2])",description:"Show the differences between two objects.",author:"Dario Passariello",creationDate:"20250101",lastMod:"20250101",type:"function",active:true,env:"both",subCommand:[]},{name:"setProps",version:"0.0.2",example:"dphelper.obj.setProps( [object], {options} )",author:"Dario Passariello",creationDate:"20251224",lastMod:"20251224",type:"function",active:true,description:"Set properties of an object.",env:"both",subCommand:[]}]},d={replaceNullObjects:e=>{let t={...e};for(let o of Object.keys(e))t[o]===null&&(t[o]="");},serialize:e=>{if(typeof e=="function")return e.toString();if(typeof e=="object"){let t={};for(let[o,r]of Object.entries(e))t[o]=dphelper.obj.serialize(r);return t}return e},deSerialize:e=>{if(typeof e=="object"){let t={};for(let[o,r]of Object.entries(e))t[o]=dphelper.obj.deSerialize(r);return t}return e},sort:e=>Object.keys(e).sort().reduce((t,o)=>(t[o]=e[o],t),{}),toXML:e=>{let t=(o,r="")=>{let a="";for(let i in o)if(Object.hasOwn(o,i)){let s=o[i];typeof s=="object"&&s!==null?a+=`${r}<${i}>
2
2
  ${t(s,`${r} `)}${r}</${i}>
3
3
  `:a+=`${r}<${i}>${s}</${i}>
4
4
  `;}return a};return t(e)},updateByKey:(e,t,o)=>(Object.hasOwn(e,t)&&(e[t]=o),e),parse:e=>{try{return JSON.parse(e)}catch(t){return console.error(t),e}},isObject:e=>typeof e=="object"&&e!==null,diff:(e,t)=>{let o={};for(let r in e)Object.hasOwn(e,r)&&e[r]!==t[r]&&(o[r]={obj1:e[r],obj2:t[r]});for(let r in t)Object.hasOwn(t,r)&&e[r]!==t[r]&&(o[r]={obj1:e[r],obj2:t[r]});return o},path:(e,t,o=".")=>t.concat(e).join(o),setProps:(e,t)=>{Reflect.ownKeys(e).forEach(r=>{let a=Object.getOwnPropertyDescriptor(e,r);a&&(a.enumerable=t?.enumerable??true,a.configurable=t?.configurable??true,a.writable=t?.writable??true,Object.defineProperty(e,r,a)),typeof e[r]=="object"&&e[r]!==null&&dphelper.obj.setProps(e[r],t);});}};dphelper?.setDescription(f,d);var R=dphelper.object;exports.object=R;
@@ -1,19 +1,19 @@
1
1
  /// <reference path="../types/dphelper.d.ts" />
2
- export interface ObjectsTool {
3
- toArray: (object: Record<string, any>) => [string, any][]
4
- replaceNullObjects: (data: Record<string, any>) => Record<string, any>
5
- serialize: (value: any) => any
6
- deSerialize: (valueNew: any) => any
7
- sort: (o: Record<string, any>) => Record<string, any>
8
- toXML: (obj: Record<string, any>) => string
9
- find: (array: any[], key: string, value: any) => any
10
- instance: (obj: any) => any
11
- updateByKey: (obj: Record<string, any>, key: string, newValue: any) => Record<string, any>
12
- findindex: (array: any[], key: string) => number
13
- parse: (val: any) => any
14
- isObject: (val: any) => boolean
15
- diff: (obj1: Record<string, any>, obj2: Record<string, any>) => Record<string, { obj1: any, obj2: any }>
16
- path: (prop: string, array: string[], separator?: string) => string
2
+ export interface ObjectsTool {
3
+ toArray: (object: Record<string, any>) => [string, any][]
4
+ replaceNullObjects: (data: Record<string, any>) => Record<string, any>
5
+ serialize: (value: any) => any
6
+ deSerialize: (valueNew: any) => any
7
+ sort: (o: Record<string, any>) => Record<string, any>
8
+ toXML: (obj: Record<string, any>) => string
9
+ find: (array: any[], key: string, value: any) => any
10
+ instance: (obj: any) => any
11
+ updateByKey: (obj: Record<string, any>, key: string, newValue: any) => Record<string, any>
12
+ findindex: (array: any[], key: string) => number
13
+ parse: (val: any) => any
14
+ isObject: (val: any) => boolean
15
+ diff: (obj1: Record<string, any>, obj2: Record<string, any>) => Record<string, { obj1: any, obj2: any }>
16
+ path: (prop: string, array: string[], separator?: string) => string
17
17
  }
18
18
 
19
19
  export const object: ObjectsTool
@@ -1,4 +1,4 @@
1
- var p={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var b={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...p},configurable:true,writable:true},version:{value:b.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var n=dphelper;Object.defineProperty(n,"setProps",{value:(e,t,o)=>{Object.defineProperty(e,t.name,o||{writable:false,configurable:false,enumerable:false}),o?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(n,"setDescription",{value:(e,t)=>{Object.defineProperties(n,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(o=>(Object.defineProperties(n[e.name],{[o]:{writable:false,configurable:false,enumerable:false}}),null)),n.setProps(n,e,{writable:false,configurable:false,enumerable:false}),n._list.scripts.push(e);}});var d={name:"obj",active:true,subCommand:[{name:"replaceNullObjects",version:"0.0.2",example:"dphelper.obj.replaceNullObjects([obj])",description:"Replace null values in an object with empty objects.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"serialize",version:"0.0.2",example:"dphelper.obj.serialize([obj])",description:"Serialize an object to a JSON string.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"deSerialize",version:"0.0.2",example:"dphelper.obj.deSerialize([obj])",description:"Deserialize a JSON string to an object.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"toXML",version:"0.0.2",example:"dphelper.obj.toXML([obj])",description:"Convert an object to an XML string.",author:"Dario Passariello",creationDate:"20240315",lastMod:"20240315",type:"function",active:true,env:"both",subCommand:[]},{name:"updateByKey",version:"0.0.2",example:"dphelper.obj.updateByKey([obj, key, newValue])",description:"Update an object's property by key.",author:"Dario Passariello",creationDate:"20240929",lastMod:"20240929",type:"function",active:true,env:"both",subCommand:[]},{name:"parse",version:"0.0.2",example:"dphelper.obj.parse(val)",description:"Check if value is an object or another type. Return object after parse or a different type. Used instead of JSON.parse to avoid crash.",author:"Dario Passariello",creationDate:"20241027",lastMod:"20240927",type:"function",active:true,env:"both",subCommand:[]},{name:"diff",version:"0.0.2",example:"dphelper.obj.diff([obj1, obj2])",description:"Show the differences between two objects.",author:"Dario Passariello",creationDate:"20250101",lastMod:"20250101",type:"function",active:true,env:"both",subCommand:[]},{name:"setProps",version:"0.0.2",example:"dphelper.obj.setProps( [object], {options} )",author:"Dario Passariello",creationDate:"20251224",lastMod:"20251224",type:"function",active:true,description:"Set properties of an object.",env:"both",subCommand:[]}]},y={replaceNullObjects:e=>{let t={...e};for(let o of Object.keys(e))t[o]===null&&(t[o]="");},serialize:e=>{if(typeof e=="function")return e.toString();if(typeof e=="object"){let t={};for(let[o,r]of Object.entries(e))t[o]=dphelper.obj.serialize(r);return t}return e},deSerialize:e=>{if(typeof e=="object"){let t={};for(let[o,r]of Object.entries(e))t[o]=dphelper.obj.deSerialize(r);return t}return e},sort:e=>Object.keys(e).sort().reduce((t,o)=>(t[o]=e[o],t),{}),toXML:e=>{let t=(o,r="")=>{let a="";for(let i in o)if(Object.hasOwn(o,i)){let s=o[i];typeof s=="object"&&s!==null?a+=`${r}<${i}>
1
+ var p={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var b={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...p},configurable:true,writable:true},version:{value:b.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var n=dphelper;Object.defineProperty(n,"setProps",{value:(e,t,o)=>{Object.defineProperty(e,t.name,o||{writable:false,configurable:false,enumerable:false}),o?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(n,"setDescription",{value:(e,t)=>{Object.defineProperties(n,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(o=>(Object.defineProperties(n[e.name],{[o]:{writable:false,configurable:false,enumerable:false}}),null)),n.setProps(n,e,{writable:false,configurable:false,enumerable:false}),n._list.scripts.push(e);}});var d={name:"obj",active:true,subCommand:[{name:"replaceNullObjects",version:"0.0.2",example:"dphelper.obj.replaceNullObjects([obj])",description:"Replace null values in an object with empty objects.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"serialize",version:"0.0.2",example:"dphelper.obj.serialize([obj])",description:"Serialize an object to a JSON string.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"deSerialize",version:"0.0.2",example:"dphelper.obj.deSerialize([obj])",description:"Deserialize a JSON string to an object.",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,env:"both",subCommand:[]},{name:"toXML",version:"0.0.2",example:"dphelper.obj.toXML([obj])",description:"Convert an object to an XML string.",author:"Dario Passariello",creationDate:"20240315",lastMod:"20240315",type:"function",active:true,env:"both",subCommand:[]},{name:"updateByKey",version:"0.0.2",example:"dphelper.obj.updateByKey([obj, key, newValue])",description:"Update an object's property by key.",author:"Dario Passariello",creationDate:"20240929",lastMod:"20240929",type:"function",active:true,env:"both",subCommand:[]},{name:"parse",version:"0.0.2",example:"dphelper.obj.parse(val)",description:"Check if value is an object or another type. Return object after parse or a different type. Used instead of JSON.parse to avoid crash.",author:"Dario Passariello",creationDate:"20241027",lastMod:"20240927",type:"function",active:true,env:"both",subCommand:[]},{name:"diff",version:"0.0.2",example:"dphelper.obj.diff([obj1, obj2])",description:"Show the differences between two objects.",author:"Dario Passariello",creationDate:"20250101",lastMod:"20250101",type:"function",active:true,env:"both",subCommand:[]},{name:"setProps",version:"0.0.2",example:"dphelper.obj.setProps( [object], {options} )",author:"Dario Passariello",creationDate:"20251224",lastMod:"20251224",type:"function",active:true,description:"Set properties of an object.",env:"both",subCommand:[]}]},y={replaceNullObjects:e=>{let t={...e};for(let o of Object.keys(e))t[o]===null&&(t[o]="");},serialize:e=>{if(typeof e=="function")return e.toString();if(typeof e=="object"){let t={};for(let[o,r]of Object.entries(e))t[o]=dphelper.obj.serialize(r);return t}return e},deSerialize:e=>{if(typeof e=="object"){let t={};for(let[o,r]of Object.entries(e))t[o]=dphelper.obj.deSerialize(r);return t}return e},sort:e=>Object.keys(e).sort().reduce((t,o)=>(t[o]=e[o],t),{}),toXML:e=>{let t=(o,r="")=>{let a="";for(let i in o)if(Object.hasOwn(o,i)){let s=o[i];typeof s=="object"&&s!==null?a+=`${r}<${i}>
2
2
  ${t(s,`${r} `)}${r}</${i}>
3
3
  `:a+=`${r}<${i}>${s}</${i}>
4
4
  `;}return a};return t(e)},updateByKey:(e,t,o)=>(Object.hasOwn(e,t)&&(e[t]=o),e),parse:e=>{try{return JSON.parse(e)}catch(t){return console.error(t),e}},isObject:e=>typeof e=="object"&&e!==null,diff:(e,t)=>{let o={};for(let r in e)Object.hasOwn(e,r)&&e[r]!==t[r]&&(o[r]={obj1:e[r],obj2:t[r]});for(let r in t)Object.hasOwn(t,r)&&e[r]!==t[r]&&(o[r]={obj1:e[r],obj2:t[r]});return o},path:(e,t,o=".")=>t.concat(e).join(o),setProps:(e,t)=>{Reflect.ownKeys(e).forEach(r=>{let a=Object.getOwnPropertyDescriptor(e,r);a&&(a.enumerable=t?.enumerable??true,a.configurable=t?.configurable??true,a.writable=t?.writable??true,Object.defineProperty(e,r,a)),typeof e[r]=="object"&&e[r]!==null&&dphelper.obj.setProps(e[r],t);});}};dphelper?.setDescription(d,y);var k=dphelper.object;export{k as object};
package/modules/path.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var l={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var s={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...l},configurable:true,writable:true},version:{value:s.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var r=dphelper;Object.defineProperty(r,"setProps",{value:(e,t,a)=>{Object.defineProperty(e,t.name,a||{writable:false,configurable:false,enumerable:false}),a?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(r,"setDescription",{value:(e,t)=>{Object.defineProperties(r,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(a=>(Object.defineProperties(r[e.name],{[a]:{writable:false,configurable:false,enumerable:false}}),null)),r.setProps(r,e,{writable:false,configurable:false,enumerable:false}),r._list.scripts.push(e);}});var p={name:"path",active:true,subCommand:[{name:"rail",version:"0.0.2",example:"dphelper.path.rail()",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Extract the path segments from the current URL.",env:"both",subCommand:[]},{name:"hash",version:"0.0.2",example:"dphelper.path.hash([hashUrl])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Extract the hash from a URL.",env:"both",subCommand:[]},{name:"query",version:"0.0.2",example:"dphelper.path.query([queryString])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20250513",type:"function",active:true,description:"Extract the query parameters from a URL.",env:"both",subCommand:[]}]},c={rail:()=>(location.href.split("?")[0]||"").replace(location.protocol,"").replace(location.host,"").replace(location.hash,"").split("/").filter(t=>t),hash:()=>{let e=location.hash.replace("#","").split("/");return e.length?e.filter(t=>t):["empty"]},query:()=>{let e=location.search.substring(1);return JSON.parse(`{"${decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')}"}`)}};dphelper?.setDescription(p,c);var j=dphelper.path;exports.path=j;
1
+ 'use strict';var l={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var s={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...l},configurable:true,writable:true},version:{value:s.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var r=dphelper;Object.defineProperty(r,"setProps",{value:(e,t,a)=>{Object.defineProperty(e,t.name,a||{writable:false,configurable:false,enumerable:false}),a?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(r,"setDescription",{value:(e,t)=>{Object.defineProperties(r,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(a=>(Object.defineProperties(r[e.name],{[a]:{writable:false,configurable:false,enumerable:false}}),null)),r.setProps(r,e,{writable:false,configurable:false,enumerable:false}),r._list.scripts.push(e);}});var p={name:"path",active:true,subCommand:[{name:"rail",version:"0.0.2",example:"dphelper.path.rail()",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Extract the path segments from the current URL.",env:"both",subCommand:[]},{name:"hash",version:"0.0.2",example:"dphelper.path.hash([hashUrl])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Extract the hash from a URL.",env:"both",subCommand:[]},{name:"query",version:"0.0.2",example:"dphelper.path.query([queryString])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20250513",type:"function",active:true,description:"Extract the query parameters from a URL.",env:"both",subCommand:[]}]},c={rail:()=>(location.href.split("?")[0]||"").replace(location.protocol,"").replace(location.host,"").replace(location.hash,"").split("/").filter(t=>t),hash:()=>{let e=location.hash.replace("#","").split("/");return e.length?e.filter(t=>t):["empty"]},query:()=>{let e=location.search.substring(1);return JSON.parse(`{"${decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')}"}`)}};dphelper?.setDescription(p,c);var j=dphelper.path;exports.path=j;
package/modules/path.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /// <reference path="../types/dphelper.d.ts" />
2
- export interface PathTool {
3
- rail: () => string[]
4
- hash: () => string[]
5
- query: (url: string) => Record<string, string>
2
+ export interface PathTool {
3
+ rail: () => string[]
4
+ hash: () => string[]
5
+ query: (url: string) => Record<string, string>
6
6
  }
7
7
 
8
8
  export const path: PathTool
package/modules/path.js CHANGED
@@ -1 +1 @@
1
- var s={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var i={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...s},configurable:true,writable:true},version:{value:i.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var r=dphelper;Object.defineProperty(r,"setProps",{value:(e,t,a)=>{Object.defineProperty(e,t.name,a||{writable:false,configurable:false,enumerable:false}),a?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(r,"setDescription",{value:(e,t)=>{Object.defineProperties(r,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(a=>(Object.defineProperties(r[e.name],{[a]:{writable:false,configurable:false,enumerable:false}}),null)),r.setProps(r,e,{writable:false,configurable:false,enumerable:false}),r._list.scripts.push(e);}});var c={name:"path",active:true,subCommand:[{name:"rail",version:"0.0.2",example:"dphelper.path.rail()",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Extract the path segments from the current URL.",env:"both",subCommand:[]},{name:"hash",version:"0.0.2",example:"dphelper.path.hash([hashUrl])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Extract the hash from a URL.",env:"both",subCommand:[]},{name:"query",version:"0.0.2",example:"dphelper.path.query([queryString])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20250513",type:"function",active:true,description:"Extract the query parameters from a URL.",env:"both",subCommand:[]}]},u={rail:()=>(location.href.split("?")[0]||"").replace(location.protocol,"").replace(location.host,"").replace(location.hash,"").split("/").filter(t=>t),hash:()=>{let e=location.hash.replace("#","").split("/");return e.length?e.filter(t=>t):["empty"]},query:()=>{let e=location.search.substring(1);return JSON.parse(`{"${decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')}"}`)}};dphelper?.setDescription(c,u);var P=dphelper.path;export{P as path};
1
+ var s={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var i={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...s},configurable:true,writable:true},version:{value:i.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var r=dphelper;Object.defineProperty(r,"setProps",{value:(e,t,a)=>{Object.defineProperty(e,t.name,a||{writable:false,configurable:false,enumerable:false}),a?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(r,"setDescription",{value:(e,t)=>{Object.defineProperties(r,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(a=>(Object.defineProperties(r[e.name],{[a]:{writable:false,configurable:false,enumerable:false}}),null)),r.setProps(r,e,{writable:false,configurable:false,enumerable:false}),r._list.scripts.push(e);}});var c={name:"path",active:true,subCommand:[{name:"rail",version:"0.0.2",example:"dphelper.path.rail()",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Extract the path segments from the current URL.",env:"both",subCommand:[]},{name:"hash",version:"0.0.2",example:"dphelper.path.hash([hashUrl])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Extract the hash from a URL.",env:"both",subCommand:[]},{name:"query",version:"0.0.2",example:"dphelper.path.query([queryString])",author:"Dario Passariello",creationDate:"20210101",lastMod:"20250513",type:"function",active:true,description:"Extract the query parameters from a URL.",env:"both",subCommand:[]}]},u={rail:()=>(location.href.split("?")[0]||"").replace(location.protocol,"").replace(location.host,"").replace(location.hash,"").split("/").filter(t=>t),hash:()=>{let e=location.hash.replace("#","").split("/");return e.length?e.filter(t=>t):["empty"]},query:()=>{let e=location.search.substring(1);return JSON.parse(`{"${decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')}"}`)}};dphelper?.setDescription(c,u);var P=dphelper.path;export{P as path};
@@ -1 +1 @@
1
- 'use strict';var a={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var s={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...a},configurable:true,writable:true},version:{value:s.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var t=dphelper;Object.defineProperty(t,"setProps",{value:(e,r,o)=>{Object.defineProperty(e,r.name,o||{writable:false,configurable:false,enumerable:false}),o?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(t,"setDescription",{value:(e,r)=>{Object.defineProperties(t,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(o=>(Object.defineProperties(t[e.name],{[o]:{writable:false,configurable:false,enumerable:false}}),null)),t.setProps(t,e,{writable:false,configurable:false,enumerable:false}),t._list.scripts.push(e);}});var p={name:"promise",active:true,subCommand:[{name:"check",version:"0.0.2",example:"dphelper.promise.check(promise)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Check if a value is a Promise.",env:"both",subCommand:[]}]},c={check:e=>e!=null&&(e instanceof Promise||Object.prototype.toString.call(e)==="[object Promise]"||typeof e=="object"&&typeof e.then=="function")};dphelper?.setDescription(p,c);var y=dphelper.promise;exports.promise=y;
1
+ 'use strict';var a={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var s={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...a},configurable:true,writable:true},version:{value:s.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var t=dphelper;Object.defineProperty(t,"setProps",{value:(e,r,o)=>{Object.defineProperty(e,r.name,o||{writable:false,configurable:false,enumerable:false}),o?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(t,"setDescription",{value:(e,r)=>{Object.defineProperties(t,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(o=>(Object.defineProperties(t[e.name],{[o]:{writable:false,configurable:false,enumerable:false}}),null)),t.setProps(t,e,{writable:false,configurable:false,enumerable:false}),t._list.scripts.push(e);}});var p={name:"promise",active:true,subCommand:[{name:"check",version:"0.0.2",example:"dphelper.promise.check(promise)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Check if a value is a Promise.",env:"both",subCommand:[]}]},c={check:e=>e!=null&&(e instanceof Promise||Object.prototype.toString.call(e)==="[object Promise]"||typeof e=="object"&&typeof e.then=="function")};dphelper?.setDescription(p,c);var y=dphelper.promise;exports.promise=y;
@@ -1,7 +1,7 @@
1
1
  /// <reference path="../types/dphelper.d.ts" />
2
- export interface PromiseTool {
3
- check: (p: any) => boolean
4
- resolve: (data: any) => Promise<any>
2
+ export interface PromiseTool {
3
+ check: (p: any) => boolean
4
+ resolve: (data: any) => Promise<any>
5
5
  }
6
6
 
7
7
  export const promise: PromiseTool
@@ -1 +1 @@
1
- var s={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var i={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...s},configurable:true,writable:true},version:{value:i.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var t=dphelper;Object.defineProperty(t,"setProps",{value:(e,r,o)=>{Object.defineProperty(e,r.name,o||{writable:false,configurable:false,enumerable:false}),o?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(t,"setDescription",{value:(e,r)=>{Object.defineProperties(t,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(o=>(Object.defineProperties(t[e.name],{[o]:{writable:false,configurable:false,enumerable:false}}),null)),t.setProps(t,e,{writable:false,configurable:false,enumerable:false}),t._list.scripts.push(e);}});var c={name:"promise",active:true,subCommand:[{name:"check",version:"0.0.2",example:"dphelper.promise.check(promise)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Check if a value is a Promise.",env:"both",subCommand:[]}]},b={check:e=>e!=null&&(e instanceof Promise||Object.prototype.toString.call(e)==="[object Promise]"||typeof e=="object"&&typeof e.then=="function")};dphelper?.setDescription(c,b);var P=dphelper.promise;export{P as promise};
1
+ var s={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var i={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...s},configurable:true,writable:true},version:{value:i.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var t=dphelper;Object.defineProperty(t,"setProps",{value:(e,r,o)=>{Object.defineProperty(e,r.name,o||{writable:false,configurable:false,enumerable:false}),o?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(t,"setDescription",{value:(e,r)=>{Object.defineProperties(t,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(o=>(Object.defineProperties(t[e.name],{[o]:{writable:false,configurable:false,enumerable:false}}),null)),t.setProps(t,e,{writable:false,configurable:false,enumerable:false}),t._list.scripts.push(e);}});var c={name:"promise",active:true,subCommand:[{name:"check",version:"0.0.2",example:"dphelper.promise.check(promise)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Check if a value is a Promise.",env:"both",subCommand:[]}]},b={check:e=>e!=null&&(e instanceof Promise||Object.prototype.toString.call(e)==="[object Promise]"||typeof e=="object"&&typeof e.then=="function")};dphelper?.setDescription(c,b);var P=dphelper.promise;export{P as promise};
@@ -1,2 +1,2 @@
1
- 'use strict';var o={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var i={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...o},configurable:true,writable:true},version:{value:i.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var t=dphelper;Object.defineProperty(t,"setProps",{value:(e,r,l)=>{Object.defineProperty(e,r.name,l||{writable:false,configurable:false,enumerable:false}),l?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(t,"setDescription",{value:(e,r)=>{Object.defineProperties(t,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(l=>(Object.defineProperties(t[e.name],{[l]:{writable:false,configurable:false,enumerable:false}}),null)),t.setProps(t,e,{writable:false,configurable:false,enumerable:false}),t._list.scripts.push(e);}});var p={name:"sanitize",active:true,subCommand:[{name:"html",version:"0.0.2",example:"dphelper.sanitize.html([html])",author:"Dario Passariello",creationDate:"20241204",lastMod:"20241204",type:"function",active:true,description:"Sanitize HTML by escaping special characters.",env:"both",subCommand:[]}]},c={html:e=>typeof e!="string"?"":e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\//g,"&#x2F;")};typeof dphelper?.setDescription=="function"&&dphelper.setDescription(p,c);var P=dphelper.sanitize;
1
+ 'use strict';var o={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var i={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...o},configurable:true,writable:true},version:{value:i.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var t=dphelper;Object.defineProperty(t,"setProps",{value:(e,r,l)=>{Object.defineProperty(e,r.name,l||{writable:false,configurable:false,enumerable:false}),l?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(t,"setDescription",{value:(e,r)=>{Object.defineProperties(t,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(l=>(Object.defineProperties(t[e.name],{[l]:{writable:false,configurable:false,enumerable:false}}),null)),t.setProps(t,e,{writable:false,configurable:false,enumerable:false}),t._list.scripts.push(e);}});var p={name:"sanitize",active:true,subCommand:[{name:"html",version:"0.0.2",example:"dphelper.sanitize.html([html])",author:"Dario Passariello",creationDate:"20241204",lastMod:"20241204",type:"function",active:true,description:"Sanitize HTML by escaping special characters.",env:"both",subCommand:[]}]},c={html:e=>typeof e!="string"?"":e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\//g,"&#x2F;")};typeof dphelper?.setDescription=="function"&&dphelper.setDescription(p,c);var P=dphelper.sanitize;
2
2
  exports.sanitize=P;
@@ -1,6 +1,6 @@
1
1
  /// <reference path="../types/dphelper.d.ts" />
2
- export interface SanitizeTool {
3
- html: (s: string) => string
2
+ export interface SanitizeTool {
3
+ html: (s: string) => string
4
4
  }
5
5
 
6
6
  export const sanitize: SanitizeTool
@@ -1,2 +1,2 @@
1
- var i={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var s={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...i},configurable:true,writable:true},version:{value:s.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var t=dphelper;Object.defineProperty(t,"setProps",{value:(e,r,l)=>{Object.defineProperty(e,r.name,l||{writable:false,configurable:false,enumerable:false}),l?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(t,"setDescription",{value:(e,r)=>{Object.defineProperties(t,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(l=>(Object.defineProperties(t[e.name],{[l]:{writable:false,configurable:false,enumerable:false}}),null)),t.setProps(t,e,{writable:false,configurable:false,enumerable:false}),t._list.scripts.push(e);}});var c={name:"sanitize",active:true,subCommand:[{name:"html",version:"0.0.2",example:"dphelper.sanitize.html([html])",author:"Dario Passariello",creationDate:"20241204",lastMod:"20241204",type:"function",active:true,description:"Sanitize HTML by escaping special characters.",env:"both",subCommand:[]}]},u={html:e=>typeof e!="string"?"":e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\//g,"&#x2F;")};typeof dphelper?.setDescription=="function"&&dphelper.setDescription(c,u);var O=dphelper.sanitize;
1
+ var i={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var s={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...i},configurable:true,writable:true},version:{value:s.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var t=dphelper;Object.defineProperty(t,"setProps",{value:(e,r,l)=>{Object.defineProperty(e,r.name,l||{writable:false,configurable:false,enumerable:false}),l?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(t,"setDescription",{value:(e,r)=>{Object.defineProperties(t,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(l=>(Object.defineProperties(t[e.name],{[l]:{writable:false,configurable:false,enumerable:false}}),null)),t.setProps(t,e,{writable:false,configurable:false,enumerable:false}),t._list.scripts.push(e);}});var c={name:"sanitize",active:true,subCommand:[{name:"html",version:"0.0.2",example:"dphelper.sanitize.html([html])",author:"Dario Passariello",creationDate:"20241204",lastMod:"20241204",type:"function",active:true,description:"Sanitize HTML by escaping special characters.",env:"both",subCommand:[]}]},u={html:e=>typeof e!="string"?"":e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\//g,"&#x2F;")};typeof dphelper?.setDescription=="function"&&dphelper.setDescription(c,u);var O=dphelper.sanitize;
2
2
  export{O as sanitize};
@@ -1 +1 @@
1
- 'use strict';var b={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var w={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...b},configurable:true,writable:true},version:{value:w.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var l=dphelper;Object.defineProperty(l,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(l,"setDescription",{value:(e,t)=>{Object.defineProperties(l,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(l[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),l.setProps(l,e,{writable:false,configurable:false,enumerable:false}),l._list.scripts.push(e);}});var m="dphelper_popup_positions",v=(e,t,r,i)=>`${e}x${t}@${r},${i}`,d=()=>{let e=[];return e.push({id:"primary",width:screen.width,height:screen.height,left:0,top:0,isPrimary:true}),window.screenLeft!==void 0&&window.screenTop!==void 0&&(window.screenLeft>0||window.screenTop>0)&&e.push({id:`secondary_${Date.now()}`,width:window.innerWidth,height:window.innerHeight,left:window.screenLeft,top:window.screenTop,isPrimary:false}),e},g=(e,t)=>{let r=d();for(let o of r)if(e>=o.left&&e<o.left+o.width&&t>=o.top&&t<o.top+o.height)return o;if(!r.length)return {id:"default",width:screen.width,height:screen.height,left:0,top:0,isPrimary:true};let i=r[0],s=1/0;for(let o of r){let p=o.left+o.width/2,u=o.top+o.height/2,n=Math.sqrt(Math.pow(p-e,2)+Math.pow(u-t,2));n<s&&(s=n,i=o);}return i},F=(e,t,r)=>({relX:e-r.left,relY:t-r.top}),x=(e,t,r)=>({left:r.left+e,top:r.top+t}),C=(e,t)=>{if(typeof window>"u")return;let r=t||window,i=r.screenX||r.screenLeft||0,s=r.screenY||r.screenTop||0,o=r.outerWidth||800,p=r.outerHeight||600,u=d(),n=g(i,s),{relX:y,relY:M}=F(i,s,n),P=v(n.width,n.height,n.left,n.top),h=f();h.monitors=u,h.popups[e]={id:e,monitorId:n.id,left:y,top:M,width:o,height:p,monitorFingerprint:P},localStorage.setItem(m,JSON.stringify(h));},q=e=>{if(typeof window>"u")return null;let t=f(),r=t.popups[e];if(!r)return null;let i=d(),s=i.find(n=>v(n.width,n.height,n.left,n.top)===r.monitorFingerprint),o;s?o=s:(console.warn(`[dphelper] Monitor changed, restoring popup "${e}" on closest available monitor`),o=g(r.left+(i[0]?.left||0),r.top+(i[0]?.top||0)));let{left:p,top:u}=x(r.left,r.top,o);return {left:p,top:u,width:r.width,height:r.height}},R=e=>{let t=f();delete t.popups[e],localStorage.setItem(m,JSON.stringify(t));},I=()=>f().popups,j=()=>g(window.screenX||0,window.screenY||0),O=()=>{localStorage.removeItem(m);},f=()=>{try{let e=localStorage.getItem(m);if(e)return JSON.parse(e)}catch(e){console.warn("[dphelper] Failed to parse popup storage:",e);}return {monitors:[],popups:{}}},a={save:C,restore:q,remove:R,list:I,clear:O,getMonitors:d,getCurrentMonitor:j};var k={name:"screen",active:true,subCommand:[{name:"popup",version:"0.0.1",example:"dphelper.screen.popup.save('myPopup', window)",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Manage popup windows positions across monitor changes.",env:"client",subCommand:[{name:"save",version:"0.0.1",example:"dphelper.screen.popup.save('myPopup', window)",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Save popup position with monitor fingerprint",env:"client",subCommand:[]},{name:"restore",version:"0.0.1",example:"dphelper.screen.popup.restore('myPopup')",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Restore popup position (auto-adjusts if monitor changed)",env:"client",subCommand:[]},{name:"remove",version:"0.0.1",example:"dphelper.screen.popup.remove('myPopup')",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Remove saved popup position",env:"client",subCommand:[]},{name:"list",version:"0.0.1",example:"dphelper.screen.popup.list()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"List all saved popup positions",env:"client",subCommand:[]},{name:"getCurrentMonitor",version:"0.0.1",example:"dphelper.screen.popup.getCurrentMonitor()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Get current monitor info",env:"client",subCommand:[]},{name:"clear",version:"0.0.1",example:"dphelper.screen.popup.clear()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Clear all saved popup positions",env:"client",subCommand:[]}]},{name:"fullScreen",version:"0.0.2",example:"dphelper.screen.fullScreen([element])",author:"Dario Passariello",creationDate:"20240101",lastMod:"20240101",type:"function",active:true,description:"Enter full screen mode for a given element.",env:"client",subCommand:[]},{name:"toggle",version:"0.0.2",example:"dphelper.screen.toggle([element])",author:"Dario Passariello",creationDate:"20240101",lastMod:"20240101",type:"function",active:true,description:"Toggle full screen mode for a given element.",env:"client",subCommand:[]}]},E={fullScreen:e=>{let t=document.querySelector(e);t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen();},toggle:e=>{let t=document,r=t.querySelector(e);r?t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement?t.exitFullscreen?t.exitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.msExitFullscreen&&t.msExitFullscreen():r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen():console.error(`Element not found: ${e}`);},info:()=>({width:screen.width,height:screen.height,availWidth:screen.availWidth,availHeight:screen.availHeight,colorDepth:screen.colorDepth,pixelDepth:screen.pixelDepth}),popup:{save:(e,t)=>{a.save(e,t);},restore:e=>a.restore(e),remove:e=>{a.remove(e);},list:()=>a.list(),getCurrentMonitor:()=>a.getCurrentMonitor(),clear:()=>{a.clear();}}};dphelper?.setDescription(k,E);var G=dphelper.screen;exports.screen=G;
1
+ 'use strict';var b={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var w={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...b},configurable:true,writable:true},version:{value:w.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var l=dphelper;Object.defineProperty(l,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(l,"setDescription",{value:(e,t)=>{Object.defineProperties(l,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(l[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),l.setProps(l,e,{writable:false,configurable:false,enumerable:false}),l._list.scripts.push(e);}});var m="dphelper_popup_positions",v=(e,t,r,i)=>`${e}x${t}@${r},${i}`,d=()=>{let e=[];return e.push({id:"primary",width:screen.width,height:screen.height,left:0,top:0,isPrimary:true}),window.screenLeft!==void 0&&window.screenTop!==void 0&&(window.screenLeft>0||window.screenTop>0)&&e.push({id:`secondary_${Date.now()}`,width:window.innerWidth,height:window.innerHeight,left:window.screenLeft,top:window.screenTop,isPrimary:false}),e},g=(e,t)=>{let r=d();for(let o of r)if(e>=o.left&&e<o.left+o.width&&t>=o.top&&t<o.top+o.height)return o;if(!r.length)return {id:"default",width:screen.width,height:screen.height,left:0,top:0,isPrimary:true};let i=r[0],s=1/0;for(let o of r){let p=o.left+o.width/2,u=o.top+o.height/2,n=Math.sqrt(Math.pow(p-e,2)+Math.pow(u-t,2));n<s&&(s=n,i=o);}return i},F=(e,t,r)=>({relX:e-r.left,relY:t-r.top}),x=(e,t,r)=>({left:r.left+e,top:r.top+t}),C=(e,t)=>{if(typeof window>"u")return;let r=t||window,i=r.screenX||r.screenLeft||0,s=r.screenY||r.screenTop||0,o=r.outerWidth||800,p=r.outerHeight||600,u=d(),n=g(i,s),{relX:y,relY:M}=F(i,s,n),P=v(n.width,n.height,n.left,n.top),h=f();h.monitors=u,h.popups[e]={id:e,monitorId:n.id,left:y,top:M,width:o,height:p,monitorFingerprint:P},localStorage.setItem(m,JSON.stringify(h));},q=e=>{if(typeof window>"u")return null;let t=f(),r=t.popups[e];if(!r)return null;let i=d(),s=i.find(n=>v(n.width,n.height,n.left,n.top)===r.monitorFingerprint),o;s?o=s:(console.warn(`[dphelper] Monitor changed, restoring popup "${e}" on closest available monitor`),o=g(r.left+(i[0]?.left||0),r.top+(i[0]?.top||0)));let{left:p,top:u}=x(r.left,r.top,o);return {left:p,top:u,width:r.width,height:r.height}},R=e=>{let t=f();delete t.popups[e],localStorage.setItem(m,JSON.stringify(t));},I=()=>f().popups,j=()=>g(window.screenX||0,window.screenY||0),O=()=>{localStorage.removeItem(m);},f=()=>{try{let e=localStorage.getItem(m);if(e)return JSON.parse(e)}catch(e){console.warn("[dphelper] Failed to parse popup storage:",e);}return {monitors:[],popups:{}}},a={save:C,restore:q,remove:R,list:I,clear:O,getMonitors:d,getCurrentMonitor:j};var k={name:"screen",active:true,subCommand:[{name:"popup",version:"0.0.1",example:"dphelper.screen.popup.save('myPopup', window)",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Manage popup windows positions across monitor changes.",env:"client",subCommand:[{name:"save",version:"0.0.1",example:"dphelper.screen.popup.save('myPopup', window)",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Save popup position with monitor fingerprint",env:"client",subCommand:[]},{name:"restore",version:"0.0.1",example:"dphelper.screen.popup.restore('myPopup')",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Restore popup position (auto-adjusts if monitor changed)",env:"client",subCommand:[]},{name:"remove",version:"0.0.1",example:"dphelper.screen.popup.remove('myPopup')",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Remove saved popup position",env:"client",subCommand:[]},{name:"list",version:"0.0.1",example:"dphelper.screen.popup.list()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"List all saved popup positions",env:"client",subCommand:[]},{name:"getCurrentMonitor",version:"0.0.1",example:"dphelper.screen.popup.getCurrentMonitor()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Get current monitor info",env:"client",subCommand:[]},{name:"clear",version:"0.0.1",example:"dphelper.screen.popup.clear()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Clear all saved popup positions",env:"client",subCommand:[]}]},{name:"fullScreen",version:"0.0.2",example:"dphelper.screen.fullScreen([element])",author:"Dario Passariello",creationDate:"20240101",lastMod:"20240101",type:"function",active:true,description:"Enter full screen mode for a given element.",env:"client",subCommand:[]},{name:"toggle",version:"0.0.2",example:"dphelper.screen.toggle([element])",author:"Dario Passariello",creationDate:"20240101",lastMod:"20240101",type:"function",active:true,description:"Toggle full screen mode for a given element.",env:"client",subCommand:[]}]},E={fullScreen:e=>{let t=document.querySelector(e);t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen();},toggle:e=>{let t=document,r=t.querySelector(e);r?t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement?t.exitFullscreen?t.exitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.msExitFullscreen&&t.msExitFullscreen():r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen():console.error(`Element not found: ${e}`);},info:()=>({width:screen.width,height:screen.height,availWidth:screen.availWidth,availHeight:screen.availHeight,colorDepth:screen.colorDepth,pixelDepth:screen.pixelDepth}),popup:{save:(e,t)=>{a.save(e,t);},restore:e=>a.restore(e),remove:e=>{a.remove(e);},list:()=>a.list(),getCurrentMonitor:()=>a.getCurrentMonitor(),clear:()=>{a.clear();}}};dphelper?.setDescription(k,E);var G=dphelper.screen;exports.screen=G;
@@ -1,15 +1,15 @@
1
1
  /// <reference path="../types/dphelper.d.ts" />
2
- export interface ScreenTool {
3
- fullScreen: (el: string) => void
4
- toggle: (el: string) => void
5
- info: () => {
6
- width: number
7
- height: number
8
- availWidth: number
9
- availHeight: number
10
- colorDepth: number
11
- pixelDepth: number
12
- }
2
+ export interface ScreenTool {
3
+ fullScreen: (el: string) => void
4
+ toggle: (el: string) => void
5
+ info: () => {
6
+ width: number
7
+ height: number
8
+ availWidth: number
9
+ availHeight: number
10
+ colorDepth: number
11
+ pixelDepth: number
12
+ }
13
13
  }
14
14
 
15
15
  export const screen: ScreenTool
package/modules/screen.js CHANGED
@@ -1 +1 @@
1
- var w={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var v={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...w},configurable:true,writable:true},version:{value:v.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var l=dphelper;Object.defineProperty(l,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(l,"setDescription",{value:(e,t)=>{Object.defineProperties(l,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(l[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),l.setProps(l,e,{writable:false,configurable:false,enumerable:false}),l._list.scripts.push(e);}});var d="dphelper_popup_positions",y=(e,t,r,i)=>`${e}x${t}@${r},${i}`,f=()=>{let e=[];return e.push({id:"primary",width:screen.width,height:screen.height,left:0,top:0,isPrimary:true}),window.screenLeft!==void 0&&window.screenTop!==void 0&&(window.screenLeft>0||window.screenTop>0)&&e.push({id:`secondary_${Date.now()}`,width:window.innerWidth,height:window.innerHeight,left:window.screenLeft,top:window.screenTop,isPrimary:false}),e},b=(e,t)=>{let r=f();for(let o of r)if(e>=o.left&&e<o.left+o.width&&t>=o.top&&t<o.top+o.height)return o;if(!r.length)return {id:"default",width:screen.width,height:screen.height,left:0,top:0,isPrimary:true};let i=r[0],s=1/0;for(let o of r){let p=o.left+o.width/2,u=o.top+o.height/2,n=Math.sqrt(Math.pow(p-e,2)+Math.pow(u-t,2));n<s&&(s=n,i=o);}return i},x=(e,t,r)=>({relX:e-r.left,relY:t-r.top}),C=(e,t,r)=>({left:r.left+e,top:r.top+t}),q=(e,t)=>{if(typeof window>"u")return;let r=t||window,i=r.screenX||r.screenLeft||0,s=r.screenY||r.screenTop||0,o=r.outerWidth||800,p=r.outerHeight||600,u=f(),n=b(i,s),{relX:M,relY:P}=x(i,s,n),D=y(n.width,n.height,n.left,n.top),g=h();g.monitors=u,g.popups[e]={id:e,monitorId:n.id,left:M,top:P,width:o,height:p,monitorFingerprint:D},localStorage.setItem(d,JSON.stringify(g));},R=e=>{if(typeof window>"u")return null;let t=h(),r=t.popups[e];if(!r)return null;let i=f(),s=i.find(n=>y(n.width,n.height,n.left,n.top)===r.monitorFingerprint),o;s?o=s:(console.warn(`[dphelper] Monitor changed, restoring popup "${e}" on closest available monitor`),o=b(r.left+(i[0]?.left||0),r.top+(i[0]?.top||0)));let{left:p,top:u}=C(r.left,r.top,o);return {left:p,top:u,width:r.width,height:r.height}},I=e=>{let t=h();delete t.popups[e],localStorage.setItem(d,JSON.stringify(t));},j=()=>h().popups,O=()=>b(window.screenX||0,window.screenY||0),k=()=>{localStorage.removeItem(d);},h=()=>{try{let e=localStorage.getItem(d);if(e)return JSON.parse(e)}catch(e){console.warn("[dphelper] Failed to parse popup storage:",e);}return {monitors:[],popups:{}}},a={save:q,restore:R,remove:I,list:j,clear:k,getMonitors:f,getCurrentMonitor:O};var E={name:"screen",active:true,subCommand:[{name:"popup",version:"0.0.1",example:"dphelper.screen.popup.save('myPopup', window)",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Manage popup windows positions across monitor changes.",env:"client",subCommand:[{name:"save",version:"0.0.1",example:"dphelper.screen.popup.save('myPopup', window)",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Save popup position with monitor fingerprint",env:"client",subCommand:[]},{name:"restore",version:"0.0.1",example:"dphelper.screen.popup.restore('myPopup')",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Restore popup position (auto-adjusts if monitor changed)",env:"client",subCommand:[]},{name:"remove",version:"0.0.1",example:"dphelper.screen.popup.remove('myPopup')",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Remove saved popup position",env:"client",subCommand:[]},{name:"list",version:"0.0.1",example:"dphelper.screen.popup.list()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"List all saved popup positions",env:"client",subCommand:[]},{name:"getCurrentMonitor",version:"0.0.1",example:"dphelper.screen.popup.getCurrentMonitor()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Get current monitor info",env:"client",subCommand:[]},{name:"clear",version:"0.0.1",example:"dphelper.screen.popup.clear()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Clear all saved popup positions",env:"client",subCommand:[]}]},{name:"fullScreen",version:"0.0.2",example:"dphelper.screen.fullScreen([element])",author:"Dario Passariello",creationDate:"20240101",lastMod:"20240101",type:"function",active:true,description:"Enter full screen mode for a given element.",env:"client",subCommand:[]},{name:"toggle",version:"0.0.2",example:"dphelper.screen.toggle([element])",author:"Dario Passariello",creationDate:"20240101",lastMod:"20240101",type:"function",active:true,description:"Toggle full screen mode for a given element.",env:"client",subCommand:[]}]},J={fullScreen:e=>{let t=document.querySelector(e);t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen();},toggle:e=>{let t=document,r=t.querySelector(e);r?t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement?t.exitFullscreen?t.exitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.msExitFullscreen&&t.msExitFullscreen():r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen():console.error(`Element not found: ${e}`);},info:()=>({width:screen.width,height:screen.height,availWidth:screen.availWidth,availHeight:screen.availHeight,colorDepth:screen.colorDepth,pixelDepth:screen.pixelDepth}),popup:{save:(e,t)=>{a.save(e,t);},restore:e=>a.restore(e),remove:e=>{a.remove(e);},list:()=>a.list(),getCurrentMonitor:()=>a.getCurrentMonitor(),clear:()=>{a.clear();}}};dphelper?.setDescription(E,J);var K=dphelper.screen;export{K as screen};
1
+ var w={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var v={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...w},configurable:true,writable:true},version:{value:v.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var l=dphelper;Object.defineProperty(l,"setProps",{value:(e,t,r)=>{Object.defineProperty(e,t.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(e[t.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(l,"setDescription",{value:(e,t)=>{Object.defineProperties(l,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(l[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),l.setProps(l,e,{writable:false,configurable:false,enumerable:false}),l._list.scripts.push(e);}});var d="dphelper_popup_positions",y=(e,t,r,i)=>`${e}x${t}@${r},${i}`,f=()=>{let e=[];return e.push({id:"primary",width:screen.width,height:screen.height,left:0,top:0,isPrimary:true}),window.screenLeft!==void 0&&window.screenTop!==void 0&&(window.screenLeft>0||window.screenTop>0)&&e.push({id:`secondary_${Date.now()}`,width:window.innerWidth,height:window.innerHeight,left:window.screenLeft,top:window.screenTop,isPrimary:false}),e},b=(e,t)=>{let r=f();for(let o of r)if(e>=o.left&&e<o.left+o.width&&t>=o.top&&t<o.top+o.height)return o;if(!r.length)return {id:"default",width:screen.width,height:screen.height,left:0,top:0,isPrimary:true};let i=r[0],s=1/0;for(let o of r){let p=o.left+o.width/2,u=o.top+o.height/2,n=Math.sqrt(Math.pow(p-e,2)+Math.pow(u-t,2));n<s&&(s=n,i=o);}return i},x=(e,t,r)=>({relX:e-r.left,relY:t-r.top}),C=(e,t,r)=>({left:r.left+e,top:r.top+t}),q=(e,t)=>{if(typeof window>"u")return;let r=t||window,i=r.screenX||r.screenLeft||0,s=r.screenY||r.screenTop||0,o=r.outerWidth||800,p=r.outerHeight||600,u=f(),n=b(i,s),{relX:M,relY:P}=x(i,s,n),D=y(n.width,n.height,n.left,n.top),g=h();g.monitors=u,g.popups[e]={id:e,monitorId:n.id,left:M,top:P,width:o,height:p,monitorFingerprint:D},localStorage.setItem(d,JSON.stringify(g));},R=e=>{if(typeof window>"u")return null;let t=h(),r=t.popups[e];if(!r)return null;let i=f(),s=i.find(n=>y(n.width,n.height,n.left,n.top)===r.monitorFingerprint),o;s?o=s:(console.warn(`[dphelper] Monitor changed, restoring popup "${e}" on closest available monitor`),o=b(r.left+(i[0]?.left||0),r.top+(i[0]?.top||0)));let{left:p,top:u}=C(r.left,r.top,o);return {left:p,top:u,width:r.width,height:r.height}},I=e=>{let t=h();delete t.popups[e],localStorage.setItem(d,JSON.stringify(t));},j=()=>h().popups,O=()=>b(window.screenX||0,window.screenY||0),k=()=>{localStorage.removeItem(d);},h=()=>{try{let e=localStorage.getItem(d);if(e)return JSON.parse(e)}catch(e){console.warn("[dphelper] Failed to parse popup storage:",e);}return {monitors:[],popups:{}}},a={save:q,restore:R,remove:I,list:j,clear:k,getMonitors:f,getCurrentMonitor:O};var E={name:"screen",active:true,subCommand:[{name:"popup",version:"0.0.1",example:"dphelper.screen.popup.save('myPopup', window)",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Manage popup windows positions across monitor changes.",env:"client",subCommand:[{name:"save",version:"0.0.1",example:"dphelper.screen.popup.save('myPopup', window)",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Save popup position with monitor fingerprint",env:"client",subCommand:[]},{name:"restore",version:"0.0.1",example:"dphelper.screen.popup.restore('myPopup')",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Restore popup position (auto-adjusts if monitor changed)",env:"client",subCommand:[]},{name:"remove",version:"0.0.1",example:"dphelper.screen.popup.remove('myPopup')",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Remove saved popup position",env:"client",subCommand:[]},{name:"list",version:"0.0.1",example:"dphelper.screen.popup.list()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"List all saved popup positions",env:"client",subCommand:[]},{name:"getCurrentMonitor",version:"0.0.1",example:"dphelper.screen.popup.getCurrentMonitor()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Get current monitor info",env:"client",subCommand:[]},{name:"clear",version:"0.0.1",example:"dphelper.screen.popup.clear()",author:"Dario Passariello & Jo",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Clear all saved popup positions",env:"client",subCommand:[]}]},{name:"fullScreen",version:"0.0.2",example:"dphelper.screen.fullScreen([element])",author:"Dario Passariello",creationDate:"20240101",lastMod:"20240101",type:"function",active:true,description:"Enter full screen mode for a given element.",env:"client",subCommand:[]},{name:"toggle",version:"0.0.2",example:"dphelper.screen.toggle([element])",author:"Dario Passariello",creationDate:"20240101",lastMod:"20240101",type:"function",active:true,description:"Toggle full screen mode for a given element.",env:"client",subCommand:[]}]},J={fullScreen:e=>{let t=document.querySelector(e);t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen();},toggle:e=>{let t=document,r=t.querySelector(e);r?t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement?t.exitFullscreen?t.exitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.msExitFullscreen&&t.msExitFullscreen():r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen():console.error(`Element not found: ${e}`);},info:()=>({width:screen.width,height:screen.height,availWidth:screen.availWidth,availHeight:screen.availHeight,colorDepth:screen.colorDepth,pixelDepth:screen.pixelDepth}),popup:{save:(e,t)=>{a.save(e,t);},restore:e=>a.restore(e),remove:e=>{a.remove(e);},list:()=>a.list(),getCurrentMonitor:()=>a.getCurrentMonitor(),clear:()=>{a.clear();}}};dphelper?.setDescription(E,J);var K=dphelper.screen;export{K as screen};
@@ -1,4 +1,4 @@
1
- 'use strict';var m={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var b={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...m},configurable:true,writable:true},version:{value:b.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var n=dphelper;Object.defineProperty(n,"setProps",{value:(t,e,r)=>{Object.defineProperty(t,e.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(t[e.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(n,"setDescription",{value:(t,e)=>{Object.defineProperties(n,{[t.name]:{value:e,writable:false,configurable:false,enumerable:false}}),Object.keys(e).map(r=>(Object.defineProperties(n[t.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),n.setProps(n,t,{writable:false,configurable:false,enumerable:false}),n._list.scripts.push(t);}});var y={name:"scrollbar",active:true,subCommand:[{name:"custom",version:"0.0.2",example:"dphelper.scrollbar.custom(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Apply custom styles to the scrollbar for the selected elements.",env:"client",subCommand:[]},{name:"indicator",version:"0.0.2",example:"dphelper.scrollbar.indicator(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Add a scroll indicator to the selected elements.",env:"client",subCommand:[]},{name:"position.get",version:"0.0.2",example:"dphelper.scrollbar.position.get(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Get the current scroll position of the selected elements.",env:"client",subCommand:[]},{name:"position.set",version:"0.0.2",example:"dphelper.scrollbar.position.set(selector, position)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Set the scroll position of the selected elements.",env:"client",subCommand:[]},{name:"smooth",version:"0.0.2",example:"dphelper.scrollbar.smooth(container, element, gap)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Smoothly scroll to a specific element within a container with an optional gap.",env:"client",subCommand:[]},{name:"scrollTo",version:"0.0.2",example:"dphelper.scrollbar.scrollTo(container, element, gap)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Scroll to a specific element within a container with an optional gap.",env:"client",subCommand:[]}]},v={custom:(t,e)=>{e.color_1=e?.color_1||"black",e.color_1_hover=e?.color_1_hover||"black",e.color_2=e?.color_2||"transparent",e.color_3=e?.color_3||"rgba(30,150,255,.5)",e.type=e?.type||"thin",e.behavior=e?.behavior||"smooth",e.width=e?.width||"16px",e.height=e?.height||"16px",e.rounded=e?.rounded||"10px",e.margin=e?.margin||0,e.border=e?.border||"5px",e.opacity=e?.opacity||1;let r=` ${t}::-webkit-scrollbar {
1
+ 'use strict';var m={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var b={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...m},configurable:true,writable:true},version:{value:b.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var n=dphelper;Object.defineProperty(n,"setProps",{value:(t,e,r)=>{Object.defineProperty(t,e.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(t[e.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(n,"setDescription",{value:(t,e)=>{Object.defineProperties(n,{[t.name]:{value:e,writable:false,configurable:false,enumerable:false}}),Object.keys(e).map(r=>(Object.defineProperties(n[t.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),n.setProps(n,t,{writable:false,configurable:false,enumerable:false}),n._list.scripts.push(t);}});var y={name:"scrollbar",active:true,subCommand:[{name:"custom",version:"0.0.2",example:"dphelper.scrollbar.custom(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Apply custom styles to the scrollbar for the selected elements.",env:"client",subCommand:[]},{name:"indicator",version:"0.0.2",example:"dphelper.scrollbar.indicator(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Add a scroll indicator to the selected elements.",env:"client",subCommand:[]},{name:"position.get",version:"0.0.2",example:"dphelper.scrollbar.position.get(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Get the current scroll position of the selected elements.",env:"client",subCommand:[]},{name:"position.set",version:"0.0.2",example:"dphelper.scrollbar.position.set(selector, position)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Set the scroll position of the selected elements.",env:"client",subCommand:[]},{name:"smooth",version:"0.0.2",example:"dphelper.scrollbar.smooth(container, element, gap)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Smoothly scroll to a specific element within a container with an optional gap.",env:"client",subCommand:[]},{name:"scrollTo",version:"0.0.2",example:"dphelper.scrollbar.scrollTo(container, element, gap)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Scroll to a specific element within a container with an optional gap.",env:"client",subCommand:[]}]},v={custom:(t,e)=>{e.color_1=e?.color_1||"black",e.color_1_hover=e?.color_1_hover||"black",e.color_2=e?.color_2||"transparent",e.color_3=e?.color_3||"rgba(30,150,255,.5)",e.type=e?.type||"thin",e.behavior=e?.behavior||"smooth",e.width=e?.width||"16px",e.height=e?.height||"16px",e.rounded=e?.rounded||"10px",e.margin=e?.margin||0,e.border=e?.border||"5px",e.opacity=e?.opacity||1;let r=` ${t}::-webkit-scrollbar {
2
2
  scroll-behavior: ${e.behavior};
3
3
  width: ${e.width};
4
4
  height: ${e.height};
@@ -1,13 +1,13 @@
1
1
  /// <reference path="../types/dphelper.d.ts" />
2
- export interface ScrollbarTool {
3
- custom: (el: string, options: any) => void
4
- indicator: (props: any) => void
5
- position: {
6
- get: (el: any) => void
7
- set: (el: any) => void
8
- }
9
- smooth: (target: any, speed: any, smooth: any) => void
10
- scrollTo: (container: string, element: string, gap?: number) => void
2
+ export interface ScrollbarTool {
3
+ custom: (el: string, options: any) => void
4
+ indicator: (props: any) => void
5
+ position: {
6
+ get: (el: any) => void
7
+ set: (el: any) => void
8
+ }
9
+ smooth: (target: any, speed: any, smooth: any) => void
10
+ scrollTo: (container: string, element: string, gap?: number) => void
11
11
  }
12
12
 
13
13
  export const scrollbar: ScrollbarTool
@@ -1,4 +1,4 @@
1
- var b={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var p={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...b},configurable:true,writable:true},version:{value:p.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var n=dphelper;Object.defineProperty(n,"setProps",{value:(t,e,r)=>{Object.defineProperty(t,e.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(t[e.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(n,"setDescription",{value:(t,e)=>{Object.defineProperties(n,{[t.name]:{value:e,writable:false,configurable:false,enumerable:false}}),Object.keys(e).map(r=>(Object.defineProperties(n[t.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),n.setProps(n,t,{writable:false,configurable:false,enumerable:false}),n._list.scripts.push(t);}});var v={name:"scrollbar",active:true,subCommand:[{name:"custom",version:"0.0.2",example:"dphelper.scrollbar.custom(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Apply custom styles to the scrollbar for the selected elements.",env:"client",subCommand:[]},{name:"indicator",version:"0.0.2",example:"dphelper.scrollbar.indicator(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Add a scroll indicator to the selected elements.",env:"client",subCommand:[]},{name:"position.get",version:"0.0.2",example:"dphelper.scrollbar.position.get(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Get the current scroll position of the selected elements.",env:"client",subCommand:[]},{name:"position.set",version:"0.0.2",example:"dphelper.scrollbar.position.set(selector, position)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Set the scroll position of the selected elements.",env:"client",subCommand:[]},{name:"smooth",version:"0.0.2",example:"dphelper.scrollbar.smooth(container, element, gap)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Smoothly scroll to a specific element within a container with an optional gap.",env:"client",subCommand:[]},{name:"scrollTo",version:"0.0.2",example:"dphelper.scrollbar.scrollTo(container, element, gap)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Scroll to a specific element within a container with an optional gap.",env:"client",subCommand:[]}]},w={custom:(t,e)=>{e.color_1=e?.color_1||"black",e.color_1_hover=e?.color_1_hover||"black",e.color_2=e?.color_2||"transparent",e.color_3=e?.color_3||"rgba(30,150,255,.5)",e.type=e?.type||"thin",e.behavior=e?.behavior||"smooth",e.width=e?.width||"16px",e.height=e?.height||"16px",e.rounded=e?.rounded||"10px",e.margin=e?.margin||0,e.border=e?.border||"5px",e.opacity=e?.opacity||1;let r=` ${t}::-webkit-scrollbar {
1
+ var b={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var p={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...b},configurable:true,writable:true},version:{value:p.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var n=dphelper;Object.defineProperty(n,"setProps",{value:(t,e,r)=>{Object.defineProperty(t,e.name,r||{writable:false,configurable:false,enumerable:false}),r?.lock&&Object.freeze(t[e.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(n,"setDescription",{value:(t,e)=>{Object.defineProperties(n,{[t.name]:{value:e,writable:false,configurable:false,enumerable:false}}),Object.keys(e).map(r=>(Object.defineProperties(n[t.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),n.setProps(n,t,{writable:false,configurable:false,enumerable:false}),n._list.scripts.push(t);}});var v={name:"scrollbar",active:true,subCommand:[{name:"custom",version:"0.0.2",example:"dphelper.scrollbar.custom(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Apply custom styles to the scrollbar for the selected elements.",env:"client",subCommand:[]},{name:"indicator",version:"0.0.2",example:"dphelper.scrollbar.indicator(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Add a scroll indicator to the selected elements.",env:"client",subCommand:[]},{name:"position.get",version:"0.0.2",example:"dphelper.scrollbar.position.get(selector)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Get the current scroll position of the selected elements.",env:"client",subCommand:[]},{name:"position.set",version:"0.0.2",example:"dphelper.scrollbar.position.set(selector, position)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Set the scroll position of the selected elements.",env:"client",subCommand:[]},{name:"smooth",version:"0.0.2",example:"dphelper.scrollbar.smooth(container, element, gap)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Smoothly scroll to a specific element within a container with an optional gap.",env:"client",subCommand:[]},{name:"scrollTo",version:"0.0.2",example:"dphelper.scrollbar.scrollTo(container, element, gap)",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"Scroll to a specific element within a container with an optional gap.",env:"client",subCommand:[]}]},w={custom:(t,e)=>{e.color_1=e?.color_1||"black",e.color_1_hover=e?.color_1_hover||"black",e.color_2=e?.color_2||"transparent",e.color_3=e?.color_3||"rgba(30,150,255,.5)",e.type=e?.type||"thin",e.behavior=e?.behavior||"smooth",e.width=e?.width||"16px",e.height=e?.height||"16px",e.rounded=e?.rounded||"10px",e.margin=e?.margin||0,e.border=e?.border||"5px",e.opacity=e?.opacity||1;let r=` ${t}::-webkit-scrollbar {
2
2
  scroll-behavior: ${e.behavior};
3
3
  width: ${e.width};
4
4
  height: ${e.height};
@@ -1 +1 @@
1
- 'use strict';var f={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var m={version:"4.5.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...f},configurable:true,writable:true},version:{value:m.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var l=dphelper;Object.defineProperty(l,"setProps",{value:(e,r,n)=>{Object.defineProperty(e,r.name,n||{writable:false,configurable:false,enumerable:false}),n?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(l,"setDescription",{value:(e,r)=>{Object.defineProperties(l,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(n=>(Object.defineProperties(l[e.name],{[n]:{writable:false,configurable:false,enumerable:false}}),null)),l.setProps(l,e,{writable:false,configurable:false,enumerable:false}),l._list.scripts.push(e);}});var x={name:"security",active:true,subCommand:[{name:"uuid",version:"0.0.2",example:"dphelper.security.uuid",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"UUID related commands",subCommand:[{name:"byVal",version:"0.0.2",example:"dphelper.security.uuid.byVal('string')",author:"Dario Passariello",creationDate:"20250101",lastMod:"20250101",type:"function",active:true,description:"Generate a UUID based on a given string",env:"both",subCommand:[]},{name:"v4",version:"0.0.2",example:"dphelper.security.uuid.v4",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"return",active:true,description:"Generate a random UUID v4",env:"both",subCommand:[]},{name:"v5",version:"0.0.2",example:"dphelper.security.uuid.v5",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"return",active:true,description:"Generate a random UUID v5",env:"both",subCommand:[]}]},{name:"hashPass",description:"Generate a crypto digest starting from user and password values (Uses SHA-256, CNSA compliant)",example:"dphelper.security.hashPass(user, password)",version:"0.0.3",type:"function",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260329",active:true,env:"both",subCommand:[]},{name:"crypt",description:"Encrypt your message using a secret_key in a default format AES",example:"dphelper.security.crypt(data, secret_key, [optional mode])",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"deCrypt",description:"Decrypt your message using a secret_key in a default format AES",example:"dphelper.security.deCrypt(data, secret_key, [optional mode])",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"AES_KeyGen",description:"Generate a key based on the AES algorithm",example:"dphelper.security.AES_KeyGen(secret_key)",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"SHA256_Hex",description:"Generate a SHA256 hash in hexadecimal format",example:"dphelper.security.SHA256_Hex(secret_key)",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20250101",lastMod:"20250101",active:true,env:"both",subCommand:[]},{name:"ulid",description:"Generate ULID code",example:"dphelper.security.ulid()",version:"0.0.2",type:"function",author:"mix",creationDate:"20250212",lastMod:"20250212",active:true,env:"both",subCommand:[]},{name:"fingerprint",description:"Generate a unique browser fingerprint",example:"dphelper.security.fingerprint()",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"saveEncrypted",description:"Save encrypted data to localStorage",example:"dphelper.security.saveEncrypted('key', 'value', 'secret')",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"getEncrypted",description:"Retrieve and decrypt data from localStorage",example:"dphelper.security.getEncrypted('key', 'secret')",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",active:true,env:"both",subCommand:[]}]},p=new TextEncoder,A=new TextDecoder,S=e=>{let r=new Uint8Array(e),n="";for(let t=0;t<r.byteLength;t++)n+=String.fromCharCode(r[t]);return btoa(n)},D=e=>{let r=atob(e),n=new Uint8Array(r.length);for(let t=0;t<r.length;t++)n[t]=r.charCodeAt(t);return n.buffer},P=async e=>{let r=p.encode(e),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")},h=async(e,r)=>{let n=p.encode(r),t=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:"SHA-256"},false,["sign"]),s=await crypto.subtle.sign("HMAC",t,p.encode(e));return Array.from(new Uint8Array(s)).map(a=>a.toString(16).padStart(2,"0")).join("")},g=async(e,r,n)=>{let t=await crypto.subtle.importKey("raw",p.encode(e),"PBKDF2",false,["deriveBits","deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:r.buffer,iterations:n,hash:"SHA-256"},t,{name:"AES-GCM",length:256},false,["encrypt","decrypt"])},C=async(e,r)=>{let n=crypto.getRandomValues(new Uint8Array(16)),t=crypto.getRandomValues(new Uint8Array(12)),s=await g(r,new Uint8Array(n.buffer),31e4),i=await crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(t.buffer)},s,p.encode(e)),a=new Uint8Array(n.length+t.length+i.byteLength);return a.set(n,0),a.set(t,n.length),a.set(new Uint8Array(i),n.length+t.length),S(a.buffer)},U=async(e,r)=>{try{let n=new Uint8Array(D(e)),t=n.slice(0,16),s=n.slice(16,28),i=n.slice(28),a=await g(r,new Uint8Array(t.buffer),31e4),o=await crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(s.buffer)},a,i);return A.decode(o)}catch{return ""}},b=-1,c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","J","K","M","N","P","Q","R","S","T","V","W","X","Y","Z"],k={uuid:{byVal:async e=>{if(!e)return console.warn("You need to pass a value to obtain a fixed uuid"),"";let r=await dphelper.security.SHA256_Hex(e);return [r.slice(0,8),r.slice(8,4),`4${r.slice(12,3)}`,`8${r.slice(15,3)}`,r.slice(18,12)].join("-")},v4:"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16)),v5:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let r=crypto.getRandomValues(new Uint8Array(1))[0];return (e==="x"?r:r&3|8).toString(16)})},hashPass:async(e,r)=>{if(!e||!r)return console.warn("hashPass: user and password are required"),"";let n=new TextEncoder,t=crypto.getRandomValues(new Uint8Array(16)),s=Array.from(t).map(u=>u.toString(16).padStart(2,"0")).join(""),i=await crypto.subtle.importKey("raw",n.encode(r.toLowerCase()+e.toLowerCase()),{name:"PBKDF2"},false,["deriveBits"]),a=await crypto.subtle.deriveBits({name:"PBKDF2",salt:t.buffer,iterations:31e4,hash:"SHA-256"},i,256),d=Array.from(new Uint8Array(a)).map(u=>u.toString(16).padStart(2,"0")).join("");return s+d},crypt:async(e,r)=>await C(e,r),deCrypt:async(e,r)=>await U(e,r),AES_KeyGen:async e=>{let r=e||crypto.randomUUID(),n=crypto.getRandomValues(new Uint8Array(16)),t=Array.from(n).map(a=>a.toString(16).padStart(2,"0")).join(""),s=await crypto.subtle.deriveBits({name:"PBKDF2",salt:n.buffer,iterations:31e4,hash:"SHA-256"},await crypto.subtle.importKey("raw",p.encode(r),"PBKDF2",false,["deriveBits"]),512),i=Array.from(new Uint8Array(s));return t+i.map(a=>a.toString(16).padStart(2,"0")).join("")},SHA256_Hex:async e=>P(e),ulid:()=>{let e=new Uint8Array(16),r=new DataView(e.buffer,0,6),n=new Uint8Array(e.buffer,6,10),t=new Array(26),s=a=>{t[0]=c[a[0]>>5],t[1]=c[a[0]>>0&31];for(let o=0;o<3;o++)t[o*8+2]=c[a[o*5+1]>>3],t[o*8+3]=c[(a[o*5+1]<<2|a[o*5+2]>>6)&31],t[o*8+4]=c[a[o*5+2]>>1&31],t[o*8+5]=c[(a[o*5+2]<<4|a[o*5+3]>>4)&31],t[o*8+6]=c[(a[o*5+3]<<1|a[o*5+4]>>7)&31],t[o*8+7]=c[a[o*5+4]>>2&31],t[o*8+8]=c[(a[o*5+4]<<3|a[o*5+5]>>5)&31],t[o*8+9]=c[a[o*5+5]>>0&31];return t.join("")},i=Date.now();if(i===b)for(let a=9;a>=0&&!(n[a]!==void 0&&n[a]++<255);a--);else b=i,r.setUint16(0,i/4294967296|0),r.setUint32(2,i|0),window.crypto.getRandomValues(n);return s(e)},fingerprint:async e=>{let r=e?.requireConsent!==false,n=e?.consent;if(r&&n!==true)return console.warn("dphelper.security.fingerprint: User consent required. Pass { consent: true } to enable."),console.warn("dphelper.security.fingerprint: Fingerprinting is subject to GDPR/CCPA. Ensure privacy policy and user consent."),"";let t=navigator,s=window.screen,i=document.createElement("canvas"),a=i.getContext("2d"),o="dphelper_fingerprint_v1",d="";a&&(i.width=200,i.height=30,a.textBaseline="top",a.font="14px 'Arial'",a.textBaseline="alphabetic",a.fillStyle="#f60",a.fillRect(125,1,62,20),a.fillStyle="#069",a.fillText(o,2,15),a.fillStyle="rgba(102, 204, 0, 0.7)",a.fillText(o,4,17),d=i.toDataURL());let u=[t.userAgent,t.language,s.colorDepth,s.width+"x"+s.height,new Date().getTimezoneOffset(),t.deviceMemory||"unknown",t.hardwareConcurrency||"unknown",d].join("|");return dphelper.security.SHA256_Hex(u)},saveEncrypted:async(e,r,n)=>{if(typeof document>"u"||typeof window>"u"){console.warn("[dphelper] localStorage not available in this environment");return}let t=await dphelper.security.crypt(r,n),s=await h(t,n);localStorage.setItem(e,JSON.stringify({d:t,h:s,v:"2.0"}));},getEncrypted:async(e,r)=>{let n=localStorage.getItem(e);if(!n)return null;try{let t=JSON.parse(n);if(t&&t.h&&t.d){let s=await h(t.d,r);return t.h!==s?(console.error(`[dphelper] Security Alert: Data tampering detected for key "${e}"`),null):dphelper.security.deCrypt(t.d,r)}return dphelper.security.deCrypt(n,r)}catch{try{return dphelper.security.deCrypt(n,r)}catch(s){return console.warn(`[dphelper] Persistence Error for key "${e}":`,s),null}}}},B=k;typeof dphelper?.setDescription=="function"&&dphelper.setDescription(x,B);var F=dphelper.security;exports.security=F;
1
+ 'use strict';var f={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var m={version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...f},configurable:true,writable:true},version:{value:m.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var l=dphelper;Object.defineProperty(l,"setProps",{value:(e,r,n)=>{Object.defineProperty(e,r.name,n||{writable:false,configurable:false,enumerable:false}),n?.lock&&Object.freeze(e[r.name]);},writable:false,configurable:false,enumerable:false});Object.defineProperty(l,"setDescription",{value:(e,r)=>{Object.defineProperties(l,{[e.name]:{value:r,writable:false,configurable:false,enumerable:false}}),Object.keys(r).map(n=>(Object.defineProperties(l[e.name],{[n]:{writable:false,configurable:false,enumerable:false}}),null)),l.setProps(l,e,{writable:false,configurable:false,enumerable:false}),l._list.scripts.push(e);}});var x={name:"security",active:true,subCommand:[{name:"uuid",version:"0.0.2",example:"dphelper.security.uuid",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"function",active:true,description:"UUID related commands",subCommand:[{name:"byVal",version:"0.0.2",example:"dphelper.security.uuid.byVal('string')",author:"Dario Passariello",creationDate:"20250101",lastMod:"20250101",type:"function",active:true,description:"Generate a UUID based on a given string",env:"both",subCommand:[]},{name:"v4",version:"0.0.2",example:"dphelper.security.uuid.v4",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"return",active:true,description:"Generate a random UUID v4",env:"both",subCommand:[]},{name:"v5",version:"0.0.2",example:"dphelper.security.uuid.v5",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",type:"return",active:true,description:"Generate a random UUID v5",env:"both",subCommand:[]}]},{name:"hashPass",description:"Generate a crypto digest starting from user and password values (Uses SHA-256, CNSA compliant)",example:"dphelper.security.hashPass(user, password)",version:"0.0.3",type:"function",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260329",active:true,env:"both",subCommand:[]},{name:"crypt",description:"Encrypt your message using a secret_key in a default format AES",example:"dphelper.security.crypt(data, secret_key, [optional mode])",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"deCrypt",description:"Decrypt your message using a secret_key in a default format AES",example:"dphelper.security.deCrypt(data, secret_key, [optional mode])",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"AES_KeyGen",description:"Generate a key based on the AES algorithm",example:"dphelper.security.AES_KeyGen(secret_key)",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20210101",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"SHA256_Hex",description:"Generate a SHA256 hash in hexadecimal format",example:"dphelper.security.SHA256_Hex(secret_key)",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20250101",lastMod:"20250101",active:true,env:"both",subCommand:[]},{name:"ulid",description:"Generate ULID code",example:"dphelper.security.ulid()",version:"0.0.2",type:"function",author:"mix",creationDate:"20250212",lastMod:"20250212",active:true,env:"both",subCommand:[]},{name:"fingerprint",description:"Generate a unique browser fingerprint",example:"dphelper.security.fingerprint()",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"saveEncrypted",description:"Save encrypted data to localStorage",example:"dphelper.security.saveEncrypted('key', 'value', 'secret')",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",active:true,env:"both",subCommand:[]},{name:"getEncrypted",description:"Retrieve and decrypt data from localStorage",example:"dphelper.security.getEncrypted('key', 'secret')",version:"0.0.2",type:"function",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260220",active:true,env:"both",subCommand:[]}]},p=new TextEncoder,A=new TextDecoder,S=e=>{let r=new Uint8Array(e),n="";for(let t=0;t<r.byteLength;t++)n+=String.fromCharCode(r[t]);return btoa(n)},D=e=>{let r=atob(e),n=new Uint8Array(r.length);for(let t=0;t<r.length;t++)n[t]=r.charCodeAt(t);return n.buffer},P=async e=>{let r=p.encode(e),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")},h=async(e,r)=>{let n=p.encode(r),t=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:"SHA-256"},false,["sign"]),s=await crypto.subtle.sign("HMAC",t,p.encode(e));return Array.from(new Uint8Array(s)).map(a=>a.toString(16).padStart(2,"0")).join("")},g=async(e,r,n)=>{let t=await crypto.subtle.importKey("raw",p.encode(e),"PBKDF2",false,["deriveBits","deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:r.buffer,iterations:n,hash:"SHA-256"},t,{name:"AES-GCM",length:256},false,["encrypt","decrypt"])},C=async(e,r)=>{let n=crypto.getRandomValues(new Uint8Array(16)),t=crypto.getRandomValues(new Uint8Array(12)),s=await g(r,new Uint8Array(n.buffer),31e4),i=await crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(t.buffer)},s,p.encode(e)),a=new Uint8Array(n.length+t.length+i.byteLength);return a.set(n,0),a.set(t,n.length),a.set(new Uint8Array(i),n.length+t.length),S(a.buffer)},U=async(e,r)=>{try{let n=new Uint8Array(D(e)),t=n.slice(0,16),s=n.slice(16,28),i=n.slice(28),a=await g(r,new Uint8Array(t.buffer),31e4),o=await crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(s.buffer)},a,i);return A.decode(o)}catch{return ""}},b=-1,c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","J","K","M","N","P","Q","R","S","T","V","W","X","Y","Z"],k={uuid:{byVal:async e=>{if(!e)return console.warn("You need to pass a value to obtain a fixed uuid"),"";let r=await dphelper.security.SHA256_Hex(e);return [r.slice(0,8),r.slice(8,4),`4${r.slice(12,3)}`,`8${r.slice(15,3)}`,r.slice(18,12)].join("-")},v4:"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16)),v5:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let r=crypto.getRandomValues(new Uint8Array(1))[0];return (e==="x"?r:r&3|8).toString(16)})},hashPass:async(e,r)=>{if(!e||!r)return console.warn("hashPass: user and password are required"),"";let n=new TextEncoder,t=crypto.getRandomValues(new Uint8Array(16)),s=Array.from(t).map(u=>u.toString(16).padStart(2,"0")).join(""),i=await crypto.subtle.importKey("raw",n.encode(r.toLowerCase()+e.toLowerCase()),{name:"PBKDF2"},false,["deriveBits"]),a=await crypto.subtle.deriveBits({name:"PBKDF2",salt:t.buffer,iterations:31e4,hash:"SHA-256"},i,256),d=Array.from(new Uint8Array(a)).map(u=>u.toString(16).padStart(2,"0")).join("");return s+d},crypt:async(e,r)=>await C(e,r),deCrypt:async(e,r)=>await U(e,r),AES_KeyGen:async e=>{let r=e||crypto.randomUUID(),n=crypto.getRandomValues(new Uint8Array(16)),t=Array.from(n).map(a=>a.toString(16).padStart(2,"0")).join(""),s=await crypto.subtle.deriveBits({name:"PBKDF2",salt:n.buffer,iterations:31e4,hash:"SHA-256"},await crypto.subtle.importKey("raw",p.encode(r),"PBKDF2",false,["deriveBits"]),512),i=Array.from(new Uint8Array(s));return t+i.map(a=>a.toString(16).padStart(2,"0")).join("")},SHA256_Hex:async e=>P(e),ulid:()=>{let e=new Uint8Array(16),r=new DataView(e.buffer,0,6),n=new Uint8Array(e.buffer,6,10),t=new Array(26),s=a=>{t[0]=c[a[0]>>5],t[1]=c[a[0]>>0&31];for(let o=0;o<3;o++)t[o*8+2]=c[a[o*5+1]>>3],t[o*8+3]=c[(a[o*5+1]<<2|a[o*5+2]>>6)&31],t[o*8+4]=c[a[o*5+2]>>1&31],t[o*8+5]=c[(a[o*5+2]<<4|a[o*5+3]>>4)&31],t[o*8+6]=c[(a[o*5+3]<<1|a[o*5+4]>>7)&31],t[o*8+7]=c[a[o*5+4]>>2&31],t[o*8+8]=c[(a[o*5+4]<<3|a[o*5+5]>>5)&31],t[o*8+9]=c[a[o*5+5]>>0&31];return t.join("")},i=Date.now();if(i===b)for(let a=9;a>=0&&!(n[a]!==void 0&&n[a]++<255);a--);else b=i,r.setUint16(0,i/4294967296|0),r.setUint32(2,i|0),window.crypto.getRandomValues(n);return s(e)},fingerprint:async e=>{let r=e?.requireConsent!==false,n=e?.consent;if(r&&n!==true)return console.warn("dphelper.security.fingerprint: User consent required. Pass { consent: true } to enable."),console.warn("dphelper.security.fingerprint: Fingerprinting is subject to GDPR/CCPA. Ensure privacy policy and user consent."),"";let t=navigator,s=window.screen,i=document.createElement("canvas"),a=i.getContext("2d"),o="dphelper_fingerprint_v1",d="";a&&(i.width=200,i.height=30,a.textBaseline="top",a.font="14px 'Arial'",a.textBaseline="alphabetic",a.fillStyle="#f60",a.fillRect(125,1,62,20),a.fillStyle="#069",a.fillText(o,2,15),a.fillStyle="rgba(102, 204, 0, 0.7)",a.fillText(o,4,17),d=i.toDataURL());let u=[t.userAgent,t.language,s.colorDepth,s.width+"x"+s.height,new Date().getTimezoneOffset(),t.deviceMemory||"unknown",t.hardwareConcurrency||"unknown",d].join("|");return dphelper.security.SHA256_Hex(u)},saveEncrypted:async(e,r,n)=>{if(typeof document>"u"||typeof window>"u"){console.warn("[dphelper] localStorage not available in this environment");return}let t=await dphelper.security.crypt(r,n),s=await h(t,n);localStorage.setItem(e,JSON.stringify({d:t,h:s,v:"2.0"}));},getEncrypted:async(e,r)=>{let n=localStorage.getItem(e);if(!n)return null;try{let t=JSON.parse(n);if(t&&t.h&&t.d){let s=await h(t.d,r);return t.h!==s?(console.error(`[dphelper] Security Alert: Data tampering detected for key "${e}"`),null):dphelper.security.deCrypt(t.d,r)}return dphelper.security.deCrypt(n,r)}catch{try{return dphelper.security.deCrypt(n,r)}catch(s){return console.warn(`[dphelper] Persistence Error for key "${e}":`,s),null}}}},B=k;typeof dphelper?.setDescription=="function"&&dphelper.setDescription(x,B);var F=dphelper.security;exports.security=F;