@sap-cloud-sdk/util 4.6.1-20260521015306.0 → 4.7.0
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/dist/url.d.ts +7 -0
- package/dist/url.js +16 -0
- package/dist/url.js.map +1 -1
- package/package.json +2 -2
package/dist/url.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks whether a string is a valid URL.
|
|
3
|
+
* @param url - String to check.
|
|
4
|
+
* @returns True if the string is a valid URL, false otherwise.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function isValidUrl(url: string): boolean;
|
|
1
8
|
/**
|
|
2
9
|
* Checks whether a URL is existing via a head request.
|
|
3
10
|
* @param url - URL to be checked.
|
package/dist/url.js
CHANGED
|
@@ -3,8 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isValidUrl = isValidUrl;
|
|
6
7
|
exports.checkUrlExists = checkUrlExists;
|
|
7
8
|
const axios_1 = __importDefault(require("axios"));
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether a string is a valid URL.
|
|
11
|
+
* @param url - String to check.
|
|
12
|
+
* @returns True if the string is a valid URL, false otherwise.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
function isValidUrl(url) {
|
|
16
|
+
try {
|
|
17
|
+
new URL(url);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
8
24
|
/**
|
|
9
25
|
* Checks whether a URL is existing via a head request.
|
|
10
26
|
* @param url - URL to be checked.
|
package/dist/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../src/url.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../src/url.ts"],"names":[],"mappings":";;;;;AAQA,gCAOC;AAOD,wCAIC;AA1BD,kDAA0B;AAE1B;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,OAAO,eAAK;SACT,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;SAChC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-cloud-sdk/util",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "SAP Cloud SDK for JavaScript general utilities",
|
|
5
5
|
"homepage": "https://sap.github.io/cloud-sdk/docs/js/overview",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"nock": "^14.0.11",
|
|
41
41
|
"prettier": "^3.8.1",
|
|
42
42
|
"typescript": "~5.9.3",
|
|
43
|
-
"@sap-cloud-sdk/test-util-internal": "^4.
|
|
43
|
+
"@sap-cloud-sdk/test-util-internal": "^4.7.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"compile": "tsc -b",
|