Skip to content

Commit

Permalink
lint: apply prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dstaley authored and dependabot[bot] committed Aug 5, 2023
1 parent 17e2cb2 commit 57328cb
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/KintoBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface KintoBaseOptions {
*/
/* eslint-disable @typescript-eslint/no-unused-vars */
export default class KintoBase<
B extends { id: string; last_modified?: number; _status?: RecordStatus }
B extends { id: string; last_modified?: number; _status?: RecordStatus },
> {
/* eslint-enable @typescript-eslint/no-unused-vars */
private _options: KintoBaseOptions;
Expand Down Expand Up @@ -141,7 +141,7 @@ export default class KintoBase<
id: string;
last_modified?: number;
_status?: RecordStatus;
} = any
} = any,
>(
collName: string,
options: {
Expand Down
6 changes: 3 additions & 3 deletions src/adapters/IDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class IDBError extends Error {
* This adapter doesn't support any options.
*/
export default class IDB<
B extends { id: string; last_modified?: number; _status?: RecordStatus }
B extends { id: string; last_modified?: number; _status?: RecordStatus },
> extends BaseAdapter<B> {
private _db: IDBDatabase | null;
public cid: string;
Expand Down Expand Up @@ -753,7 +753,7 @@ export default class IDB<
* @return {Object}
*/
function transactionProxy<
T extends { id: string; last_modified?: number; _status?: RecordStatus }
T extends { id: string; last_modified?: number; _status?: RecordStatus },
>(
adapter: IDB<T>,
store: IDBObjectStore,
Expand Down Expand Up @@ -785,7 +785,7 @@ function transactionProxy<
* and contained only one store with the same name.
*/
async function migrationRequired<
T extends { id: string; last_modified?: number; _status?: RecordStatus }
T extends { id: string; last_modified?: number; _status?: RecordStatus },
>(dbName: string): Promise<{ records: T[]; timestamp: number | null } | null> {
let exists = true;
const db = await open(dbName, {
Expand Down
6 changes: 3 additions & 3 deletions src/adapters/base.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { RecordStatus } from "../types";

export interface StorageProxy<
T extends { id: string; last_modified?: number; _status?: RecordStatus }
T extends { id: string; last_modified?: number; _status?: RecordStatus },
> {
create: (record: T) => void;
update: (record: T & { id: string }) => any;
Expand All @@ -10,7 +10,7 @@ export interface StorageProxy<
}

export abstract class AbstractBaseAdapter<
B extends { id: string; last_modified?: number; _status?: RecordStatus }
B extends { id: string; last_modified?: number; _status?: RecordStatus },
> {
abstract clear(): Promise<void>;
abstract execute<T>(
Expand Down Expand Up @@ -42,7 +42,7 @@ export abstract class AbstractBaseAdapter<
* @abstract
*/
export default class BaseAdapter<
B extends { id: string; last_modified?: number; _status?: RecordStatus }
B extends { id: string; last_modified?: number; _status?: RecordStatus },
> implements AbstractBaseAdapter<B>
{
/**
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { getDeepKey } from "../utils";
// you need. Alternatively, you can copy/paste the BaseAdapter implementation
// and adjust the methods there.
export default class Memory<
B extends { id: string; last_modified?: number; _status?: RecordStatus }
B extends { id: string; last_modified?: number; _status?: RecordStatus },
>
extends BaseAdapter<B>
implements AbstractBaseAdapter<B>
Expand Down
10 changes: 7 additions & 3 deletions src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function markSynced<T extends { _status?: string }>(record: T) {
* @return {Object}
*/
function importChange<
T extends { id: string; last_modified?: number; _status?: RecordStatus }
T extends { id: string; last_modified?: number; _status?: RecordStatus },
>(
transaction: StorageProxy<T>,
remote: T & { deleted?: boolean },
Expand Down Expand Up @@ -350,7 +350,11 @@ function importChange<
* CRUD operations and synchronization helpers.
*/
export default class Collection<
B extends { id: string; last_modified?: number; _status?: RecordStatus } = any
B extends {
id: string;
last_modified?: number;
_status?: RecordStatus;
} = any,
> {
/**
* Constructor.
Expand Down Expand Up @@ -1701,7 +1705,7 @@ export default class Collection<
* perform just one operation in its own transaction.
*/
export class CollectionTransaction<
B extends { id: string; last_modified?: number; _status?: RecordStatus }
B extends { id: string; last_modified?: number; _status?: RecordStatus },
> {
public collection: Collection<B>;
public adapterTransaction: StorageProxy<B>;
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import type Collection from "./collection";
import type { CollectionSyncOptions, Conflict, RecordStatus } from "./types";

export default class Kinto<
B extends { id: string; last_modified?: number; _status?: RecordStatus } = any
B extends {
id: string;
last_modified?: number;
_status?: RecordStatus;
} = any,
> extends KintoBase<B> {
/**
* Provides a public access to the base adapter classes. Users can create
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export interface RemoteTransformer {
export type AvailableHook = "incoming-changes";

export type Hooks<
T extends { id: string; [key: string]: unknown } = { id: string }
T extends { id: string; [key: string]: unknown } = { id: string },
> = {
[key in AvailableHook]?: ((
record: any,
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function deepEqual(a: any, b: any): boolean {
*/
export function omitKeys<
T extends { [key: string]: unknown },
K extends string
K extends string,
>(obj: T, keys: K[] = []): Omit<T, K> {
const result = { ...obj };
for (const key of keys) {
Expand Down

0 comments on commit 57328cb

Please sign in to comment.