Skip to content

Commit

Permalink
fix: remove changes in lib
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Apr 9, 2019
1 parent 6a9a633 commit 1404d2f
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .storybook/playgrounds/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function instantSearchPlayground({
search: any;
leftPanel: HTMLElement;
rightPanel: HTMLElement;
}): void {
}) {
const refinementList = document.createElement('div');
leftPanel.appendChild(refinementList);

Expand Down
2 changes: 1 addition & 1 deletion .storybook/playgrounds/movies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function demoQueryRulesPlayground({
search: any;
leftPanel: HTMLElement;
rightPanel: HTMLElement;
}): void {
}) {
const refinementList = document.createElement('div');
leftPanel.appendChild(refinementList);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/checkRendering.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Renderer } from '../../types/connector';

function checkRendering(rendering: Renderer, usage: string): void {
function checkRendering(rendering: Renderer, usage: string) {
if (rendering === undefined || typeof rendering !== 'function') {
throw new Error(`The render function is not valid (got type "${typeof rendering}").
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/escapeRefinement.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function escapeRefinement(value: string | number): string | number {
function escapeRefinement(value: string | number) {
if (typeof value === 'number' && value < 0) {
value = String(value).replace(/^-/, '\\-');
}
Expand Down
4 changes: 1 addition & 3 deletions src/lib/utils/getContainerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import isDomElement from './isDomElement';
*
* @throws Error when the type is not correct
*/
function getContainerNode(
selectorOrHTMLElement: string | HTMLElement
): HTMLElement {
function getContainerNode(selectorOrHTMLElement: string | HTMLElement) {
const isSelectorString = typeof selectorOrHTMLElement === 'string';
const domElement = isSelectorString
? document.querySelector(selectorOrHTMLElement as string)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/getPropertyByPath.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function getPropertyByPath(object: object, path: string): any {
function getPropertyByPath(object: object, path: string) {
const parts = path.split('.');

return parts.reduce((current, key) => current && current[key], object);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/isSpecialClick.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function isSpecialClick(event: MouseEvent): boolean {
function isSpecialClick(event: MouseEvent) {
const isMiddleClick = event.button === 1;

return (
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/prefixKeys.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import mapKeys from 'lodash/mapKeys';

function prefixKeys(prefix: string, obj: object): object | undefined {
function prefixKeys(prefix: string, obj: object) {
if (obj) {
return mapKeys(obj, (_0, key) => prefix + key);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/unescapeRefinement.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function unescapeRefinement(value: string | number): string {
function unescapeRefinement(value: string | number) {
return String(value).replace(/^\\-/, '-');
}

Expand Down
4 changes: 2 additions & 2 deletions stories/query-rule-context.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ storiesOf('QueryRuleContext', module)
search.addWidget(
instantsearch.widgets.queryRuleCustomData({
container: widgetContainer,
transformItems(items: CustomDataItem[]): CustomDataItem[] {
transformItems(items: CustomDataItem[]) {
return items.filter(item => typeof item.banner !== 'undefined');
},
templates: {
Expand Down Expand Up @@ -99,7 +99,7 @@ storiesOf('QueryRuleContext', module)
search.addWidget(
instantsearch.widgets.queryRuleCustomData({
container: widgetContainer,
transformItems(items: CustomDataItem[]): CustomDataItem[] {
transformItems(items: CustomDataItem[]) {
return items.filter(item => typeof item.banner !== 'undefined');
},
templates: {
Expand Down
6 changes: 3 additions & 3 deletions stories/query-rule-custom-data.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ storiesOf('QueryRuleCustomData', module)
search.addWidget(
instantsearch.widgets.queryRuleCustomData({
container: widgetContainer,
transformItems: (items: CustomDataItem[]): CustomDataItem[] => {
transformItems: (items: CustomDataItem[]) => {
if (items.length > 0) {
return items.filter(item => typeof item.banner !== 'undefined');
}
Expand All @@ -115,9 +115,9 @@ storiesOf('QueryRuleCustomData', module)
];
},
templates: {
default(items: CustomDataItem[]): string {
default(items: CustomDataItem[]) {
if (items.length === 0) {
return '';
return;
}

const { title, banner, link } = items[0];
Expand Down

0 comments on commit 1404d2f

Please sign in to comment.