emacroh5lib 1.0.77 → 1.0.78

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": "emacroh5lib",
3
- "version": "1.0.77",
3
+ "version": "1.0.78",
4
4
  "description": "EMacro前端组件库",
5
5
  "main": "dist/emacroh5lib.min.js",
6
6
  "scripts": {
@@ -74,9 +74,9 @@ export namespace EMacro {
74
74
  let directoryName = "";
75
75
  if (files[i].webkitRelativePath != null && files[i].webkitRelativePath.trim() != "") {
76
76
  let n = files[i].webkitRelativePath.lastIndexOf("\\")
77
- if (n == -1)
77
+ if (n == -1)
78
78
  n = files[i].webkitRelativePath.lastIndexOf("/")
79
- if (n != -1)
79
+ if (n != -1)
80
80
  directoryName = files[i].webkitRelativePath.substring(0, n)
81
81
  }
82
82
 
@@ -256,6 +256,15 @@ export namespace EMacro {
256
256
  return fileName.substring(0, n) + extension;
257
257
  }
258
258
 
259
+ export const isURL = (strUrl) => {
260
+ const regular = /^\b(((https?|ftp):\/\/)?[-a-z0-9]+(\.[-a-z0-9]+)*\.(?:com|edu|gov|int|mil|net|org|biz|info|name|museum|asia|coop|aero|[a-z][a-z]|((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]\d)|\d))\b(\/[-a-z0-9_:\@&?=+,.!\/~%\$]*)?)$/i;
261
+ if (regular.test(strUrl.trim())) {
262
+ return true;
263
+ } else {
264
+ return false;
265
+ }
266
+ }
267
+
259
268
  }
260
269
 
261
270