@luvio/adapter-test-library 0.138.7 → 0.138.9

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.
@@ -5,7 +5,7 @@ import type { FetchResponse, NetworkAdapter, Snapshot } from '@luvio/engine';
5
5
  * @param {object} data The object to clone
6
6
  * @returns {object} The cloned object
7
7
  */
8
- export declare function clone(data: any): any;
8
+ export declare function clone<T>(data: T): T;
9
9
  /**
10
10
  * Strips the given properties from an object. Useful for comparing data payloads
11
11
  * where the given props may not be present in the data returned from an adapter.
@@ -18,7 +18,9 @@ export declare function clone(data: any): any;
18
18
  */
19
19
  export declare function stripProperties(obj: {
20
20
  [s: string]: any;
21
- }, props: string[]): any;
21
+ }, props: string[]): {
22
+ [s: string]: any;
23
+ };
22
24
  export declare function doesThrow(predicate: () => void): boolean;
23
25
  export declare function flushPromises(): Promise<unknown>;
24
26
  type MatcherResult = {
@@ -5,7 +5,7 @@ import type { FetchResponse, NetworkAdapter, Snapshot } from '@luvio/engine';
5
5
  * @param {object} data The object to clone
6
6
  * @returns {object} The cloned object
7
7
  */
8
- export declare function clone(data: any): any;
8
+ export declare function clone<T>(data: T): T;
9
9
  /**
10
10
  * Strips the given properties from an object. Useful for comparing data payloads
11
11
  * where the given props may not be present in the data returned from an adapter.
@@ -18,7 +18,9 @@ export declare function clone(data: any): any;
18
18
  */
19
19
  export declare function stripProperties(obj: {
20
20
  [s: string]: any;
21
- }, props: string[]): any;
21
+ }, props: string[]): {
22
+ [s: string]: any;
23
+ };
22
24
  export declare function doesThrow(predicate: () => void): boolean;
23
25
  export declare function flushPromises(): Promise<unknown>;
24
26
  type MatcherResult = {
@@ -5,7 +5,7 @@ import type { FetchResponse, NetworkAdapter, Snapshot } from '@luvio/engine';
5
5
  * @param {object} data The object to clone
6
6
  * @returns {object} The cloned object
7
7
  */
8
- export declare function clone(data: any): any;
8
+ export declare function clone<T>(data: T): T;
9
9
  /**
10
10
  * Strips the given properties from an object. Useful for comparing data payloads
11
11
  * where the given props may not be present in the data returned from an adapter.
@@ -18,7 +18,9 @@ export declare function clone(data: any): any;
18
18
  */
19
19
  export declare function stripProperties(obj: {
20
20
  [s: string]: any;
21
- }, props: string[]): any;
21
+ }, props: string[]): {
22
+ [s: string]: any;
23
+ };
22
24
  export declare function doesThrow(predicate: () => void): boolean;
23
25
  export declare function flushPromises(): Promise<unknown>;
24
26
  type MatcherResult = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luvio/adapter-test-library",
3
- "version": "0.138.7",
3
+ "version": "0.138.9",
4
4
  "description": "Test library for luvio adapters",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,8 +21,8 @@
21
21
  "sinon": "^14.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@luvio/engine": "^0.138.7",
25
- "@luvio/environments": "^0.138.7",
24
+ "@luvio/engine": "^0.138.9",
25
+ "@luvio/environments": "^0.138.9",
26
26
  "@types/sinon": "^7.5.2"
27
27
  },
28
28
  "volta": {
package/src/utils.ts CHANGED
@@ -15,9 +15,9 @@ import { isImmutable } from './verification';
15
15
  * @param {object} data The object to clone
16
16
  * @returns {object} The cloned object
17
17
  */
18
- export function clone(data: any) {
18
+ export function clone<T>(data: T): T {
19
19
  if (data === undefined) {
20
- return undefined;
20
+ return undefined as T;
21
21
  }
22
22
 
23
23
  return JSON.parse(JSON.stringify(data));