dphelper 0.2.34 → 0.2.35

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dphelper",
3
- "version": "0.2.34",
3
+ "version": "0.2.35",
4
4
  "description": "Developer Tools",
5
5
  "main": "index.js",
6
6
  "publishConfig": {},
@@ -0,0 +1,47 @@
1
+ /*!
2
+ * dpHelper <https://github.com/passariello/dpHelper>
3
+ * Copyright (c) 2021, Dario Passariello.
4
+ * Licensed under the Apache-2.0 License.
5
+ */
6
+
7
+ /***********************************************************************/
8
+
9
+ var description = {
10
+ "name" : "Functions",
11
+ "description" : "test",
12
+ "version" : "0.0.1",
13
+ "command" : "func",
14
+ "subCommand" : [
15
+ {
16
+ "name":"new",
17
+ "description":"test"
18
+ },{
19
+ "name":"toObj.set",
20
+ "description":"test"
21
+ }
22
+ ],
23
+ "example" : "",
24
+ "author" : "Dario Passariello",
25
+ "active" : true
26
+ };
27
+
28
+ window.dphelper._list.scripts.push( description );
29
+
30
+ /***********************************************************************/
31
+
32
+ window.dphelper.func = {
33
+
34
+ new: ( name , text ) => {
35
+ args = [ name , "return" + text ];
36
+ myFunc = Function.apply( null, args );
37
+ },
38
+
39
+ toObj: {
40
+ set: ( value , key ) => {
41
+ return [value , key];
42
+ }
43
+ // var dog = new dphelper.func.oop( "Dog", "Bobby" );
44
+ // console.log( dog.getDetails());
45
+ },
46
+
47
+ };
package/scripts/number.js CHANGED
@@ -37,6 +37,30 @@
37
37
 
38
38
  tmr: () => {
39
39
  return Math.round( dphelper.time.epoch() / 1000 );
40
- }
40
+ },
41
+
42
+ add: ( a , b ) => {
43
+ return a + b;
44
+ },
45
+
46
+ sub: ( a , b ) => {
47
+ return a - b;
48
+ },
49
+
50
+ multiply: ( a , b ) => {
51
+ return a * b;
52
+ },
53
+
54
+ division: ( a , b ) => {
55
+ return a - b;
56
+ },
57
+
58
+ rem: ( a , b ) => {
59
+ return a % b;
60
+ },
61
+
62
+ exp: ( a , b ) => {
63
+ return a ** b;
64
+ },
41
65
 
42
66
  };
@@ -32,6 +32,15 @@
32
32
  let selector = document.querySelector( elem );
33
33
  if( selector ) selector.click();
34
34
  return;
35
+ },
36
+
37
+ change: ( elem ) => {
38
+ let selector = document.querySelector( elem );
39
+ var ev = new Event('input', { bubbles: true} );
40
+ ev.simulated = true;
41
+ //selector.value = 'Something new';
42
+ selector.dispatchEvent(ev);
35
43
  }
36
44
 
37
45
  };
46
+
@@ -0,0 +1,56 @@
1
+ /*!
2
+ * dpHelper <https://github.com/passariello/dpHelper>
3
+ * Copyright (c) 2021, Dario Passariello.
4
+ * Licensed under the Apache-2.0 License.
5
+ */
6
+
7
+ /***********************************************************************/
8
+
9
+ var description = {
10
+ "name" : "Type",
11
+ "description" : "test",
12
+ "version" : "0.0.1",
13
+ "command" : "type",
14
+ "subCommand" : [
15
+ {
16
+ name:"typeOf",
17
+ description:"test"
18
+ },{
19
+ name:"instOfObj",
20
+ description:"test"
21
+ }
22
+ ],
23
+ "example" : "",
24
+ "author" : "Dario Passariello",
25
+ "active" : true
26
+ };
27
+
28
+ window.dphelper._list.scripts.push( description );
29
+
30
+ /***********************************************************************/
31
+
32
+ window.dphelper.type = {
33
+
34
+ typeOf: (p) => { return typeof p; },
35
+
36
+ instOfObj: (p) => { return p instanceof Object; },
37
+
38
+ isNaN: (p) => { return function (i) { return !p(i); }; },
39
+
40
+ isPrime: (number) => {
41
+ var divisor = parseInt(number / 2, 10);
42
+ var prime = true;
43
+ while (divisor > 1) {
44
+ if (number % divisor === 0) {
45
+ prime = false;
46
+ divisor = 0;
47
+ } else {
48
+ divisor -= 1;
49
+ }
50
+ }
51
+ return prime === true;
52
+ },
53
+
54
+
55
+
56
+ };