dphelper 0.0.3 → 0.0.4

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.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Many utils for your projects",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/scripts/cookie.js CHANGED
@@ -1,5 +1,7 @@
1
1
  /*!
2
- * stPRO <https://github.com/passariello/stPRO>
2
+ * dpHelper <https://github.com/passariello/dpHelper>
3
+ *
4
+ * cookie
3
5
  *
4
6
  * Copyright (c) 2021, Dario Passariello.
5
7
  * Licensed under the Apache-2.0 License.
@@ -7,15 +9,15 @@
7
9
 
8
10
  /***********************************************************************/
9
11
 
10
- var CookieType = "Lax";
11
- var CookieSecure = "false";
12
- var CookieSameSite = "false";
12
+ var CookieType = "Lax";
13
+ var CookieSecure = "false";
14
+ var CookieSameSite = "false";
13
15
 
14
- if (location.protocol === 'https:') {
15
- CookieSecure = "Secure";
16
- }
16
+ if (location.protocol === 'https:') {
17
+ CookieSecure = "Secure";
18
+ }
17
19
 
18
- stpro.func.cookie = {
20
+ dphelper.cookie = {
19
21
 
20
22
  // CREATE THE COOKIE
21
23
 
@@ -66,4 +68,4 @@ if (location.protocol === 'https:') {
66
68
  };
67
69
 
68
70
  // START COOKIE DB
69
- stpro.func.cookie.set( "stPRO", 'active' );
71
+ dphelper.cookie.set( "dpHelper", 'active' );
@@ -1,5 +1,7 @@
1
1
  /*!
2
- * stPRO <https://github.com/passariello/stPRO>
2
+ * dpHelper <https://github.com/passariello/dpHelper>
3
+ *
4
+ * indexedDB
3
5
  *
4
6
  * Copyright (c) 2021, Dario Passariello.
5
7
  * Licensed under the Apache-2.0 License.
@@ -7,17 +9,16 @@
7
9
 
8
10
  /***********************************************************************/
9
11
 
10
- stpro.func.indexedDB = {};
11
- const indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
12
-
13
- if (!indexedDB) {
14
- console.debug(e, "stPRO : Your browser doesn't support a skey version of IndexedDB. Such and such feature will not be available.");
15
- console.debug( 'stPRO : Something went badly wrong with your indexedDB!' );
16
- }
17
-
18
- stpro.func.indexedDB = {
12
+ dphelper.indexedDB = {
19
13
 
20
14
  open: ( storeName ) => {
15
+
16
+ const indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
17
+
18
+ if (!indexedDB) {
19
+ console.debug(e, "stPRO : Your browser doesn't support a skey version of IndexedDB. Such and such feature will not be available.");
20
+ console.debug( 'stPRO : Something went badly wrong with your indexedDB!' );
21
+ }
21
22
 
22
23
  var request = window.indexedDB.open( storeName , 4 );
23
24
 
@@ -31,6 +32,7 @@ if (!indexedDB) {
31
32
  return;
32
33
  };
33
34
  return request;
35
+
34
36
  },
35
37
 
36
38
  /************************************************************************/
@@ -163,14 +165,16 @@ if (!indexedDB) {
163
165
  // CHECK IF INDEXEDDB EXIST
164
166
  // ***************************************************************************************************/
165
167
 
166
- stpro.dbExist = () => {
168
+ dphelper.dbExist = () => {
167
169
  var result = indexedDB.databases();
168
170
  return result.length;
169
171
  };
170
172
 
171
- // START DEFAULT DB
172
- stpro.func.indexedDB.open( "stPRO" );
173
- stpro.func.indexedDB.store( "stPRO" );
174
- stpro.func.indexedDB.insert( "stPRO" , 'active' , 'test[0]' , [] );
173
+ // START DEFAULT DB
174
+ dphelper.indexedDB.open( "dpHelper" );
175
+ /*
176
+ dphelper.indexedDB.store( "dpHelper" );
177
+ dphelper.indexedDB.insert( "dpHelper" , 'active' , 'test[0]' , [] );
178
+ */
175
179
 
176
180
 
@@ -1,5 +1,7 @@
1
1
  /*!
2
- * stPRO <https://github.com/passariello/stPRO>
2
+ * dpHelper <https://github.com/passariello/dpHelper>
3
+ *
4
+ * storage
3
5
  *
4
6
  * Copyright (c) 2021, Dario Passariello.
5
7
  * Licensed under the Apache-2.0 License.
@@ -7,22 +9,22 @@
7
9
 
8
10
  /***********************************************************************/
9
11
 
10
- stpro.func.storage = {
12
+ dphelper.storage = {
11
13
 
12
- get: function( name ) {
13
- return localStorage.getItem( name );
14
- },
15
- set: function( name, value ) {
16
- localStorage.setItem( name, value );
17
- },
18
- delete: function( name ) {
19
- localStorage.removeItem( name );
20
- },
21
- clearAll: function() {
22
- localStorage.clear();
23
- }
14
+ get: function( name ) {
15
+ return localStorage.getItem( name );
16
+ },
17
+ set: function( name, value ) {
18
+ localStorage.setItem( name, value );
19
+ },
20
+ delete: function( name ) {
21
+ localStorage.removeItem( name );
22
+ },
23
+ clearAll: function() {
24
+ localStorage.clear();
25
+ }
24
26
 
25
- };
27
+ };
26
28
 
27
- // START STORAGE DB
28
- stpro.func.storage.set( "stPRO", 'active' );
29
+ // START STORAGE DB
30
+ dphelper.storage.set( "dpHelper", 'active' );