@nocobase/utils 0.12.0-alpha.2 → 0.12.0-alpha.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/lib/client.d.ts +1 -0
- package/lib/client.js +12 -0
- package/lib/url.d.ts +1 -0
- package/lib/url.js +15 -0
- package/package.json +2 -2
package/lib/client.d.ts
CHANGED
package/lib/client.js
CHANGED
|
@@ -183,4 +183,16 @@ Object.keys(_uid).forEach(function (key) {
|
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
});
|
|
186
|
+
var _url = require("./url");
|
|
187
|
+
Object.keys(_url).forEach(function (key) {
|
|
188
|
+
if (key === "default" || key === "__esModule") return;
|
|
189
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
190
|
+
if (key in exports && exports[key] === _url[key]) return;
|
|
191
|
+
Object.defineProperty(exports, key, {
|
|
192
|
+
enumerable: true,
|
|
193
|
+
get: function get() {
|
|
194
|
+
return _url[key];
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
186
198
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/url.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isURL(string: any): boolean;
|
package/lib/url.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isURL = isURL;
|
|
7
|
+
function isURL(string) {
|
|
8
|
+
let url;
|
|
9
|
+
try {
|
|
10
|
+
url = new URL(string);
|
|
11
|
+
} catch (e) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/utils",
|
|
3
|
-
"version": "0.12.0-alpha.
|
|
3
|
+
"version": "0.12.0-alpha.4",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"multer": "^1.4.5-lts.1",
|
|
16
16
|
"object-path": "^0.11.8"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "215dc3b2437c501ca903b56cc378ab5e81c8a11c"
|
|
19
19
|
}
|