dphelper 0.2.55 → 0.2.60

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 (63) hide show
  1. package/index.js +2 -10
  2. package/index.js.LICENSE.txt +24 -0
  3. package/package.json +1 -1
  4. package/.editorconfig +0 -15
  5. package/.env +0 -3
  6. package/.eslintignore +0 -8
  7. package/.eslintrc.json +0 -36
  8. package/.gitattributes +0 -2
  9. package/.hintrc +0 -11
  10. package/.jsbeautifyrc +0 -25
  11. package/.jshintrc +0 -14
  12. package/.prettierignore +0 -2
  13. package/.prettierrc +0 -7
  14. package/.vscode/settings.json +0 -54
  15. package/3party/shortcut.js +0 -224
  16. package/backup.bat +0 -43
  17. package/data/list.json +0 -19
  18. package/dist/LICENSE +0 -201
  19. package/dist/README.md +0 -176
  20. package/index.d.ts +0 -14
  21. package/init.js +0 -48
  22. package/jest.config.js +0 -18
  23. package/public/assets/images/banner.png +0 -0
  24. package/public/assets/logos/logo.svg +0 -64
  25. package/scripts/anchorToOnClick.js +0 -47
  26. package/scripts/array.js +0 -142
  27. package/scripts/browser.js +0 -65
  28. package/scripts/console.js +0 -86
  29. package/scripts/coodinates.js +0 -41
  30. package/scripts/cookie.js +0 -97
  31. package/scripts/currency.js +0 -41
  32. package/scripts/date.js +0 -101
  33. package/scripts/disable.js +0 -90
  34. package/scripts/event.js +0 -39
  35. package/scripts/font.js +0 -52
  36. package/scripts/form.js +0 -113
  37. package/scripts/function.js +0 -47
  38. package/scripts/indexedDB.js +0 -222
  39. package/scripts/json.js +0 -42
  40. package/scripts/load.js +0 -85
  41. package/scripts/noCache.js +0 -26
  42. package/scripts/number.js +0 -66
  43. package/scripts/obj.js +0 -81
  44. package/scripts/onBeforeUnLoad.js +0 -120
  45. package/scripts/parseBool.js +0 -27
  46. package/scripts/path.js +0 -94
  47. package/scripts/promise.js +0 -35
  48. package/scripts/purge.js +0 -53
  49. package/scripts/screen.js +0 -64
  50. package/scripts/scrollbar.js +0 -245
  51. package/scripts/shortcut.js +0 -70
  52. package/scripts/storage.js +0 -62
  53. package/scripts/svg.js +0 -372
  54. package/scripts/text.js +0 -78
  55. package/scripts/time.js +0 -41
  56. package/scripts/timer.js +0 -35
  57. package/scripts/trigger.js +0 -46
  58. package/scripts/type.js +0 -56
  59. package/scripts/uuid.js +0 -33
  60. package/scripts/window.js +0 -50
  61. package/tests/ld-json-funtions.test.ts +0 -21
  62. package/tests/ld-json.test.ts +0 -46
  63. package/webpack.config.js +0 -240
