dphelper 4.6.0 → 4.6.2

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 +637 -397
  5. package/SECURITY.md +26 -26
  6. package/SUMMARY.md +83 -83
  7. package/index.cjs +1 -1
  8. package/index.d.ts +1 -1
  9. package/index.js +1 -1
  10. package/llms.txt +515 -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 +1 -1
  141. package/modules/text.d.ts +13 -13
  142. package/modules/text.js +1 -1
  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 +10 -15
  169. package/types/dphelper.d.ts +546 -546
  170. package/types/global.d.ts +8 -8
package/SECURITY.md CHANGED
@@ -1,27 +1,27 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- | Version | Supported |
6
- | ------- | --------- |
7
- | 3.9.x | ✅ |
8
- | < 3.5 | ❌ |
9
-
10
- ## Security Standards
11
-
12
- - **NIST SP 800-53:** 98% compliance
13
- - **OWASP Top 10:** 100% compliance
14
- - **Socket.dev:** 90%+ target
15
-
16
- ## Reporting a Vulnerability
17
-
18
- Email: architecture@biglogic.ca
19
- Response: Within 24 hours
20
-
21
- ## Security Features
22
-
23
- - PBKDF2 310k iterations (OWASP 2023)
24
- - AES-GCM 256-bit encryption
25
- - TLS 1.2+ enforcement
26
- - WebSocket wss:// only
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ | Version | Supported |
6
+ | ------- | --------- |
7
+ | 3.9.x | ✅ |
8
+ | < 3.5 | ❌ |
9
+
10
+ ## Security Standards
11
+
12
+ - **NIST SP 800-53:** 98% compliance
13
+ - **OWASP Top 10:** 100% compliance
14
+ - **Socket.dev:** 90%+ target
15
+
16
+ ## Reporting a Vulnerability
17
+
18
+ Email: architecture@biglogic.ca
19
+ Response: Within 24 hours
20
+
21
+ ## Security Features
22
+
23
+ - PBKDF2 310k iterations (OWASP 2023)
24
+ - AES-GCM 256-bit encryption
25
+ - TLS 1.2+ enforcement
26
+ - WebSocket wss:// only
27
27
  - Input validation on all endpoints
