@koine/utils 1.0.36 → 1.0.37
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/Emitter.d.ts +2 -2
- package/createStorage.d.ts +1 -1
- package/getNonce.d.ts +1 -1
- package/index.d.ts +9 -2
- package/index.js +9 -2
- package/isNullOrUndefined.d.ts +1 -1
- package/node/index.js +9 -2
- package/node/setCookie.js +1 -1
- package/package.json +1 -1
- package/pageview.d.ts +1 -1
- package/parseURL.d.ts +1 -1
- package/setCookie.js +1 -1
package/Emitter.d.ts
CHANGED
|
@@ -16,10 +16,10 @@ export declare function Emitter<EventMap extends {
|
|
|
16
16
|
/**
|
|
17
17
|
* Register an event handler for the given type.
|
|
18
18
|
*/
|
|
19
|
-
on<EventName extends keyof EventMap>(name: EventName, handler: (data?: EventMap[EventName]
|
|
19
|
+
on<EventName extends keyof EventMap>(name: EventName, handler: (data?: EventMap[EventName]) => any): void;
|
|
20
20
|
/**
|
|
21
21
|
* Invoke all handlers for the given type.
|
|
22
22
|
*/
|
|
23
|
-
emit<EventName_1 extends keyof EventMap>(name: EventName_1, data?: EventMap[EventName_1]
|
|
23
|
+
emit<EventName_1 extends keyof EventMap>(name: EventName_1, data?: EventMap[EventName_1]): void;
|
|
24
24
|
};
|
|
25
25
|
export default Emitter;
|
package/createStorage.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare type CreateStorageConfig = Record<string, any>;
|
|
2
2
|
export declare const createStorage: <T extends CreateStorageConfig>(config: Partial<T>) => {
|
|
3
|
-
get<TKey extends keyof T>(key: TKey): T[TKey]
|
|
3
|
+
get<TKey extends keyof T>(key: TKey): T[TKey];
|
|
4
4
|
set<TKey_1 extends keyof T>(key: TKey_1, value: T[TKey_1]): void;
|
|
5
5
|
has<TKey_2 extends keyof T>(key: TKey_2): boolean;
|
|
6
6
|
remove<TKey_3 extends keyof T>(key: TKey_3): void;
|
package/getNonce.d.ts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* @category security
|
|
3
3
|
* @see https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/nonce.ts
|
|
4
4
|
*/
|
|
5
|
-
export declare function getNonce(): string
|
|
5
|
+
export declare function getNonce(): string;
|
|
6
6
|
export default getNonce;
|
package/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* the selection is based on:
|
|
4
|
+
* Libraries to encapsulate and re-export from here, the selection is based on:
|
|
6
5
|
*
|
|
7
6
|
* [x] full typescript support
|
|
8
7
|
* [x] treeshake-ability
|
|
@@ -24,6 +23,14 @@
|
|
|
24
23
|
*
|
|
25
24
|
* About utilities useful examples @see:
|
|
26
25
|
* - https://github.com/chakra-ui/chakra-ui/blob/main/packages/utils/src
|
|
26
|
+
*
|
|
27
|
+
* TODO:
|
|
28
|
+
* We could also re-exports direct dependencies of packages that we often use
|
|
29
|
+
* anyway like [those of `yup`](https://github.com/jquense/yup/blob/master/package.json#L103):
|
|
30
|
+
*
|
|
31
|
+
* - [tiny-case](https://github.com/jquense/tiny-case)
|
|
32
|
+
* - [property-expr](https://github.com/jquense/expr/blob/master/index.js)
|
|
33
|
+
* - [toposort](https://github.com/marcelklehr/toposort)
|
|
27
34
|
*/
|
|
28
35
|
export * from "./accentSets";
|
|
29
36
|
export * from "./addOrReplaceAtIdx";
|
package/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* the selection is based on:
|
|
4
|
+
* Libraries to encapsulate and re-export from here, the selection is based on:
|
|
6
5
|
*
|
|
7
6
|
* [x] full typescript support
|
|
8
7
|
* [x] treeshake-ability
|
|
@@ -24,6 +23,14 @@
|
|
|
24
23
|
*
|
|
25
24
|
* About utilities useful examples @see:
|
|
26
25
|
* - https://github.com/chakra-ui/chakra-ui/blob/main/packages/utils/src
|
|
26
|
+
*
|
|
27
|
+
* TODO:
|
|
28
|
+
* We could also re-exports direct dependencies of packages that we often use
|
|
29
|
+
* anyway like [those of `yup`](https://github.com/jquense/yup/blob/master/package.json#L103):
|
|
30
|
+
*
|
|
31
|
+
* - [tiny-case](https://github.com/jquense/tiny-case)
|
|
32
|
+
* - [property-expr](https://github.com/jquense/expr/blob/master/index.js)
|
|
33
|
+
* - [toposort](https://github.com/marcelklehr/toposort)
|
|
27
34
|
*/
|
|
28
35
|
export * from "./accentSets";
|
|
29
36
|
export * from "./addOrReplaceAtIdx";
|
package/isNullOrUndefined.d.ts
CHANGED
package/node/index.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @file
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* the selection is based on:
|
|
5
|
+
* Libraries to encapsulate and re-export from here, the selection is based on:
|
|
7
6
|
*
|
|
8
7
|
* [x] full typescript support
|
|
9
8
|
* [x] treeshake-ability
|
|
@@ -25,6 +24,14 @@
|
|
|
25
24
|
*
|
|
26
25
|
* About utilities useful examples @see:
|
|
27
26
|
* - https://github.com/chakra-ui/chakra-ui/blob/main/packages/utils/src
|
|
27
|
+
*
|
|
28
|
+
* TODO:
|
|
29
|
+
* We could also re-exports direct dependencies of packages that we often use
|
|
30
|
+
* anyway like [those of `yup`](https://github.com/jquense/yup/blob/master/package.json#L103):
|
|
31
|
+
*
|
|
32
|
+
* - [tiny-case](https://github.com/jquense/tiny-case)
|
|
33
|
+
* - [property-expr](https://github.com/jquense/expr/blob/master/index.js)
|
|
34
|
+
* - [toposort](https://github.com/marcelklehr/toposort)
|
|
28
35
|
*/
|
|
29
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
37
|
var tslib_1 = require("tslib");
|
package/node/setCookie.js
CHANGED
|
@@ -23,7 +23,7 @@ function setCookie(name, value, attributes) {
|
|
|
23
23
|
if (process.env["NODE_ENV"] !== "production") {
|
|
24
24
|
console.warn("[@koine/utils] cookie setCookie: document is undefined");
|
|
25
25
|
}
|
|
26
|
-
return;
|
|
26
|
+
return undefined;
|
|
27
27
|
}
|
|
28
28
|
if ((0, isNumber_1.default)(expires)) {
|
|
29
29
|
expires = new Date(Date.now() + expires * 864e5);
|
package/package.json
CHANGED
package/pageview.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export declare type GtmPageviewArgs = [
|
|
|
6
6
|
/**
|
|
7
7
|
* @category analytics-google
|
|
8
8
|
*/
|
|
9
|
-
export declare const pageview: (page_path?: string
|
|
9
|
+
export declare const pageview: (page_path?: string, page_title?: string, page_location?: string) => void;
|
package/parseURL.d.ts
CHANGED
package/setCookie.js
CHANGED
|
@@ -20,7 +20,7 @@ export function setCookie(name, value, attributes) {
|
|
|
20
20
|
if (process.env["NODE_ENV"] !== "production") {
|
|
21
21
|
console.warn("[@koine/utils] cookie setCookie: document is undefined");
|
|
22
22
|
}
|
|
23
|
-
return;
|
|
23
|
+
return undefined;
|
|
24
24
|
}
|
|
25
25
|
if (isNumber(expires)) {
|
|
26
26
|
expires = new Date(Date.now() + expires * 864e5);
|