Skip to content

Commit

Permalink
chore: PR tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
walterholohan committed Sep 6, 2023
1 parent b42d0fd commit 7c4a301
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 467 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ yarn-error.log
.expo/*

# generated by bob
lib/
/.eslintcache

*.log
6 changes: 0 additions & 6 deletions ios/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ func sampleTypeFromString(typeIdentifier: String) -> HKSampleType? {
if typeIdentifier == HKWorkoutTypeIdentifier {
return HKSampleType.workoutType()
}

if #available(iOS 11.0, *) {
if typeIdentifier == HKWorkoutRouteTypeIdentifier {
return HKObjectType.seriesType(forIdentifier: typeIdentifier)
}
}

if #available(iOS 11.0, *) {
if typeIdentifier == HKWorkoutRouteTypeIdentifier {
Expand Down
7 changes: 0 additions & 7 deletions ios/ReactNativeHealthkit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,6 @@ class ReactNativeHealthkit: RCTEventEmitter {
return reject(TYPE_IDENTIFIER_ERROR, "Failed to initialize HKWorkoutActivityType " + typeIdentifier.description, nil)
}

// if start and end both exist, ensure that start date is before end date
if let startDate = start as Date?, let endDate = end as Date? {
if startDate > endDate {
return reject(GENERIC_ERROR, "Start date must be before end date", nil)
}
}

// if start and end both exist, ensure that start date is before end date
if let startDate = start as Date?, let endDate = end as Date? {
if startDate > endDate {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"test": "concurrently \"yarn test-only\" \"yarn typecheck\" \"yarn lint\"",
"typecheck": "tsc --noEmit",
"lint": "eslint \"**/*.{js,ts,tsx}\" --cache",
"prepare": "bob build && husky install",
"release": "release-it",
"example": "yarn --cwd example",
"pods": "cd example && pod-install --quiet",
"bootstrap": "yarn example && yarn && yarn pods",
"build": "bob build"
"bootstrap": "yarn example && yarn && yarn pods"
},
"lint-staged": {
"*.swift": "swiftlint ios --fix",
Expand Down
8 changes: 4 additions & 4 deletions src/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NativeModule, NativeModules } from "react-native";
import { NativeModule, NativeModules } from 'react-native'

import type Native from "./native-types";
import type Native from './native-types'

const mockModule: NativeModule & typeof Native = {
isHealthDataAvailable: jest.fn(),
Expand Down Expand Up @@ -41,6 +41,6 @@ const mockModule: NativeModule & typeof Native = {
canAccessProtectedData: jest.fn(),
saveWorkoutRoute: jest.fn(),
getWorkoutPlanId: jest.fn(),
};
}

NativeModules.ReactNativeHealthkit = mockModule;
NativeModules.ReactNativeHealthkit = mockModule
Loading

0 comments on commit 7c4a301

Please sign in to comment.