@whitesev/utils 2.6.1 → 2.6.3
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/LICENSE +674 -0
- package/dist/index.amd.js +10 -4
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +10 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +10 -4
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +10 -4
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +10 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/UtilsGMCookie.d.ts +3 -4
- package/dist/types/src/types/UtilsGMCookie.d.ts +2 -2
- package/package.json +52 -52
- package/src/Utils.ts +1 -1
- package/src/UtilsGMCookie.ts +13 -9
- package/src/types/UtilsGMCookie.d.ts +2 -2
package/dist/index.iife.js
CHANGED
|
@@ -381,7 +381,7 @@ var Utils = (function () {
|
|
|
381
381
|
url: this.windowApi.window.location.href,
|
|
382
382
|
name: "",
|
|
383
383
|
value: "",
|
|
384
|
-
domain:
|
|
384
|
+
domain: "",
|
|
385
385
|
path: "/",
|
|
386
386
|
secure: true,
|
|
387
387
|
httpOnly: false,
|
|
@@ -400,6 +400,9 @@ var Utils = (function () {
|
|
|
400
400
|
";expires=" +
|
|
401
401
|
new Date(life).toGMTString() +
|
|
402
402
|
"; path=/";
|
|
403
|
+
if (utils.isNotNull(defaultOption.domain)) {
|
|
404
|
+
cookieStr += "; domain=" + defaultOption.domain;
|
|
405
|
+
}
|
|
403
406
|
this.windowApi.document.cookie = cookieStr;
|
|
404
407
|
}
|
|
405
408
|
catch (error) {
|
|
@@ -423,10 +426,13 @@ var Utils = (function () {
|
|
|
423
426
|
url: this.windowApi.window.location.href,
|
|
424
427
|
name: "",
|
|
425
428
|
path: "/",
|
|
426
|
-
firstPartyDomain:
|
|
429
|
+
firstPartyDomain: "",
|
|
427
430
|
};
|
|
428
431
|
defaultOption = utils.assign(defaultOption, option);
|
|
429
|
-
let cookieStr = `${defaultOption.name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${defaultOption.path}
|
|
432
|
+
let cookieStr = `${defaultOption.name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${defaultOption.path}`;
|
|
433
|
+
if (utils.isNotNull(defaultOption.firstPartyDomain)) {
|
|
434
|
+
cookieStr += `; domain=${defaultOption.firstPartyDomain};`;
|
|
435
|
+
}
|
|
430
436
|
this.windowApi.document.cookie = cookieStr;
|
|
431
437
|
}
|
|
432
438
|
catch (error) {
|
|
@@ -5038,7 +5044,7 @@ var Utils = (function () {
|
|
|
5038
5044
|
this.windowApi = new WindowApi(option);
|
|
5039
5045
|
}
|
|
5040
5046
|
/** 版本号 */
|
|
5041
|
-
version = "2025.
|
|
5047
|
+
version = "2025.3.25";
|
|
5042
5048
|
addStyle(cssText) {
|
|
5043
5049
|
if (typeof cssText !== "string") {
|
|
5044
5050
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|