@koine/utils 1.0.47 → 1.0.50
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/imgEmptyPixel.d.ts +7 -0
- package/imgEmptyPixel.js +7 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/node/imgEmptyPixel.js +10 -0
- package/node/index.js +2 -0
- package/node/removeUrlQueryParams.js +25 -0
- package/package.json +1 -1
- package/removeUrlQueryParams.d.ts +8 -0
- package/removeUrlQueryParams.js +21 -0
package/imgEmptyPixel.js
ADDED
package/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export * from "./getUrlHashParams";
|
|
|
57
57
|
export * from "./getUrlHashPathname";
|
|
58
58
|
export * from "./getUrlPathnameParts";
|
|
59
59
|
export * from "./getUrlQueryParams";
|
|
60
|
+
export * from "./imgEmptyPixel";
|
|
60
61
|
export * from "./isAnyObject";
|
|
61
62
|
export * from "./isArray";
|
|
62
63
|
export * from "./isBlob";
|
|
@@ -127,6 +128,7 @@ export * from "./removeDuplicatesByKey";
|
|
|
127
128
|
export * from "./removeDuplicatesComparing";
|
|
128
129
|
export * from "./removeIndexesFromArray";
|
|
129
130
|
export * from "./removeTrailingSlash";
|
|
131
|
+
export * from "./removeUrlQueryParams";
|
|
130
132
|
export * from "./roundTo";
|
|
131
133
|
export * from "./serializeCookie";
|
|
132
134
|
export * from "./setCookie";
|
package/index.js
CHANGED
|
@@ -58,6 +58,7 @@ export * from "./getUrlHashParams";
|
|
|
58
58
|
export * from "./getUrlHashPathname";
|
|
59
59
|
export * from "./getUrlPathnameParts";
|
|
60
60
|
export * from "./getUrlQueryParams";
|
|
61
|
+
export * from "./imgEmptyPixel";
|
|
61
62
|
export * from "./isAnyObject";
|
|
62
63
|
export * from "./isArray";
|
|
63
64
|
export * from "./isBlob";
|
|
@@ -128,6 +129,7 @@ export * from "./removeDuplicatesByKey";
|
|
|
128
129
|
export * from "./removeDuplicatesComparing";
|
|
129
130
|
export * from "./removeIndexesFromArray";
|
|
130
131
|
export * from "./removeTrailingSlash";
|
|
132
|
+
export * from "./removeUrlQueryParams";
|
|
131
133
|
export * from "./roundTo";
|
|
132
134
|
export * from "./serializeCookie";
|
|
133
135
|
export * from "./setCookie";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imgEmptyPixel = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Empty img pixel as a string to inline
|
|
6
|
+
*
|
|
7
|
+
* @category img
|
|
8
|
+
*/
|
|
9
|
+
exports.imgEmptyPixel = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
|
|
10
|
+
exports.default = exports.imgEmptyPixel;
|
package/node/index.js
CHANGED
|
@@ -61,6 +61,7 @@ tslib_1.__exportStar(require("./getUrlHashParams"), exports);
|
|
|
61
61
|
tslib_1.__exportStar(require("./getUrlHashPathname"), exports);
|
|
62
62
|
tslib_1.__exportStar(require("./getUrlPathnameParts"), exports);
|
|
63
63
|
tslib_1.__exportStar(require("./getUrlQueryParams"), exports);
|
|
64
|
+
tslib_1.__exportStar(require("./imgEmptyPixel"), exports);
|
|
64
65
|
tslib_1.__exportStar(require("./isAnyObject"), exports);
|
|
65
66
|
tslib_1.__exportStar(require("./isArray"), exports);
|
|
66
67
|
tslib_1.__exportStar(require("./isBlob"), exports);
|
|
@@ -131,6 +132,7 @@ tslib_1.__exportStar(require("./removeDuplicatesByKey"), exports);
|
|
|
131
132
|
tslib_1.__exportStar(require("./removeDuplicatesComparing"), exports);
|
|
132
133
|
tslib_1.__exportStar(require("./removeIndexesFromArray"), exports);
|
|
133
134
|
tslib_1.__exportStar(require("./removeTrailingSlash"), exports);
|
|
135
|
+
tslib_1.__exportStar(require("./removeUrlQueryParams"), exports);
|
|
134
136
|
tslib_1.__exportStar(require("./roundTo"), exports);
|
|
135
137
|
tslib_1.__exportStar(require("./serializeCookie"), exports);
|
|
136
138
|
tslib_1.__exportStar(require("./setCookie"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeUrlQueryParams = void 0;
|
|
4
|
+
var buildUrlQueryString_1 = require("./buildUrlQueryString");
|
|
5
|
+
var getUrlQueryParams_1 = require("./getUrlQueryParams");
|
|
6
|
+
/**
|
|
7
|
+
* Remove the given keys from the given URL query parameters
|
|
8
|
+
*
|
|
9
|
+
* @category location
|
|
10
|
+
* @pure
|
|
11
|
+
*/
|
|
12
|
+
function removeUrlQueryParams(url, paramsToRemove) {
|
|
13
|
+
if (paramsToRemove === void 0) { paramsToRemove = []; }
|
|
14
|
+
var parts = url.split("?");
|
|
15
|
+
var allParams = (0, getUrlQueryParams_1.default)(url);
|
|
16
|
+
var params = {};
|
|
17
|
+
for (var key in allParams) {
|
|
18
|
+
if (!paramsToRemove.includes(key)) {
|
|
19
|
+
params[key] = allParams[key];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return parts[0] + (0, buildUrlQueryString_1.default)(params);
|
|
23
|
+
}
|
|
24
|
+
exports.removeUrlQueryParams = removeUrlQueryParams;
|
|
25
|
+
exports.default = removeUrlQueryParams;
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import buildUrlQueryString from "./buildUrlQueryString";
|
|
2
|
+
import getUrlQueryParams from "./getUrlQueryParams";
|
|
3
|
+
/**
|
|
4
|
+
* Remove the given keys from the given URL query parameters
|
|
5
|
+
*
|
|
6
|
+
* @category location
|
|
7
|
+
* @pure
|
|
8
|
+
*/
|
|
9
|
+
export function removeUrlQueryParams(url, paramsToRemove) {
|
|
10
|
+
if (paramsToRemove === void 0) { paramsToRemove = []; }
|
|
11
|
+
var parts = url.split("?");
|
|
12
|
+
var allParams = getUrlQueryParams(url);
|
|
13
|
+
var params = {};
|
|
14
|
+
for (var key in allParams) {
|
|
15
|
+
if (!paramsToRemove.includes(key)) {
|
|
16
|
+
params[key] = allParams[key];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return parts[0] + buildUrlQueryString(params);
|
|
20
|
+
}
|
|
21
|
+
export default removeUrlQueryParams;
|