mybase 1.0.44 → 1.0.45

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 (3) hide show
  1. package/README.md +1 -0
  2. package/mybase.js +8 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -19,6 +19,7 @@ var { isLocal } = require('mybase')
19
19
  ### softexit(message=false,seconds=60,exitcode=-1)
20
20
  ### validHPassword(hpassword)
21
21
  ### randomHPassword(length=10)
22
+ ### isURL(string)
22
23
  ### validIp(ip)
23
24
  ### validTime(t)
24
25
  ### randomIP()
package/mybase.js CHANGED
@@ -97,6 +97,12 @@ function randomIP() {
97
97
  }
98
98
 
99
99
 
100
+ function isURL(url) {
101
+ if (typeof url === 'string') try { return new URL(url) } catch (e) { }
102
+ return false
103
+ }
104
+
105
+
100
106
  function validTime(t) {
101
107
  var valid = (t && parseInt(t)>0 && t.toString().length===10)
102
108
  if (!valid) return false
@@ -609,5 +615,6 @@ module.exports = {
609
615
  promiseTimeout,
610
616
  utcnow,
611
617
  Geoip2Paths,
612
- randomHPassword
618
+ randomHPassword,
619
+ isURL
613
620
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mybase",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "",
5
5
  "main": "mybase.js",
6
6
  "scripts": {