@nemigo/helpers 1.5.3 → 1.6.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.
@@ -14,9 +14,9 @@ export interface SetDocumentCookieOptions {
14
14
  /**
15
15
  * Максимальное время жизни куки в секундах
16
16
  *
17
- * @remarks `MaxAge === null` делает хранение сессионным!
17
+ * @remarks `MaxAge === undefined` делает хранение сессионным!
18
18
  */
19
- MaxAge?: number | null;
19
+ MaxAge?: number;
20
20
  /**
21
21
  * Флаг, указывающий, что кука будет передаваться только по защищенному соединению (HTTPS)
22
22
  */
@@ -34,7 +34,7 @@ export interface SetDocumentCookieOptions {
34
34
  * @param name - Имя куки
35
35
  * @param value - Значение куки
36
36
  * @param [options] - Опции куки
37
- * @param [options.MaxAge=21days] - {@link SetDocumentCookieOptions.MaxAge}
37
+ * @param [options.MaxAge] - {@link SetDocumentCookieOptions.MaxAge}
38
38
  * @param [options.SameSite="Lax"] - {@link SetDocumentCookieOptions.SameSite}
39
39
  * @param [options.Secure=true] - {@link SetDocumentCookieOptions.Secure}
40
40
  * @param [options.Path="/"] - {@link SetDocumentCookieOptions.Path}
@@ -1,16 +1,15 @@
1
- import { MS_IN_DAY } from "../datetime/delta.js";
2
1
  /**
3
2
  * @param name - Имя куки
4
3
  * @param value - Значение куки
5
4
  * @param [options] - Опции куки
6
- * @param [options.MaxAge=21days] - {@link SetDocumentCookieOptions.MaxAge}
5
+ * @param [options.MaxAge] - {@link SetDocumentCookieOptions.MaxAge}
7
6
  * @param [options.SameSite="Lax"] - {@link SetDocumentCookieOptions.SameSite}
8
7
  * @param [options.Secure=true] - {@link SetDocumentCookieOptions.Secure}
9
8
  * @param [options.Path="/"] - {@link SetDocumentCookieOptions.Path}
10
9
  * @param [options.Domain] - {@link SetDocumentCookieOptions.Domain}
11
10
  */
12
11
  export const setDocumentCookie = (name, value, options = {}) => {
13
- const { MaxAge = (21 * MS_IN_DAY) / 1000, SameSite = "Lax", Secure = true, Path = "/", Domain } = options;
12
+ const { MaxAge, SameSite = "Lax", Secure = true, Path = "/", Domain } = options;
14
13
  let acc = `${name}=${value}`;
15
14
  if (Domain)
16
15
  acc += `;Domain=${Domain}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nemigo/helpers",
3
- "version": "1.5.3",
3
+ "version": "1.6.0",
4
4
  "private": false,
5
5
  "author": {
6
6
  "name": "Vlad Logvin",