package/SUMMARY.md CHANGED
@@ -1,83 +1,83 @@
1
- # Table of Contents
2
-
3
- - [dpHelper](../README.md)
4
-
5
- ---
6
-
7
- ## Core Tools
8
-
9
- - [ai](markdown/ai.md)
10
- - [array](markdown/array.md)
11
- - [browser](markdown/browser.md)
12
- - [check](markdown/check.md)
13
- - [date](markdown/date.md)
14
- - [form](markdown/form.md)
15
- - [json](markdown/json.md)
16
- - [load](markdown/load.md)
17
- - [navigation](markdown/navigation.md)
18
- - [security](markdown/security.md)
19
- - [socket](markdown/socket.md)
20
- - [svg](markdown/svg.md)
21
- - [markdown](markdown/markdown.md)
22
- - [window](markdown/window.md)
23
-
24
- ---
25
-
26
- ## UI & DOM
27
-
28
- - [anchor](markdown/anchor.md)
29
- - [audio](markdown/audio.md)
30
- - [color](markdown/color.md)
31
- - [coords](markdown/coords.md)
32
- - [disable](markdown/disable.md)
33
- - [dispatch](markdown/dispatch.md)
34
- - [element](markdown/element.md)
35
- - [event](markdown/event.md)
36
- - [scrollbar](markdown/scrollbar.md)
37
- - [screen](markdown/screen.md)
38
- - [trigger](markdown/trigger.md)
39
- - [type](markdown/type.md)
40
- - [types](markdown/types.md)
41
- - [ui](markdown/ui.md)
42
-
43
- ---
44
-
45
- ## Data & Text
46
-
47
- - [format](markdown/format.md)
48
- - [math](markdown/math.md)
49
- - [objects](markdown/objects.md)
50
- - [path](markdown/path.md)
51
- - [sanitize](markdown/sanitize.md)
52
- - [text](markdown/text.md)
53
- - [translators](markdown/translators.md)
54
-
55
- ---
56
-
57
- ## Network & Storage
58
-
59
- - [cookie](markdown/cookie.md)
60
- - [compress](markdown/compress.md)
61
- - [fetch](markdown/fetch.md)
62
- - [net](markdown/net.md)
63
- - [sse](markdown/sse.md)
64
- - [sync](markdown/sync.md)
65
-
66
- ---
67
-
68
- ## Advanced
69
-
70
- - [avoid](markdown/avoid.md)
71
- - [biometric](markdown/biometric.md)
72
- - [credits](markdown/credits.md)
73
- - [i18n](markdown/i18n.md)
74
- - [image](markdown/image.md)
75
- - [logging](markdown/logging.md)
76
- - [memory](markdown/memory.md)
77
- - [promise](markdown/promise.md)
78
- - [shortcut](markdown/shortcut.md)
79
- - [system](markdown/system.md)
80
- - [terminal](markdown/terminal.md)
81
- - [timer](markdown/timer.md)
82
- - [triggers](markdown/triggers.md)
83
- - [worker](markdown/worker.md)
1
+ # Table of Contents
2
+
3
+ - [dpHelper](../README.md)
4
+
5
+ ---
6
+
7
+ ## Core Tools
8
+
9
+ - [ai](markdown/ai.md)
10
+ - [array](markdown/array.md)
11
+ - [browser](markdown/browser.md)
12
+ - [check](markdown/check.md)
13
+ - [date](markdown/date.md)
14
+ - [form](markdown/form.md)
15
+ - [json](markdown/json.md)
16
+ - [load](markdown/load.md)
17
+ - [navigation](markdown/navigation.md)
18
+ - [security](markdown/security.md)
19
+ - [socket](markdown/socket.md)
20
+ - [svg](markdown/svg.md)
21
+ - [markdown](markdown/markdown.md)
22
+ - [window](markdown/window.md)
23
+
24
+ ---
25
+
26
+ ## UI & DOM
27
+
28
+ - [anchor](markdown/anchor.md)
29
+ - [audio](markdown/audio.md)
30
+ - [color](markdown/color.md)
31
+ - [coords](markdown/coords.md)
32
+ - [disable](markdown/disable.md)
33
+ - [dispatch](markdown/dispatch.md)
34
+ - [element](markdown/element.md)
35
+ - [event](markdown/event.md)
36
+ - [scrollbar](markdown/scrollbar.md)
37
+ - [screen](markdown/screen.md)
38
+ - [trigger](markdown/trigger.md)
39
+ - [type](markdown/type.md)
40
+ - [types](markdown/types.md)
41
+ - [ui](markdown/ui.md)
42
+
43
+ ---
44
+
45
+ ## Data & Text
46
+
47
+ - [format](markdown/format.md)
48
+ - [math](markdown/math.md)
49
+ - [objects](markdown/objects.md)
50
+ - [path](markdown/path.md)
51
+ - [sanitize](markdown/sanitize.md)
52
+ - [text](markdown/text.md)
53
+ - [translators](markdown/translators.md)
54
+
55
+ ---
56
+
57
+ ## Network & Storage
58
+
59
+ - [cookie](markdown/cookie.md)
60
+ - [compress](markdown/compress.md)
61
+ - [fetch](markdown/fetch.md)
62
+ - [net](markdown/net.md)
63
+ - [sse](markdown/sse.md)
64
+ - [sync](markdown/sync.md)
65
+
66
+ ---
67
+
68
+ ## Advanced
69
+
70
+ - [avoid](markdown/avoid.md)
71
+ - [biometric](markdown/biometric.md)
72
+ - [credits](markdown/credits.md)
73
+ - [i18n](markdown/i18n.md)
74
+ - [image](markdown/image.md)
75
+ - [logging](markdown/logging.md)
76
+ - [memory](markdown/memory.md)
77
+ - [promise](markdown/promise.md)
78
+ - [shortcut](markdown/shortcut.md)
79
+ - [system](markdown/system.md)
80
+ - [terminal](markdown/terminal.md)
81
+ - [timer](markdown/timer.md)
82
+ - [triggers](markdown/triggers.md)
83
+ - [worker](markdown/worker.md)
package/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var V={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var x={codeName:"dphelper",version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...V},configurable:true,writable:true},version:{value:x.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var P=dphelper;Object.defineProperty(P,"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(P,"setDescription",{value:(e,t)=>{Object.defineProperties(P,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(P[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),P.setProps(P,e,{writable:false,configurable:false,enumerable:false}),P._list.scripts.push(e);}});var ue={name:"ai",active:true,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:true,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},B=e=>e===null||typeof e!="object",H=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
1
+ 'use strict';var V={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var x={codeName:"dphelper",version:"4.6.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...V},configurable:true,writable:true},version:{value:x.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var P=dphelper;Object.defineProperty(P,"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(P,"setDescription",{value:(e,t)=>{Object.defineProperties(P,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(P[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),P.setProps(P,e,{writable:false,configurable:false,enumerable:false}),P._list.scripts.push(e);}});var ue={name:"ai",active:true,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:true,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},B=e=>e===null||typeof e!="object",H=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
2
2
  `)||e.trim()!==e?`"${e.replace(/"/g,'\\"')}"`:e||'""':String(e),N=(e,t=0)=>{let r=" ".repeat(t);if(B(e))return H(e);if(Array.isArray(e)){if(e.length===0)return "[0]:";let n=e[0];if(!B(n)&&!Array.isArray(n)){let o=Object.keys(n),a=`[${e.length}]{${o.join(",")}}:`;for(let i of e){let s=o.map(l=>H(i[l])).join(",");a+=`
3
3
  ${r} ${s}`;}return a}else return `[${e.length}]: `+e.map(H).join(",")}else return Object.entries(e).map(([n,o])=>{let a=n.includes(" ")||n.includes(":")?`"${n}"`:n;if(!B(o)){let i=N(o,t+1);return i.startsWith("[")?`${a}${i}`:`${a}:
4
4
  ${r}${i}`}return `${a}: ${H(o)}`}).join(`
package/index.d.ts CHANGED
@@ -1 +1 @@
1
- /// <reference path="./types/dphelper.d.ts" />
1
+ /// <reference path="./types/dphelper.d.ts" />
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var K={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var C={codeName:"dphelper",version:"4.6.0"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...K},configurable:true,writable:true},version:{value:C.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var k=dphelper;Object.defineProperty(k,"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(k,"setDescription",{value:(e,t)=>{Object.defineProperties(k,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(k[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),k.setProps(k,e,{writable:false,configurable:false,enumerable:false}),k._list.scripts.push(e);}});var pe={name:"ai",active:true,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:true,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},W=e=>e===null||typeof e!="object",U=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
1
+ var K={info:{title:"List",description:"Complete list of tools"},categories:["3party","system","financial","memory","numbers","time","path","file","forms","ui","other","development"]};var C={codeName:"dphelper",version:"4.6.2"};Object.defineProperty(globalThis,"dphelper",{value:new Proxy({},{}),writable:true,configurable:true,enumerable:false});Object.defineProperties(dphelper,{_list:{value:{scripts:[],sockets:[],...K},configurable:true,writable:true},version:{value:C.version,configurable:true,writable:true},isServer:{value:false,configurable:true,writable:true},isBrowser:{value:true,configurable:true,writable:true}});var k=dphelper;Object.defineProperty(k,"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(k,"setDescription",{value:(e,t)=>{Object.defineProperties(k,{[e.name]:{value:t,writable:false,configurable:false,enumerable:false}}),Object.keys(t).map(r=>(Object.defineProperties(k[e.name],{[r]:{writable:false,configurable:false,enumerable:false}}),null)),k.setProps(k,e,{writable:false,configurable:false,enumerable:false}),k._list.scripts.push(e);}});var pe={name:"ai",active:true,subCommand:[{name:"tokenCount",version:"0.0.3",example:"dphelper.ai.tokenCount({ users: [1,2,3] })",author:"Dario Passariello",creationDate:"20260220",lastMod:"20260221",type:"function",active:true,description:"Estimate token count for LLMs. If an object is passed, it uses TOON format for calculation.",env:"both",subCommand:[]},{name:"smartSanitize",version:"0.0.2",example:"dphelper.ai.smartSanitize('My email is test@example.com')",author:"Dario Passariello & Jo",creationDate:"20260220",lastMod:"20260220",type:"function",active:true,description:"Remove PII (emails, phones, etc) from text for AI privacy",subCommand:[]},{name:"toon",version:"0.0.1",example:"dphelper.ai.toon({ users: [{id: 1, name: 'Ada'}] })",author:"TOON + Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert JSON to TOON format (Token-Oriented Object Notation)",subCommand:[]},{name:"toonToJson",version:"0.0.1",example:"dphelper.ai.toonToJson('users[1]{id,name}:\\n 1,Ada')",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Convert TOON format back to JSON/Object",subCommand:[]},{name:"chunker",version:"0.0.1",example:"dphelper.ai.chunker(text, { size: 1000, overlap: 200 })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Split long text into chunks for RAG or AI processing.",subCommand:[]},{name:"similarity",version:"0.0.1",example:"dphelper.ai.similarity(vecA, vecB)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Calculate cosine similarity between two embedding vectors.",subCommand:[]},{name:"extractReasoning",version:"0.0.1",example:"dphelper.ai.extractReasoning(aiResponse)",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Extract <think> tags or internal reasoning from AI responses.",subCommand:[]},{name:"prompt",version:"0.0.1",example:"dphelper.ai.prompt('Hello {{name}}', { name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Simple prompt template engine with variable injection.",subCommand:[]},{name:"schema",version:"0.0.1",example:"dphelper.ai.schema({ id: 1, name: 'Ada' })",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Generate a TOON-style schema definition for AI instructions.",subCommand:[]},{name:"snapshot",version:"0.0.1",example:"dphelper.ai.snapshot()",author:"Dario Passariello",creationDate:"20260221",lastMod:"20260221",type:"function",active:true,description:"Capture a 'mental snapshot' of the app state (logs/globals) in TOON format for AI debugging.",env:"both",subCommand:[]}]},W=e=>e===null||typeof e!="object",U=e=>e===null?"null":typeof e=="string"?e.includes(",")||e.includes(":")||e.includes('"')||e.includes(`
2
2
  `)||e.trim()!==e?`"${e.replace(/"/g,'\\"')}"`:e||'""':String(e),$=(e,t=0)=>{let r=" ".repeat(t);if(W(e))return U(e);if(Array.isArray(e)){if(e.length===0)return "[0]:";let n=e[0];if(!W(n)&&!Array.isArray(n)){let o=Object.keys(n),a=`[${e.length}]{${o.join(",")}}:`;for(let i of e){let s=o.map(l=>U(i[l])).join(",");a+=`
3
3
  ${r} ${s}`;}return a}else return `[${e.length}]: `+e.map(U).join(",")}else return Object.entries(e).map(([n,o])=>{let a=n.includes(" ")||n.includes(":")?`"${n}"`:n;if(!W(o)){let i=$(o,t+1);return i.startsWith("[")?`${a}${i}`:`${a}:
4
4
  ${r}${i}`}return `${a}: ${U(o)}`}).join(`