@@ -1,224 +0,0 @@
1
- /**
2
- * http://www.openjs.com/scripts/events/keyboard_shortcuts/
3
- * Version : 2.01.B
4
- * By Binny V A
5
- * License : BSD
6
- */
7
-
8
- shortcut = {
9
- 'all_shortcuts':{},//All the shortcuts are stored in this array
10
- 'add': function(shortcut_combination,callback,opt) {
11
- //Provide a set of default options
12
- let default_options = {
13
- 'type':'keydown',
14
- 'propagate':false,
15
- 'disable_in_input':false,
16
- 'target':document,
17
- 'keycode':false
18
- }
19
- if(!opt) opt = default_options;
20
- else {
21
- for(let dfo in default_options) {
22
- if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo];
23
- }
24
- }
25
-
26
- let ele = opt.target;
27
- if(typeof opt.target == 'string') ele = document.getElementById(opt.target);
28
- let ths = this;
29
- shortcut_combination = shortcut_combination.toLowerCase();
30
-
31
- //The function to be called at keypress
32
- let func = function( e ) {
33
- e = e || window.event;
34
-
35
- if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields
36
- let element;
37
- if(e.target) element=e.target;
38
- else if(e.srcElement) element=e.srcElement;
39
- if(element.nodeType==3) element=element.parentNode;
40
-
41
- if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
42
- }
43
-
44
- //Find Which key is pressed
45
- if (e.keyCode) code = e.keyCode;
46
- else if (e.which) code = e.which;
47
- let character = String.fromCharCode(code).toLowerCase();
48
-
49
- if(code == 188) character=","; //If the user presses , when the type is onkeydown
50
- if(code == 190) character="."; //If the user presses , when the type is onkeydown
51
-
52
- let keys = shortcut_combination.split("+");
53
- //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked
54
- let kp = 0;
55
-
56
- //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken
57
- let shift_nums = {
58
- "`":"~",
59
- "1":"!",
60
- "2":"@",
61
- "3":"#",
62
- "4":"$",
63
- "5":"%",
64
- "6":"^",
65
- "7":"&",
66
- "8":"*",
67
- "9":"(",
68
- "0":")",
69
- "-":"_",
70
- "=":"+",
71
- ";":":",
72
- "'":"\"",
73
- ",":"<",
74
- ".":">",
75
- "/":"?",
76
- "\\":"|"
77
- }
78
- //Special Keys - and their codes
79
- let special_keys = {
80
- 'esc':27,
81
- 'escape':27,
82
- 'tab':9,
83
- 'space':32,
84
- 'return':13,
85
- 'enter':13,
86
- 'backspace':8,
87
-
88
- 'scrolllock':145,
89
- 'scroll_lock':145,
90
- 'scroll':145,
91
- 'capslock':20,
92
- 'caps_lock':20,
93
- 'caps':20,
94
- 'numlock':144,
95
- 'num_lock':144,
96
- 'num':144,
97
-
98
- 'pause':19,
99
- 'break':19,
100
-
101
- 'insert':45,
102
- 'home':36,
103
- 'delete':46,
104
- 'end':35,
105
-
106
- 'pageup':33,
107
- 'page_up':33,
108
- 'pu':33,
109
-
110
- 'pagedown':34,
111
- 'page_down':34,
112
- 'pd':34,
113
-
114
- 'left':37,
115
- 'up':38,
116
- 'right':39,
117
- 'down':40,
118
-
119
- 'f1':112,
120
- 'f2':113,
121
- 'f3':114,
122
- 'f4':115,
123
- 'f5':116,
124
- 'f6':117,
125
- 'f7':118,
126
- 'f8':119,
127
- 'f9':120,
128
- 'f10':121,
129
- 'f11':122,
130
- 'f12':123
131
- }
132
-
133
- let modifiers = {
134
- shift: { wanted:false, pressed:false},
135
- ctrl : { wanted:false, pressed:false},
136
- alt : { wanted:false, pressed:false},
137
- meta : { wanted:false, pressed:false} //Meta is Mac specific
138
- };
139
-
140
- if(e.ctrlKey) modifiers.ctrl.pressed = true;
141
- if(e.shiftKey) modifiers.shift.pressed = true;
142
- if(e.altKey) modifiers.alt.pressed = true;
143
- if(e.metaKey) modifiers.meta.pressed = true;
144
-
145
- for(let i=0; k=keys[i],i<keys.length; i++) {
146
- //Modifiers
147
- if(k == 'ctrl' || k == 'control') {
148
- kp++;
149
- modifiers.ctrl.wanted = true;
150
-
151
- } else if(k == 'shift') {
152
- kp++;
153
- modifiers.shift.wanted = true;
154
-
155
- } else if(k == 'alt') {
156
- kp++;
157
- modifiers.alt.wanted = true;
158
- } else if(k == 'meta') {
159
- kp++;
160
- modifiers.meta.wanted = true;
161
- } else if(k.length > 1) { //If it is a special key
162
- if(special_keys[k] == code) kp++;
163
-
164
- } else if(opt['keycode']) {
165
- if(opt['keycode'] == code) kp++;
166
-
167
- } else { //The special keys did not match
168
- if(character == k) kp++;
169
- else {
170
- if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase
171
- character = shift_nums[character];
172
- if(character == k) kp++;
173
- }
174
- }
175
- }
176
- }
177
-
178
- if(kp == keys.length &&
179
- modifiers.ctrl.pressed == modifiers.ctrl.wanted &&
180
- modifiers.shift.pressed == modifiers.shift.wanted &&
181
- modifiers.alt.pressed == modifiers.alt.wanted &&
182
- modifiers.meta.pressed == modifiers.meta.wanted) {
183
- callback( e );
184
-
185
- if(!opt['propagate']) { //Stop the event
186
- //e.cancelBubble is supported by IE - this will kill the bubbling process.
187
- e.cancelBubble = true;
188
- e.returnValue = false;
189
-
190
- //e.stopPropagation works in Firefox.
191
- if (e.stopPropagation) {
192
- e.stopPropagation();
193
- e.preventDefault();
194
- }
195
- return false;
196
- }
197
- }
198
- }
199
- this.all_shortcuts[shortcut_combination] = {
200
- 'callback':func,
201
- 'target':ele,
202
- 'event': opt['type']
203
- };
204
- //Attach the function with the event
205
- if(ele.addEventListener) ele.addEventListener(opt['type'], func, false);
206
- else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func);
207
- else ele['on'+opt['type']] = func;
208
- },
209
-
210
- //Remove the shortcut - just specify the shortcut and I will remove the binding
211
- 'remove':function(shortcut_combination) {
212
- shortcut_combination = shortcut_combination.toLowerCase();
213
- let binding = this.all_shortcuts[shortcut_combination];
214
- delete(this.all_shortcuts[shortcut_combination])
215
- if(!binding) return;
216
- let type = binding['event'];
217
- let ele = binding['target'];
218
- let callback = binding['callback'];
219
-
220
- if(ele.detachEvent) ele.detachEvent('on'+type, callback);
221
- else if(ele.removeEventListener) ele.removeEventListener(type, callback, false);
222
- else ele['on'+type] = false;
223
- }
224
- }
package/backup.bat DELETED
@@ -1,43 +0,0 @@
1
- @echo off
2
-
3
- @REM echo THIS FILE RUN BACKUP.
4
- @REM echo CREATED BY DARIO PASSARIELLO.
5
- @REM echo[
6
-
7
- @REM goto :start
8
-
9
- @REM This file permit to run BackUp as Zip file (using 7z) for the APP.
10
- @REM Please don't change anything without authorization.
11
- @REM In case needs help please call the back-end department.
12
- @REM You need to install 7z free software before using this batch
13
-
14
- @REM :start
15
-
16
- @REM :choice
17
- @REM set /P c=Are you sure you want to continue( [Y]/N )? Y
18
- @REM if /I "%c%" EQU "" goto :yes
19
- @REM if /I "%c%" EQU "y" goto :yes
20
- @REM if /I "%c%" EQU "Y" goto :yes
21
- @REM if /I "%c%" EQU "N" goto :no
22
- @REM goto :choice
23
-
24
- @REM :yes
25
-
26
- pushd %~dp0
27
- set THIS_DIR=%CD%
28
- popd
29
-
30
- for /f "tokens=3,2,4 delims=/- " %%x in ("%date%") do set d=%%z%%x%%y
31
- for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I
32
- set logtime=%datetime:~8,6%
33
- for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined tmpDate set tmpDate=%%x
34
- set data=%tmpDate:~0,4%%tmpDate:~4,2%%tmpDate:~6,2%
35
-
36
- "C:\Program Files\7-Zip\7z.exe" a -tzip %THIS_DIR%\.backup\%data%.%logtime%.zip %THIS_DIR% -xr!node_modules -xr!.backup -xr!.git
37
- attrib +h %THIS_DIR%\.backup
38
- echo Zip created into %THIS_DIR%\.backup!
39
- @REM pause
40
- exit
41
-
42
- :no
43
- exit
package/data/list.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "info" : {
3
- "title" : "List",
4
- "description" : "Complete list of tools"
5
- },
6
- "categories" : [
7
- "3dparty",
8
- "system",
9
- "financial",
10
- "memory",
11
- "numbers",
12
- "time",
13
- "path",
14
- "file",
15
- "forms",
16
- "ui",
17
- "other"
18
- ]
19
- }
package/dist/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
package/dist/README.md DELETED
@@ -1,176 +0,0 @@
1
- # dpHelper
2
-
3
- ![dpHelper](/assets/logos/logo.svg )
4
-
5
- Manager | DevTools by [Dario Passariello (c)](https://dario.passariello.ca)
6
-
7
- ![git repository](https://img.shields.io/badge/git%20repository-updated-green.svg)
8
- ![browser extension](https://img.shields.io/badge/browser%20extension-beta-orange.svg)
9
-
10
- ## about
11
-
12
- You have a lot of tools for you that make your life easier and faster!
13
- Please visit the github repository @ [dpHelper on Github](https://github.com/passariello/dpHelper)
14
-
15
- ## install
16
-
17
- ```js
18
- npm i dphelper
19
-
20
- or update:
21
-
22
- npm i dphelper@latest
23
-
24
- ```
25
-
26
- in the index (and only there):
27
-
28
- ```js
29
- import "dphelper"
30
-
31
- or
32
-
33
- require("dphelper")
34
- ```
35
-
36
- ## check
37
-
38
- type 'dphelper' in your console to have a look about all available tools that you can use globaly!
39
-
40
- You can call these from everywhere without import (just one at index)
41
-
42
- ## DOWNLOAD THE BROWSER EXTENSION (SOON)
43
-
44
- ![dpHelper Banner](/assets/images/banner.png)
45
-
46
- This extension allows you to manage your app's dpHelper NPM. Here you will find all the tools with description and methods of use. Designed to simplify API operations, data manipulation and retention. You will be able to monitor memory usage and localStorage. You will always be updated on updates and tricks for your daily work. The dpHelper tool is a collection of scripts to simplify, improve and speed up your work. Designed to be easy to install and use. Just use "import 'dphelper'" in your project index. All scripts work in global and are reachable everywhere.
47
-
48
- Actually in development...
49
-
50
- ## LIST
51
-
52
- ### CURRENCY
53
-
54
- ```js
55
- dphelper.currency( val, int = 'en-US', cur = 'USD' )
56
- ```
57
-
58
- ### MEMORY / STORAGE
59
-
60
- ```js
61
- dphelper.storage.get( name )
62
- dphelper.storage.set( name , value )
63
- dphelper.storage.delete( name )
64
- dphelper.storage.clearAll()
65
- ```
66
-
67
- ### MEMORY / COOKIE
68
-
69
- ```js
70
- dphelper.cookie.set( name , value , time , path = '/' )
71
- dphelper.cookie.get( name )
72
- dphelper.cookie.delete( name )
73
- dphelper.cookie.clearAll()
74
- ```
75
-
76
- ### MEMORY / INDEXED-DB
77
-
78
- ```js
79
- dphelper.indexedDB.create( storeName, table, name )
80
- dphelper.indexedDB.open( storeName )
81
- dphelper.indexedDB.store( storeName, table )
82
- dphelper.indexedDB.insert( storeName, table, key, value )
83
- dphelper.indexedDB.update( storeName, table, key, value )
84
- dphelper.indexedDB.get( storeName, table, key )
85
- dphelper.indexedDB.list()
86
- ```
87
-
88
- ### NUMBERS
89
-
90
- ```js
91
- dphelper.number.rnd() // generate long random number
92
- dphelper.number.tmr() // generate number by timer
93
- dphelper.number.add()
94
- dphelper.number.sub()
95
- dphelper.number.multi()
96
- dphelper.number.div()
97
- dphelper.number.rem()
98
- dphelper.number.exp()
99
- ```
100
-
101
- ### TIME
102
-
103
- ```js
104
- dphelper.time.epoch() // return epoch time
105
- ```
106
-
107
- ### DATE
108
-
109
- ```js
110
- dphelper.date.toIso( value , int = 'en' ) // format in bese of internationalization
111
- dphelper.date.toMMDDYYYY( value ) // format not common
112
- dphelper.date.convert( value , format ) // format like 23 Dec, 2021
113
- dphelper.date.iso2Epoch( value ) // format iso date to epoch
114
- dphelper.date.localIsoTime( value ) // format Thu, 31 May 2012 08:33:41 +0000
115
- dphelper.date.utc() // generate UTC date format
116
- dphelper.date.parse( value ) // epoch to human date
117
- ```
118
-
119
- ### PATH
120
-
121
- ------ url
122
-
123
- ```js
124
- dphelper.path.rail() // Generate array start from subFolders
125
- dphelper.path.query() // Generate array start from querystring
126
- dphelper.path.hash() // Generate array start from hash path
127
- ```
128
-
129
- ------ Browser:
130
-
131
- ```js
132
- dphelper.browser.state( state, title, url ) // Create a new spushState and avoid page reload
133
- dphelper.browser.forw( times ) // go next visited page
134
- dphelper.browser.back( times ) // go previous page (type 1 or more - times is ever negative)
135
- dphelper.browser.href( url ) // go previous page (type 1 or more - times is ever negative)
136
- dphelper.browser.reload() // reload page and discard POST data
137
- ```
138
-
139
- ------ options
140
-
141
- ```js
142
- dphelper.anchorToOnClick( element ) // Transform all a href to onclick (use . for class or # for div )
143
- ```
144
-
145
- ### LOAD
146
-
147
- ```js
148
- dphelper.load.file(element, path) // text to element
149
- dphelper.load.json( file ) // load json data to a variable
150
- dphelper.load.jsonRemote( path, method='GET', type='application/json' ) // load json from remote to variable
151
- ```
152
-
153
- ### FORM
154
-
155
- ```js
156
- dphelper.form.serialize( form ) // serialize a form (input array) to json
157
- ```
158
-
159
- ### ARRAY
160
-
161
- ```js
162
- dphelper.array.find( id, array ) // find value by ID into array
163
- dphelper.array.delete( id, array ) // delete value by ID from array
164
- dphelper.array.merge( arrayA , arrayB ) // merge two array
165
- dphelper.array.unique( array ) // remove all duplicates
166
- ```
167
-
168
- ### OBJECT
169
-
170
- ```js
171
- dphelper.obj.toArray( obj ) // convert objet to array (compatible with old browsers)
172
- dphelper.obj.serialize( value ) // serialize
173
- dphelper.obj.deSerialize( value ) // de-serialize
174
- ```
175
-
176
- ... TO BE CONTINUE
package/index.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: CC BY-NC-ND 4.0
4
- */
5
-
6
- declare module 'dphelper';
7
-
8
- declare global {
9
- interface Window {
10
- dphelper:any;
11
- }
12
- }
13
-
14
- let dphelper = window.dphelper;