From 134c5b485b87e006f205d482681e2da82fe4a2df Mon Sep 17 00:00:00 2001 From: Johan-dutoit Date: Fri, 30 Aug 2019 13:38:24 +0100 Subject: [PATCH] chore(cleanup): Apply prettier --- src/index.ts | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/index.ts b/src/index.ts index 88b414cdc..ceb86d9e7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ import NativeInterface from './internal/nativeInterface'; import {ImagePickerOptions, ImagePickerResponse} from './internal/types'; -import { processColor } from 'react-native'; +import {processColor} from 'react-native'; const DEFAULT_OPTIONS: ImagePickerOptions = { title: 'Select a Photo', @@ -25,7 +25,7 @@ const DEFAULT_OPTIONS: ImagePickerOptions = { reTryTitle: 're-try', okTitle: "I'm sure", }, - tintColor: 'blue' + tintColor: 'blue', }; type Callback = (response: ImagePickerResponse) => void; @@ -38,14 +38,12 @@ class ImagePicker { showImagePicker( optionsOrCallback: OptionsOrCallback, callback?: Callback, - ): void { + ): void { if (typeof optionsOrCallback === 'function') { return NativeInterface.showImagePicker( { ...DEFAULT_OPTIONS, - ...{ - tintColor: processColor(DEFAULT_OPTIONS.tintColor) - } + tintColor: processColor(DEFAULT_OPTIONS.tintColor), }, optionsOrCallback, ); @@ -59,25 +57,32 @@ class ImagePicker { { ...DEFAULT_OPTIONS, ...optionsOrCallback, - ...{ - tintColor: processColor(optionsOrCallback.tintColor || DEFAULT_OPTIONS.tintColor) - } + tintColor: processColor( + optionsOrCallback.tintColor || DEFAULT_OPTIONS.tintColor, + ), }, callback, ); } - launchCamera(options: ImagePickerOptions, callback: Callback): void { return NativeInterface.launchCamera( - {...DEFAULT_OPTIONS, ...options, ...{ tintColor: processColor(options.tintColor || DEFAULT_OPTIONS.tintColor) }}, + { + ...DEFAULT_OPTIONS, + ...options, + tintColor: processColor(options.tintColor || DEFAULT_OPTIONS.tintColor), + }, callback, ); } launchImageLibrary(options: ImagePickerOptions, callback: Callback): void { return NativeInterface.launchImageLibrary( - {...DEFAULT_OPTIONS, ...options, ...{ tintColor: processColor(options.tintColor || DEFAULT_OPTIONS.tintColor) }}, + { + ...DEFAULT_OPTIONS, + ...options, + tintColor: processColor(options.tintColor || DEFAULT_OPTIONS.tintColor), + }, callback, ); }