Skip to content

Commit

Permalink
fix: fixes ky instance bug and refactored tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocoski committed Aug 29, 2019
1 parent eaf4408 commit 5a10fdc
Show file tree
Hide file tree
Showing 52 changed files with 314 additions and 295 deletions.
4 changes: 2 additions & 2 deletions assets/jscpd-badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 8 additions & 9 deletions dist/FactoryConfig.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CreateItem, DeleteItems, Filter, GetItem, GetItems, Item, ReplaceItem, Sort, UpdateItem } from '@js-items/foundation';
import Facade from '@js-items/foundation/dist/Facade';
import { CreateItem, DeleteItem, DeleteItems, Filter, GetItem, GetItems, Item, ReplaceItem, Sort, UpdateItem } from '@js-items/foundation';
import ky from 'ky';
import { ConvertItemIntoOptions } from './types/convertItemIntoOptions';
import { Handler } from './types/handler';
Expand All @@ -19,23 +18,23 @@ export default interface FactoryConfig<I extends Item> {
readonly paginationKey?: string;
readonly envelopParamName?: string;
readonly prettyParamName?: string;
readonly createFilter: (filter?: Filter<I>) => any;
readonly convertDocumentIntoItem: (document: Document) => I;
readonly convertItemIntoOptions: ConvertItemIntoOptions<I>;
readonly createSort: (sort: Sort<I>) => any;
readonly createFilter?: (filter?: Filter<I>) => any;
readonly convertDocumentIntoItem?: (document: Document) => I;
readonly convertItemIntoOptions?: ConvertItemIntoOptions<I>;
readonly createSort?: (sort: Sort<I>) => any;
readonly updateItem?: Handler<I, UpdateItem<I>>;
readonly updateItemOptions?: ConvertItemIntoOptions<I>;
readonly replaceItem?: Handler<I, ReplaceItem<I>>;
readonly replaceItemOptions?: ConvertItemIntoOptions<I>;
readonly deleteItem?: Handler<I, DeleteItems<I>>;
readonly deleteItem?: Handler<I, DeleteItem<I>>;
readonly deleteItemOptions?: ConvertItemIntoOptions<I>;
readonly deleteItems?: Handler<I, CreateItem<I>>;
readonly deleteItems?: Handler<I, DeleteItems<I>>;
readonly deleteItemsOptions?: ConvertItemIntoOptions<I>;
readonly getItem?: Handler<I, GetItem<I>>;
readonly getItemOptions?: ConvertItemIntoOptions<I>;
readonly getItems?: Handler<I, GetItems<I>>;
readonly getItemsOptions?: ConvertItemIntoOptions<I>;
readonly createItem?: Handler<I, ReplaceItem<I>>;
readonly createItem?: Handler<I, CreateItem<I>>;
readonly createItemOptions?: ConvertItemIntoOptions<I>;
readonly defaultPaginationLimit?: number;
readonly itemName: string;
Expand Down
7 changes: 4 additions & 3 deletions dist/factory.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { /* DeleteItem, */ Item } from '@js-items/foundation';
import { Item } from '@js-items/foundation';
import Facade from '@js-items/foundation/dist/Facade';
import FactoryConfig from './FactoryConfig';
declare const _default: <I extends Item>({ deleteItem, deleteItems, getItem, getItems, updateItem, replaceItem, createItem, convertItemIntoOptions, ...config }: FactoryConfig<I>) => any;
export default _default;
declare const factory: <I extends Item>({ deleteItem, deleteItems, getItem, getItems, updateItem, replaceItem, createItem, convertItemIntoOptions, ...config }: FactoryConfig<I>) => Facade<I>;
export default factory;
40 changes: 21 additions & 19 deletions dist/factory.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/factory.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/functions/createItem/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/functions/createItem/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions dist/functions/createItem/index.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5a10fdc

Please sign in to comment.