From 5b6ac9ebc197063920d6713e4c08cbbe433495ee Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Fri, 31 Aug 2018 19:00:01 +0200 Subject: [PATCH 01/60] Replace checkboxes with SelectBox component on sex view --- components/cycle-day/select-box.js | 25 +++ components/cycle-day/symptoms/bleeding.js | 4 +- components/cycle-day/symptoms/cervix.js | 10 +- components/cycle-day/symptoms/desire.js | 2 +- components/cycle-day/symptoms/mucus.js | 45 ++--- components/cycle-day/symptoms/note.js | 2 +- components/cycle-day/symptoms/sex.js | 182 ++++++++----------- components/cycle-day/symptoms/temperature.js | 10 +- styles/index.js | 27 ++- 9 files changed, 158 insertions(+), 149 deletions(-) create mode 100644 components/cycle-day/select-box.js diff --git a/components/cycle-day/select-box.js b/components/cycle-day/select-box.js new file mode 100644 index 0000000..ec4520c --- /dev/null +++ b/components/cycle-day/select-box.js @@ -0,0 +1,25 @@ +import React, { Component } from 'react' +import { + View, + Text, + TouchableOpacity, +} from 'react-native' +import styles from '../../styles' + +export default class SelectBox extends Component { + render () { + const style = [styles.selectBox] + const textStyle = [] + if (this.props.value) { + style.push(styles.selectBoxActive) + textStyle.push(styles.selectBoxTextActive) + } + return ( + + + {this.props.label} + + + ) + } +} \ No newline at end of file diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index bd24b9e..8ccba47 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -35,7 +35,7 @@ export default class Bleeding extends Component { ] return ( - + - Exclude + Exclude { this.setState({ exclude: val }) diff --git a/components/cycle-day/symptoms/cervix.js b/components/cycle-day/symptoms/cervix.js index d1d8ba6..96d332b 100644 --- a/components/cycle-day/symptoms/cervix.js +++ b/components/cycle-day/symptoms/cervix.js @@ -51,9 +51,9 @@ export default class Cervix extends Component { ] return ( - + - Opening + Opening - Firmness + Firmness - Position + Position - Exclude + Exclude { this.setState({ exclude: val }) diff --git a/components/cycle-day/symptoms/desire.js b/components/cycle-day/symptoms/desire.js index 2dd6fc6..2736483 100644 --- a/components/cycle-day/symptoms/desire.js +++ b/components/cycle-day/symptoms/desire.js @@ -29,7 +29,7 @@ export default class Desire extends Component { ] return ( - + - + - Feeling + Feeling - { - this.setState({ feeling: itemValue }) - }} - /> + {makeSelectBoxes(mucusFeelingBoxes, 'feeling')} - Texture + Texture - { - this.setState({ texture: itemValue }) - }} - /> + {makeSelectBoxes(mucusTextureRadioProps, 'texture')} - Exclude + Exclude { this.setState({ exclude: val }) @@ -106,3 +89,15 @@ export default class Mucus extends Component { ) } } + +function makeSelectBoxes(boxes, category) { + return boxes.map(({ label, value }) => { + return ( + this.setState({ [category]: value })} + key={value} + /> + ) + }) +} \ No newline at end of file diff --git a/components/cycle-day/symptoms/note.js b/components/cycle-day/symptoms/note.js index 6bf0cb6..ffbb543 100644 --- a/components/cycle-day/symptoms/note.js +++ b/components/cycle-day/symptoms/note.js @@ -24,7 +24,7 @@ export default class Temp extends Component { render() { return ( - + { + return ( + this.toggleState(stateKey)} + label={label} + key={stateKey} + /> + ) + }) + } + toggleState(key) { + const curr = this.state[key] + this.setState({[key]: !curr}) + } + + render() { return ( - - - - {activityLabels.solo} - { - this.setState({ solo: val }) - }} - /> - {activityLabels.partner} - { - this.setState({ partner: val }) - }} - /> - - CONTRACEPTIVES - - - {contraceptiveLabels.condom} - - { - this.setState({ condom: val }) - }} - /> - - {contraceptiveLabels.pill} - - { - this.setState({ pill: val }) - }} - /> - - - - {contraceptiveLabels.iud} - - { - this.setState({ iud: val }) - }} - /> - - {contraceptiveLabels.patch} - - { - this.setState({ patch: val }) - }} - /> - - - - {contraceptiveLabels.ring} - - { - this.setState({ ring: val }) - }} - /> - - {contraceptiveLabels.implant} - - { - this.setState({ implant: val }) - }} - /> - - - - {contraceptiveLabels.other} - - { - this.setState({ - other: val, - focusTextArea: true - }) - }} - /> - - {this.state.other && - { - this.setState({ note: val }) - }} - /> - } + + Activity + + {this.makeSelectBoxes(sexBoxes)} + Contraceptives + + {this.makeSelectBoxes(contraceptiveBoxes)} + { + this.toggleState('other') + this.setState({ focusTextArea: true }) + }} + /> + + {this.state.other && + { + this.setState({ note: val }) + }} + /> + } ) } -} \ No newline at end of file +} diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index ae7d74e..09be3be 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -96,10 +96,10 @@ export default class Temp extends Component { render() { return ( - + - Temperature (°C) + Temperature (°C) this.setState(val)} @@ -107,7 +107,7 @@ export default class Temp extends Component { /> - Time + Time { @@ -129,7 +129,7 @@ export default class Temp extends Component { onCancel={() => this.setState({ isTimePickerVisible: false })} /> - Note + Note - Exclude + Exclude { this.setState({ exclude: val }) diff --git a/styles/index.js b/styles/index.js index 70d0293..af29deb 100644 --- a/styles/index.js +++ b/styles/index.js @@ -23,9 +23,8 @@ export default StyleSheet.create({ textAlign: 'center', marginLeft: 15 }, - symptomDayView: { + symptomViewHeading: { fontSize: 20, - textAlignVertical: 'center' }, symptomBoxImage: { width: 50, @@ -198,6 +197,28 @@ export default StyleSheet.create({ fontSize: 15, color: fontOnPrimaryColor }, + selectBox: { + backgroundColor: 'lightgrey', + margin: 7, + paddingHorizontal: 15, + paddingVertical: 10, + borderRadius: 10 + }, + selectBoxActive: { + backgroundColor: secondaryColor, + color: fontOnPrimaryColor + }, + selectBoxTextActive: { + color: fontOnPrimaryColor + }, + selectBoxSection: { + flexDirection: 'row', + flexWrap: 'wrap', + marginVertical: 10, + }, + page: { + padding: 10 + } }) export const iconStyles = { @@ -217,5 +238,5 @@ export const iconStyles = { }, menuIconInactive: { color: 'lightgrey' - } + }, } \ No newline at end of file From c2c8a7da26686089988b7bc4c261f505d68b21c5 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Fri, 31 Aug 2018 19:52:07 +0200 Subject: [PATCH 02/60] First attempt for radio buttons --- components/cycle-day/radio-button-group.js | 36 ++++++++++++++++++++++ components/cycle-day/symptoms/mucus.js | 33 +++++++++----------- styles/index.js | 30 +++++++++++++----- 3 files changed, 72 insertions(+), 27 deletions(-) create mode 100644 components/cycle-day/radio-button-group.js diff --git a/components/cycle-day/radio-button-group.js b/components/cycle-day/radio-button-group.js new file mode 100644 index 0000000..4ef8358 --- /dev/null +++ b/components/cycle-day/radio-button-group.js @@ -0,0 +1,36 @@ +import React, { Component } from 'react' +import { + View, + Text, + TouchableOpacity, +} from 'react-native' +import styles from '../../styles' + +export default class RadioButton extends Component { + render() { + return ( + + { + this.props.buttons.map(({ label, value }) => { + const circleStyle = [styles.radioButton] + if (value === this.props.active) { + circleStyle.push(styles.radioButtonActive) + } + return ( + this.props.onSelect(value)} + key={value} + activeOpacity={1} + > + + + {label} + + + ) + }) + } + + ) + } +} \ No newline at end of file diff --git a/components/cycle-day/symptoms/mucus.js b/components/cycle-day/symptoms/mucus.js index 1e9b664..b7ca8d1 100644 --- a/components/cycle-day/symptoms/mucus.js +++ b/components/cycle-day/symptoms/mucus.js @@ -5,7 +5,6 @@ import { Switch, ScrollView } from 'react-native' -import RadioForm from 'react-native-simple-radio-button' import styles from '../../../styles' import { saveSymptom } from '../../../db' import { @@ -14,7 +13,7 @@ import { } from '../labels/labels' import computeSensiplanValue from '../../../lib/sensiplan-mucus' import ActionButtonFooter from './action-button-footer' -import SelectBox from '../select-box' +import RadioButtonGroup from '../radio-button-group' export default class Mucus extends Component { @@ -37,13 +36,13 @@ export default class Mucus extends Component { } render() { - const mucusFeelingBoxes = [ - { label: feelingLabels[0], value: 0 }, + const mucusFeeling = [ + { label: feelingLabels[0], stateKey: ''}, { label: feelingLabels[1], value: 1 }, { label: feelingLabels[2], value: 2 }, { label: feelingLabels[3], value: 3 } ] - const mucusTextureRadioProps = [ + const mucusTexture = [ { label: textureLabels[0], value: 0 }, { label: textureLabels[1], value: 1 }, { label: textureLabels[2], value: 2 } @@ -54,11 +53,19 @@ export default class Mucus extends Component { Feeling - {makeSelectBoxes(mucusFeelingBoxes, 'feeling')} + this.setState({feeling: val})} + active={this.state.feeling} + /> Texture - {makeSelectBoxes(mucusTextureRadioProps, 'texture')} + this.setState({texture: val})} + active={this.state.texture} + /> Exclude @@ -89,15 +96,3 @@ export default class Mucus extends Component { ) } } - -function makeSelectBoxes(boxes, category) { - return boxes.map(({ label, value }) => { - return ( - this.setState({ [category]: value })} - key={value} - /> - ) - }) -} \ No newline at end of file diff --git a/styles/index.js b/styles/index.js index af29deb..7cc0c14 100644 --- a/styles/index.js +++ b/styles/index.js @@ -30,12 +30,6 @@ export default StyleSheet.create({ width: 50, height: 50 }, - radioButton: { - fontSize: 18, - margin: 8, - textAlign: 'center', - textAlignVertical: 'center' - }, symptomBoxesView: { flexDirection: 'row', flexWrap: 'wrap', @@ -151,8 +145,6 @@ export default StyleSheet.create({ }, radioButtonRow: { marginTop: 15, - marginLeft: 'auto', - marginRight: 'auto' }, statsIntro: { fontSize: 18, @@ -216,6 +208,28 @@ export default StyleSheet.create({ flexWrap: 'wrap', marginVertical: 10, }, + radioButton: { + width: 30, + height: 30, + borderRadius: 100, + borderStyle: 'solid', + borderWidth: 2, + borderColor: secondaryColor, + marginBottom: 5 + }, + radioButtonActive: { + backgroundColor: secondaryColor, + color: fontOnPrimaryColor + }, + radioButtonGroup: { + flexDirection: 'row', + flexWrap: 'wrap', + marginVertical: 10, + }, + radioButtonTextGroup: { + alignItems: 'center', + marginHorizontal: 10 + }, page: { padding: 10 } From ca8764aa4b2992350c8898cb4d54618b088e4a98 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Fri, 31 Aug 2018 20:11:30 +0200 Subject: [PATCH 03/60] Add dot when active --- components/cycle-day/radio-button-group.js | 9 +++++---- styles/index.js | 16 ++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/components/cycle-day/radio-button-group.js b/components/cycle-day/radio-button-group.js index 4ef8358..0881809 100644 --- a/components/cycle-day/radio-button-group.js +++ b/components/cycle-day/radio-button-group.js @@ -12,10 +12,8 @@ export default class RadioButton extends Component { { this.props.buttons.map(({ label, value }) => { + const isActive = value === this.props.active const circleStyle = [styles.radioButton] - if (value === this.props.active) { - circleStyle.push(styles.radioButtonActive) - } return ( this.props.onSelect(value)} @@ -23,7 +21,10 @@ export default class RadioButton extends Component { activeOpacity={1} > - + + {isActive ? + : null} + {label} diff --git a/styles/index.js b/styles/index.js index 7cc0c14..9a1e6a9 100644 --- a/styles/index.js +++ b/styles/index.js @@ -209,17 +209,21 @@ export default StyleSheet.create({ marginVertical: 10, }, radioButton: { - width: 30, - height: 30, + width: 20, + height: 20, borderRadius: 100, borderStyle: 'solid', borderWidth: 2, borderColor: secondaryColor, - marginBottom: 5 + marginBottom: 5, + alignItems: 'center', + justifyContent: 'center' }, - radioButtonActive: { - backgroundColor: secondaryColor, - color: fontOnPrimaryColor + radioButtonActiveDot: { + width: 10, + height: 10, + borderRadius: 100, + backgroundColor: secondaryColor }, radioButtonGroup: { flexDirection: 'row', From 8b37fa3ca489e7147a8e4761f6ebcd9e8943c20c Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 18:11:55 +0200 Subject: [PATCH 04/60] Add app text component and remove radio button dep --- components/app-text.js | 23 + components/chart/chart.js | 5 +- components/chart/y-axis.js | 7 +- components/cycle-day/cycle-day-overview.js | 6 +- components/cycle-day/radio-button-group.js | 7 +- components/cycle-day/select-box.js | 4 +- components/cycle-day/symptoms/bleeding.js | 30 +- components/cycle-day/symptoms/cervix.js | 63 +- components/cycle-day/symptoms/desire.js | 19 +- components/cycle-day/symptoms/mucus.js | 32 +- components/cycle-day/symptoms/sex.js | 30 +- components/cycle-day/symptoms/temperature.js | 12 +- components/settings.js | 40 +- components/stats.js | 28 +- package-lock.json | 2939 +++++++++--------- package.json | 1 - styles/index.js | 23 +- 17 files changed, 1626 insertions(+), 1643 deletions(-) create mode 100644 components/app-text.js diff --git a/components/app-text.js b/components/app-text.js new file mode 100644 index 0000000..c553445 --- /dev/null +++ b/components/app-text.js @@ -0,0 +1,23 @@ +import React, { Component } from 'react' +import { Text } from 'react-native' +import styles from "../styles" + +export class AppText extends Component { + render() { + return ( + + {this.props.children} + + ) + } +} + +export class SymptomSectionHeader extends Component { + render() { + return ( + + {this.props.children} + + ) + } +} \ No newline at end of file diff --git a/components/chart/chart.js b/components/chart/chart.js index 0248979..de09540 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import { View, FlatList, Text } from 'react-native' +import { View, FlatList } from 'react-native' import range from 'date-range' import { LocalDate } from 'js-joda' import { makeYAxisLabels, normalizeToScale, makeHorizontalGrid } from './y-axis' @@ -9,6 +9,7 @@ import { getCycleDay, cycleDaysSortedByDate, getAmountOfCycleDays } from '../../ import styles from './styles' import { scaleObservable } from '../../local-storage' import config from '../../config' +import { AppText } from '../app-text' export default class CycleChart extends Component { constructor(props) { @@ -100,7 +101,7 @@ export default class CycleChart extends Component { > {!this.state.chartLoaded && - Loading... + Loading... } diff --git a/components/chart/y-axis.js b/components/chart/y-axis.js index 27d1411..57d481f 100644 --- a/components/chart/y-axis.js +++ b/components/chart/y-axis.js @@ -1,8 +1,9 @@ import React from 'react' -import { Text, View } from 'react-native' +import { View } from 'react-native' import config from '../../config' import styles from './styles' import { scaleObservable } from '../../local-storage' +import { AppText } from '../app-text' export function makeYAxisLabels(columnHeight) { const units = config.temperatureScale.units @@ -15,11 +16,11 @@ export function makeYAxisLabels(columnHeight) { // to reliably place the label vertically centered to the grid if (scaleMax - i * units === 37) console.log(y) return ( - {scaleMax - i * units} - + ) }) } diff --git a/components/cycle-day/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js index baccc50..9d38dee 100644 --- a/components/cycle-day/cycle-day-overview.js +++ b/components/cycle-day/cycle-day-overview.js @@ -2,7 +2,6 @@ import React, { Component } from 'react' import { ScrollView, View, - Text, TouchableOpacity, Dimensions } from 'react-native' @@ -22,6 +21,7 @@ import { cervixPosition as positionLabels, intensity as intensityLabels } from './labels/labels' +import { AppText } from '../app-text' export default class CycleDayOverView extends Component { constructor(props) { @@ -198,10 +198,10 @@ class SymptomBox extends Component { name='thermometer' {...iconStyle} /> - {this.props.title} + {this.props.title} - {this.props.data} + {this.props.data} ) diff --git a/components/cycle-day/radio-button-group.js b/components/cycle-day/radio-button-group.js index 0881809..8b7ffac 100644 --- a/components/cycle-day/radio-button-group.js +++ b/components/cycle-day/radio-button-group.js @@ -1,10 +1,10 @@ import React, { Component } from 'react' import { View, - Text, TouchableOpacity, } from 'react-native' import styles from '../../styles' +import { AppText } from '../app-text' export default class RadioButton extends Component { render() { @@ -13,7 +13,6 @@ export default class RadioButton extends Component { { this.props.buttons.map(({ label, value }) => { const isActive = value === this.props.active - const circleStyle = [styles.radioButton] return ( this.props.onSelect(value)} @@ -21,11 +20,11 @@ export default class RadioButton extends Component { activeOpacity={1} > - + {isActive ? : null} - {label} + {label} ) diff --git a/components/cycle-day/select-box.js b/components/cycle-day/select-box.js index ec4520c..4fcdd29 100644 --- a/components/cycle-day/select-box.js +++ b/components/cycle-day/select-box.js @@ -1,10 +1,10 @@ import React, { Component } from 'react' import { View, - Text, TouchableOpacity, } from 'react-native' import styles from '../../styles' +import { AppText } from '../app-text' export default class SelectBox extends Component { render () { @@ -17,7 +17,7 @@ export default class SelectBox extends Component { return ( - {this.props.label} + {this.props.label} ) diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index 8ccba47..57a084a 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -1,15 +1,15 @@ import React, { Component } from 'react' import { View, - Text, Switch, ScrollView } from 'react-native' -import RadioForm from 'react-native-simple-radio-button' import styles from '../../../styles' import { saveSymptom } from '../../../db' import { bleeding as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' +import RadioButtonGroup from '../radio-button-group' +import { SymptomSectionHeader, AppText } from '../../app-text' export default class Bleeding extends Component { constructor(props) { @@ -37,20 +37,18 @@ export default class Bleeding extends Component { - - { - this.setState({ currentValue: itemValue }) - }} - /> - - - Exclude + Heaviness + How heavy is the bleeding? + this.setState({ currentValue: val })} + /> + Exclude + + + You can exclude this value if it's not menstrual bleeding + { this.setState({ exclude: val }) diff --git a/components/cycle-day/symptoms/cervix.js b/components/cycle-day/symptoms/cervix.js index 96d332b..86d46aa 100644 --- a/components/cycle-day/symptoms/cervix.js +++ b/components/cycle-day/symptoms/cervix.js @@ -1,11 +1,9 @@ import React, { Component } from 'react' import { View, - Text, Switch, ScrollView } from 'react-native' -import RadioForm from 'react-native-simple-radio-button' import styles from '../../../styles' import { saveSymptom } from '../../../db' import { @@ -14,6 +12,8 @@ import { cervixPosition as positionLabels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' +import RadioButtonGroup from '../radio-button-group' +import { SymptomSectionHeader } from '../../app-text' export default class Cervix extends Component { constructor(props) { @@ -53,47 +53,26 @@ export default class Cervix extends Component { - Opening - - { - this.setState({ opening: itemValue }) - }} - /> - - Firmness - - { - this.setState({ firmness: itemValue }) - }} - /> - - Position - - { - this.setState({ position: itemValue }) - }} - /> - + Opening + this.setState({ opening: val })} + /> + Firmness + this.setState({ firmness: val })} + /> + Position + this.setState({ position: val })} + /> - Exclude + Exclude { this.setState({ exclude: val }) diff --git a/components/cycle-day/symptoms/desire.js b/components/cycle-day/symptoms/desire.js index 2736483..64a0306 100644 --- a/components/cycle-day/symptoms/desire.js +++ b/components/cycle-day/symptoms/desire.js @@ -3,11 +3,11 @@ import { View, ScrollView } from 'react-native' -import RadioForm from 'react-native-simple-radio-button' import styles from '../../../styles' import { saveSymptom } from '../../../db' import { intensity as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' +import RadioButtonGroup from '../radio-button-group' export default class Desire extends Component { constructor(props) { @@ -31,18 +31,11 @@ export default class Desire extends Component { - - { - this.setState({ currentValue: itemValue }) - }} - /> - + this.setState({ currentValue: val })} + /> - Feeling - - this.setState({feeling: val})} - active={this.state.feeling} - /> - - Texture - - this.setState({texture: val})} - active={this.state.texture} - /> - + Feeling + this.setState({ feeling: val })} + active={this.state.feeling} + /> + Texture + this.setState({ texture: val })} + active={this.state.texture} + /> - Exclude + Exclude { this.setState({ exclude: val }) diff --git a/components/cycle-day/symptoms/sex.js b/components/cycle-day/symptoms/sex.js index 1b86293..ddb1831 100644 --- a/components/cycle-day/symptoms/sex.js +++ b/components/cycle-day/symptoms/sex.js @@ -1,6 +1,5 @@ import React, { Component } from 'react' import { - Text, TextInput, View, ScrollView @@ -13,6 +12,7 @@ import { } from '../labels/labels' import ActionButtonFooter from './action-button-footer' import SelectBox from '../select-box' +import { SymptomSectionHeader } from '../../app-text' const sexBoxes = [{ label: activityLabels.solo, @@ -79,22 +79,18 @@ export default class Sex extends Component { return ( - Activity - - {this.makeSelectBoxes(sexBoxes)} - - Contraceptives - - {this.makeSelectBoxes(contraceptiveBoxes)} - { - this.toggleState('other') - this.setState({ focusTextArea: true }) - }} - /> - + Activity + {this.makeSelectBoxes(sexBoxes)} + Contraceptives + {this.makeSelectBoxes(contraceptiveBoxes)} + { + this.toggleState('other') + this.setState({ focusTextArea: true }) + }} + /> {this.state.other && - Temperature (°C) + Temperature (°C) this.setState(val)} @@ -107,7 +107,7 @@ export default class Temp extends Component { /> - Time + Time { @@ -128,9 +128,7 @@ export default class Temp extends Component { }} onCancel={() => this.setState({ isTimePickerVisible: false })} /> - - Note - + Note - Exclude + Exlude { this.setState({ exclude: val }) diff --git a/components/settings.js b/components/settings.js index aac1a65..5e6393f 100644 --- a/components/settings.js +++ b/components/settings.js @@ -4,7 +4,6 @@ import { TouchableOpacity, ScrollView, Alert, - Text, Switch } from 'react-native' import DateTimePicker from 'react-native-modal-datetime-picker-nevo' @@ -23,6 +22,7 @@ import { tempReminderObservable, saveTempReminder } from '../local-storage' +import { AppText } from './app-text' export default class Settings extends Component { constructor(props) { @@ -35,36 +35,36 @@ export default class Settings extends Component { - + {labels.tempScale.segmentTitle} - - {labels.tempScale.segmentExplainer} + + {labels.tempScale.segmentExplainer} - + {labels.export.button} - - {labels.export.segmentExplainer} + + {labels.export.segmentExplainer} - + {labels.export.button} - + - + {labels.import.button} - - {labels.import.segmentExplainer} + + {labels.import.segmentExplainer} - + {labels.import.button} - + @@ -84,15 +84,15 @@ class TempReminderPicker extends Component { style={styles.settingsSegment} onPress={() => this.setState({ isTimePickerVisible: true })} > - + {labels.tempReminder.title} - + {this.state.time && this.state.enabled ? - {labels.tempReminder.timeSet(this.state.time)} + {labels.tempReminder.timeSet(this.state.time)} : - {labels.tempReminder.noTimeSet} + {labels.tempReminder.noTimeSet} } - {`${labels.tempScale.min} ${this.state.min}`} - {`${labels.tempScale.max} ${this.state.max}`} + {`${labels.tempScale.min} ${this.state.min}`} + {`${labels.tempScale.max} ${this.state.max}`} {!atLeastOneCycle && - {labels.emptyStats} + {labels.emptyStats} } {atLeastOneCycle && numberOfCycles === 1 && - + {labels.oneCycleStats(cycleLengths[0])} - + } {atLeastOneCycle && numberOfCycles > 1 && - + {labels.getBasisOfStats(numberOfCycles)} - + - {labels.averageLabel} - {cycleInfo.mean + ' ' + labels.daysLabel} + {labels.averageLabel} + {cycleInfo.mean + ' ' + labels.daysLabel} - {labels.minLabel} - {cycleInfo.minimum + ' ' + labels.daysLabel} + {labels.minLabel} + {cycleInfo.minimum + ' ' + labels.daysLabel} - {labels.maxLabel} - {cycleInfo.maximum + ' ' + labels.daysLabel} + {labels.maxLabel} + {cycleInfo.maximum + ' ' + labels.daysLabel} - {labels.stdLabel} - {cycleInfo.stdDeviation + ' ' + labels.daysLabel} + {labels.stdLabel} + {cycleInfo.stdDeviation + ' ' + labels.daysLabel} } diff --git a/package-lock.json b/package-lock.json index 49c8ac7..1eb8779 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,14 +24,14 @@ "@babel/traverse": "7.0.0-beta.47", "@babel/types": "7.0.0-beta.47", "babylon": "7.0.0-beta.47", - "convert-source-map": "1.5.1", - "debug": "3.1.0", - "json5": "0.5.1", - "lodash": "4.17.10", - "micromatch": "2.3.11", - "resolve": "1.8.1", - "semver": "5.5.0", - "source-map": "0.5.7" + "convert-source-map": "^1.1.0", + "debug": "^3.1.0", + "json5": "^0.5.0", + "lodash": "^4.17.5", + "micromatch": "^2.3.11", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" }, "dependencies": { "babylon": { @@ -55,10 +55,10 @@ "integrity": "sha512-fJP+9X+gqgTTZzTqrKJHwebPwt6S/e/4YuyRyKyWHAIirGgUwjRoZgbFci24wwGYMJW7nlkCSwWG7QvCVsG0eg==", "requires": { "@babel/types": "7.0.0-beta.47", - "jsesc": "2.5.1", - "lodash": "4.17.10", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "jsesc": "^2.5.1", + "lodash": "^4.17.5", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" }, "dependencies": { "jsesc": { @@ -91,7 +91,7 @@ "integrity": "sha512-oBGX/MyT4kNGuINK2k/KLHD77Ih1oTROtoxnV3uAPS9rLYhmZn3W8qy2L4bbyMwQ89nVSM427b0bTTXUEEReXA==", "requires": { "@babel/types": "7.0.0-beta.47", - "esutils": "2.0.2" + "esutils": "^2.0.0" } }, "@babel/helper-call-delegate": { @@ -111,7 +111,7 @@ "requires": { "@babel/helper-function-name": "7.0.0-beta.47", "@babel/types": "7.0.0-beta.47", - "lodash": "4.17.10" + "lodash": "^4.17.5" } }, "@babel/helper-explode-assignable-expression": { @@ -163,7 +163,7 @@ "integrity": "sha512-Rk43Ty+a6npu9znK22IqFlseStRGWxEHi2cjmLbbi63VGiseofdUtIJI65F9MTCuMTXAX7VbY/ghef1Jp5qpvw==", "requires": { "@babel/types": "7.0.0-beta.47", - "lodash": "4.17.10" + "lodash": "^4.17.5" } }, "@babel/helper-module-transforms": { @@ -176,7 +176,7 @@ "@babel/helper-split-export-declaration": "7.0.0-beta.47", "@babel/template": "7.0.0-beta.47", "@babel/types": "7.0.0-beta.47", - "lodash": "4.17.10" + "lodash": "^4.17.5" } }, "@babel/helper-optimise-call-expression": { @@ -197,7 +197,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.0.0-beta.47.tgz", "integrity": "sha512-dafidvVkjJP5AIWkJspV+7RGj1jeNts0qYvlmVzqAGb6BmQzEldJr6ZPzrmlpW/AW1YJGdw7br2yiwvlCRqDvQ==", "requires": { - "lodash": "4.17.10" + "lodash": "^4.17.5" } }, "@babel/helper-remap-async-to-generator": { @@ -230,7 +230,7 @@ "requires": { "@babel/template": "7.0.0-beta.47", "@babel/types": "7.0.0-beta.47", - "lodash": "4.17.10" + "lodash": "^4.17.5" } }, "@babel/helper-split-export-declaration": { @@ -267,9 +267,9 @@ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.47.tgz", "integrity": "sha512-d505K3Hth1eg0b2swfEF7oFMw3J9M8ceFg0s6dhCSxOOF+07WDvJ0HKT/YbK/Jk9wn8Wyr6HIRAUPKJ9Wfv8Rg==", "requires": { - "chalk": "2.4.1", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" }, "dependencies": { "ansi-styles": { @@ -277,7 +277,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { - "color-convert": "1.9.2" + "color-convert": "^1.9.0" } }, "chalk": { @@ -285,9 +285,9 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "js-tokens": { @@ -300,7 +300,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -422,7 +422,7 @@ "integrity": "sha512-V/u3Zdy40KjVQeyYUaQnCGiHQbRNJoc6IEtNDERltuW9vYPHS1n6YGc+EHKi8JVYT4kE6UHOjD+BrbCCV4kjRw==", "requires": { "@babel/helper-plugin-utils": "7.0.0-beta.47", - "lodash": "4.17.10" + "lodash": "^4.17.5" } }, "@babel/plugin-transform-classes": { @@ -437,7 +437,7 @@ "@babel/helper-plugin-utils": "7.0.0-beta.47", "@babel/helper-replace-supers": "7.0.0-beta.47", "@babel/helper-split-export-declaration": "7.0.0-beta.47", - "globals": "11.7.0" + "globals": "^11.1.0" }, "dependencies": { "globals": { @@ -566,7 +566,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0-beta.47.tgz", "integrity": "sha512-JEPIiJyqYRfjOYUTZguLkb2HTwudReqLyOljpOXnJ/1ymwsiof4D6ul611DGlMxJMZJGQ6TBi59iY9GoJ6j4Iw==", "requires": { - "regenerator-transform": "0.12.4" + "regenerator-transform": "^0.12.3" } }, "@babel/plugin-transform-shorthand-properties": { @@ -610,7 +610,7 @@ "requires": { "@babel/helper-plugin-utils": "7.0.0-beta.47", "@babel/helper-regex": "7.0.0-beta.47", - "regexpu-core": "4.2.0" + "regexpu-core": "^4.1.3" } }, "@babel/register": { @@ -619,13 +619,13 @@ "integrity": "sha1-kwv1oT+Z7rIsJ2s0alRYarsB5hE=", "dev": true, "requires": { - "core-js": "2.5.7", - "find-cache-dir": "1.0.0", - "home-or-tmp": "3.0.0", - "lodash": "4.17.10", - "mkdirp": "0.5.1", - "pirates": "4.0.0", - "source-map-support": "0.4.18" + "core-js": "^2.5.7", + "find-cache-dir": "^1.0.0", + "home-or-tmp": "^3.0.0", + "lodash": "^4.17.10", + "mkdirp": "^0.5.1", + "pirates": "^4.0.0", + "source-map-support": "^0.4.2" }, "dependencies": { "core-js": { @@ -646,7 +646,7 @@ "integrity": "sha512-8t5BsXy1LUIjn3WWOlOuFDuKswhQb/tkak641lvBgmPOBUQHXveORtlMCp6OdPV1dtuTaEahKA8VNz6uLfKBtA==", "dev": true, "requires": { - "node-modules-regexp": "1.0.0" + "node-modules-regexp": "^1.0.0" } } } @@ -659,7 +659,7 @@ "@babel/code-frame": "7.0.0-beta.47", "@babel/types": "7.0.0-beta.47", "babylon": "7.0.0-beta.47", - "lodash": "4.17.10" + "lodash": "^4.17.5" }, "dependencies": { "babylon": { @@ -680,10 +680,10 @@ "@babel/helper-split-export-declaration": "7.0.0-beta.47", "@babel/types": "7.0.0-beta.47", "babylon": "7.0.0-beta.47", - "debug": "3.1.0", - "globals": "11.7.0", - "invariant": "2.2.4", - "lodash": "4.17.10" + "debug": "^3.1.0", + "globals": "^11.1.0", + "invariant": "^2.2.0", + "lodash": "^4.17.5" }, "dependencies": { "babylon": { @@ -711,9 +711,9 @@ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.47.tgz", "integrity": "sha512-MOP5pOosg7JETrVGg8OQyzmUmbyoSopT5j2HlblHsto89mPz3cmxzn1IA4UNUmnWKgeticSwfhS+Gdy25IIlBQ==", "requires": { - "esutils": "2.0.2", - "lodash": "4.17.10", - "to-fast-properties": "2.0.0" + "esutils": "^2.0.2", + "lodash": "^4.17.5", + "to-fast-properties": "^2.0.0" }, "dependencies": { "to-fast-properties": { @@ -743,7 +743,7 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "requires": { - "mime-types": "2.1.19", + "mime-types": "~2.1.18", "negotiator": "0.6.1" } }, @@ -759,7 +759,7 @@ "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { - "acorn": "3.3.0" + "acorn": "^3.0.4" }, "dependencies": { "acorn": { @@ -775,8 +775,8 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" } }, "ajv-keywords": { @@ -795,7 +795,7 @@ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", "requires": { - "ansi-wrap": "0.1.0" + "ansi-wrap": "^0.1.0" } }, "ansi-cyan": { @@ -847,8 +847,8 @@ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "requires": { - "micromatch": "3.1.10", - "normalize-path": "2.1.1" + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" }, "dependencies": { "arr-diff": { @@ -866,16 +866,16 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -883,7 +883,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -893,13 +893,13 @@ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -907,7 +907,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -915,7 +915,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "is-accessor-descriptor": { @@ -923,7 +923,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -931,7 +931,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -941,7 +941,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -949,7 +949,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -959,9 +959,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" } }, "kind-of": { @@ -976,8 +976,8 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -985,7 +985,7 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -995,14 +995,14 @@ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -1010,7 +1010,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -1018,7 +1018,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -1028,10 +1028,10 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -1039,7 +1039,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -1049,7 +1049,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -1057,7 +1057,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -1065,9 +1065,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "is-number": { @@ -1075,7 +1075,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -1083,7 +1083,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -1103,19 +1103,19 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } } } @@ -1130,8 +1130,8 @@ "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, "argparse": { @@ -1140,7 +1140,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "arr-diff": { @@ -1148,8 +1148,8 @@ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", "requires": { - "arr-flatten": "1.1.0", - "array-slice": "0.2.3" + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" } }, "arr-flatten": { @@ -1167,7 +1167,7 @@ "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "requires": { - "typical": "2.6.1" + "typical": "^2.6.1" } }, "array-filter": { @@ -1181,8 +1181,8 @@ "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", "dev": true, "requires": { - "define-properties": "1.1.2", - "es-abstract": "1.12.0" + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" } }, "array-map": { @@ -1206,7 +1206,7 @@ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -1241,7 +1241,7 @@ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": "~2.1.0" } }, "assert": { @@ -1273,7 +1273,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "requires": { - "lodash": "4.17.10" + "lodash": "^4.17.10" } }, "async-limiter": { @@ -1306,9 +1306,9 @@ "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" }, "dependencies": { "js-tokens": { @@ -1323,25 +1323,25 @@ "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", "requires": { - "babel-code-frame": "6.26.0", - "babel-generator": "6.26.1", - "babel-helpers": "6.24.1", - "babel-messages": "6.23.0", - "babel-register": "6.26.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "convert-source-map": "1.5.1", - "debug": "2.6.9", - "json5": "0.5.1", - "lodash": "4.17.10", - "minimatch": "3.0.4", - "path-is-absolute": "1.0.1", - "private": "0.1.8", - "slash": "1.0.0", - "source-map": "0.5.7" + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" } }, "babel-eslint": { @@ -1355,7 +1355,7 @@ "@babel/types": "7.0.0-beta.44", "babylon": "7.0.0-beta.44", "eslint-scope": "3.7.1", - "eslint-visitor-keys": "1.0.0" + "eslint-visitor-keys": "^1.0.0" }, "dependencies": { "@babel/code-frame": { @@ -1374,10 +1374,10 @@ "dev": true, "requires": { "@babel/types": "7.0.0-beta.44", - "jsesc": "2.5.1", - "lodash": "4.17.10", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "jsesc": "^2.5.1", + "lodash": "^4.2.0", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" } }, "@babel/helper-function-name": { @@ -1415,9 +1415,9 @@ "integrity": "sha512-Il19yJvy7vMFm8AVAh6OZzaFoAd0hbkeMZiX3P5HGD+z7dyI7RzndHB0dg6Urh/VAFfHtpOIzDUSxmY6coyZWQ==", "dev": true, "requires": { - "chalk": "2.4.1", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" } }, "@babel/template": { @@ -1429,7 +1429,7 @@ "@babel/code-frame": "7.0.0-beta.44", "@babel/types": "7.0.0-beta.44", "babylon": "7.0.0-beta.44", - "lodash": "4.17.10" + "lodash": "^4.2.0" } }, "@babel/traverse": { @@ -1444,10 +1444,10 @@ "@babel/helper-split-export-declaration": "7.0.0-beta.44", "@babel/types": "7.0.0-beta.44", "babylon": "7.0.0-beta.44", - "debug": "3.1.0", - "globals": "11.7.0", - "invariant": "2.2.4", - "lodash": "4.17.10" + "debug": "^3.1.0", + "globals": "^11.1.0", + "invariant": "^2.2.0", + "lodash": "^4.2.0" } }, "@babel/types": { @@ -1456,9 +1456,9 @@ "integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==", "dev": true, "requires": { - "esutils": "2.0.2", - "lodash": "4.17.10", - "to-fast-properties": "2.0.0" + "esutils": "^2.0.2", + "lodash": "^4.2.0", + "to-fast-properties": "^2.0.0" } }, "ansi-styles": { @@ -1467,7 +1467,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.2" + "color-convert": "^1.9.0" } }, "babylon": { @@ -1482,9 +1482,9 @@ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.5.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "debug": { @@ -1502,8 +1502,8 @@ "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", "dev": true, "requires": { - "esrecurse": "4.2.1", - "estraverse": "4.2.0" + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, "globals": { @@ -1530,7 +1530,7 @@ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } }, "to-fast-properties": { @@ -1546,14 +1546,14 @@ "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.10", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" } }, "babel-helper-builder-react-jsx": { @@ -1561,9 +1561,9 @@ "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz", "integrity": "sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "esutils": "2.0.2" + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "esutils": "^2.0.2" } }, "babel-helper-call-delegate": { @@ -1571,10 +1571,10 @@ "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-define-map": { @@ -1582,10 +1582,10 @@ "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.10" + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" } }, "babel-helper-function-name": { @@ -1593,11 +1593,11 @@ "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", "requires": { - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helper-get-function-arity": { @@ -1605,8 +1605,8 @@ "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-hoist-variables": { @@ -1614,8 +1614,8 @@ "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-optimise-call-expression": { @@ -1623,8 +1623,8 @@ "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-helper-regex": { @@ -1632,9 +1632,9 @@ "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.10" + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" } }, "babel-helper-replace-supers": { @@ -1642,12 +1642,12 @@ "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", "requires": { - "babel-helper-optimise-call-expression": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-helpers": { @@ -1655,8 +1655,8 @@ "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-messages": { @@ -1664,7 +1664,7 @@ "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-check-es2015-constants": { @@ -1672,7 +1672,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-external-helpers": { @@ -1680,7 +1680,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz", "integrity": "sha1-IoX0iwK9Xe3oUXXK+MYuhq3M76E=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-syntax-class-properties": { @@ -1713,10 +1713,10 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", "requires": { - "babel-helper-function-name": "6.24.1", - "babel-plugin-syntax-class-properties": "6.13.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-helper-function-name": "^6.24.1", + "babel-plugin-syntax-class-properties": "^6.8.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-plugin-transform-es2015-arrow-functions": { @@ -1724,7 +1724,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-block-scoped-functions": { @@ -1732,7 +1732,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-block-scoping": { @@ -1740,11 +1740,11 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.10" + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" } }, "babel-plugin-transform-es2015-classes": { @@ -1752,15 +1752,15 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", "requires": { - "babel-helper-define-map": "6.26.0", - "babel-helper-function-name": "6.24.1", - "babel-helper-optimise-call-expression": "6.24.1", - "babel-helper-replace-supers": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-computed-properties": { @@ -1768,8 +1768,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-plugin-transform-es2015-destructuring": { @@ -1777,7 +1777,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-for-of": { @@ -1785,7 +1785,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-function-name": { @@ -1793,9 +1793,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-literals": { @@ -1803,7 +1803,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-modules-commonjs": { @@ -1811,10 +1811,10 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", "requires": { - "babel-plugin-transform-strict-mode": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-types": "6.26.0" + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" } }, "babel-plugin-transform-es2015-object-super": { @@ -1822,8 +1822,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", "requires": { - "babel-helper-replace-supers": "6.24.1", - "babel-runtime": "6.26.0" + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-parameters": { @@ -1831,12 +1831,12 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", "requires": { - "babel-helper-call-delegate": "6.24.1", - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-shorthand-properties": { @@ -1844,8 +1844,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-spread": { @@ -1853,7 +1853,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-sticky-regex": { @@ -1861,9 +1861,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-plugin-transform-es2015-template-literals": { @@ -1871,7 +1871,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es2015-unicode-regex": { @@ -1879,9 +1879,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "regexpu-core": "2.0.0" + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" }, "dependencies": { "jsesc": { @@ -1894,9 +1894,9 @@ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", "requires": { - "regenerate": "1.4.0", - "regjsgen": "0.2.0", - "regjsparser": "0.1.5" + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" } }, "regjsgen": { @@ -1909,7 +1909,7 @@ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "requires": { - "jsesc": "0.5.0" + "jsesc": "~0.5.0" } } } @@ -1919,7 +1919,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es3-member-expression-literals/-/babel-plugin-transform-es3-member-expression-literals-6.22.0.tgz", "integrity": "sha1-cz00RPPsxBvvjtGmpOCWV7iWnrs=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-es3-property-literals": { @@ -1927,7 +1927,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es3-property-literals/-/babel-plugin-transform-es3-property-literals-6.22.0.tgz", "integrity": "sha1-sgeNWELiKr9A9z6M3pzTcRq9V1g=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-flow-strip-types": { @@ -1935,8 +1935,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", "requires": { - "babel-plugin-syntax-flow": "6.18.0", - "babel-runtime": "6.26.0" + "babel-plugin-syntax-flow": "^6.18.0", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-object-rest-spread": { @@ -1944,8 +1944,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", "requires": { - "babel-plugin-syntax-object-rest-spread": "6.13.0", - "babel-runtime": "6.26.0" + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-runtime": "^6.26.0" } }, "babel-plugin-transform-react-display-name": { @@ -1953,7 +1953,7 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz", "integrity": "sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-react-jsx": { @@ -1961,9 +1961,9 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", "integrity": "sha1-hAoCjn30YN/DotKfDA2R9jduZqM=", "requires": { - "babel-helper-builder-react-jsx": "6.26.0", - "babel-plugin-syntax-jsx": "6.18.0", - "babel-runtime": "6.26.0" + "babel-helper-builder-react-jsx": "^6.24.1", + "babel-plugin-syntax-jsx": "^6.8.0", + "babel-runtime": "^6.22.0" } }, "babel-plugin-transform-strict-mode": { @@ -1971,8 +1971,8 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, "babel-preset-es2015-node": { @@ -1980,15 +1980,15 @@ "resolved": "https://registry.npmjs.org/babel-preset-es2015-node/-/babel-preset-es2015-node-6.1.1.tgz", "integrity": "sha1-YLIxVwJLDP6/OmNVTLBe4DW05V8=", "requires": { - "babel-plugin-transform-es2015-destructuring": "6.23.0", - "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", - "babel-plugin-transform-es2015-parameters": "6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", - "babel-plugin-transform-es2015-spread": "6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "6.24.1", - "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "semver": "5.5.0" + "babel-plugin-transform-es2015-destructuring": "6.x", + "babel-plugin-transform-es2015-function-name": "6.x", + "babel-plugin-transform-es2015-modules-commonjs": "6.x", + "babel-plugin-transform-es2015-parameters": "6.x", + "babel-plugin-transform-es2015-shorthand-properties": "6.x", + "babel-plugin-transform-es2015-spread": "6.x", + "babel-plugin-transform-es2015-sticky-regex": "6.x", + "babel-plugin-transform-es2015-unicode-regex": "6.x", + "semver": "5.x" } }, "babel-preset-fbjs": { @@ -1996,34 +1996,34 @@ "resolved": "https://registry.npmjs.org/babel-preset-fbjs/-/babel-preset-fbjs-2.2.0.tgz", "integrity": "sha512-jj0KFJDioYZMtPtZf77dQuU+Ad/1BtN0UnAYlHDa8J8f4tGXr3YrPoJImD5MdueaOPeN/jUdrCgu330EfXr0XQ==", "requires": { - "babel-plugin-check-es2015-constants": "6.22.0", - "babel-plugin-syntax-class-properties": "6.13.0", - "babel-plugin-syntax-flow": "6.18.0", - "babel-plugin-syntax-jsx": "6.18.0", - "babel-plugin-syntax-object-rest-spread": "6.13.0", - "babel-plugin-syntax-trailing-function-commas": "6.22.0", - "babel-plugin-transform-class-properties": "6.24.1", - "babel-plugin-transform-es2015-arrow-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoping": "6.26.0", - "babel-plugin-transform-es2015-classes": "6.24.1", - "babel-plugin-transform-es2015-computed-properties": "6.24.1", - "babel-plugin-transform-es2015-destructuring": "6.23.0", - "babel-plugin-transform-es2015-for-of": "6.23.0", - "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-literals": "6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", - "babel-plugin-transform-es2015-object-super": "6.24.1", - "babel-plugin-transform-es2015-parameters": "6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", - "babel-plugin-transform-es2015-spread": "6.22.0", - "babel-plugin-transform-es2015-template-literals": "6.22.0", - "babel-plugin-transform-es3-member-expression-literals": "6.22.0", - "babel-plugin-transform-es3-property-literals": "6.22.0", - "babel-plugin-transform-flow-strip-types": "6.22.0", - "babel-plugin-transform-object-rest-spread": "6.26.0", - "babel-plugin-transform-react-display-name": "6.25.0", - "babel-plugin-transform-react-jsx": "6.24.1" + "babel-plugin-check-es2015-constants": "^6.8.0", + "babel-plugin-syntax-class-properties": "^6.8.0", + "babel-plugin-syntax-flow": "^6.8.0", + "babel-plugin-syntax-jsx": "^6.8.0", + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-plugin-syntax-trailing-function-commas": "^6.8.0", + "babel-plugin-transform-class-properties": "^6.8.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.8.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.8.0", + "babel-plugin-transform-es2015-block-scoping": "^6.8.0", + "babel-plugin-transform-es2015-classes": "^6.8.0", + "babel-plugin-transform-es2015-computed-properties": "^6.8.0", + "babel-plugin-transform-es2015-destructuring": "^6.8.0", + "babel-plugin-transform-es2015-for-of": "^6.8.0", + "babel-plugin-transform-es2015-function-name": "^6.8.0", + "babel-plugin-transform-es2015-literals": "^6.8.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.8.0", + "babel-plugin-transform-es2015-object-super": "^6.8.0", + "babel-plugin-transform-es2015-parameters": "^6.8.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.8.0", + "babel-plugin-transform-es2015-spread": "^6.8.0", + "babel-plugin-transform-es2015-template-literals": "^6.8.0", + "babel-plugin-transform-es3-member-expression-literals": "^6.8.0", + "babel-plugin-transform-es3-property-literals": "^6.8.0", + "babel-plugin-transform-flow-strip-types": "^6.8.0", + "babel-plugin-transform-object-rest-spread": "^6.8.0", + "babel-plugin-transform-react-display-name": "^6.8.0", + "babel-plugin-transform-react-jsx": "^6.8.0" } }, "babel-preset-react-native": { @@ -2057,7 +2057,7 @@ "@babel/plugin-transform-template-literals": "7.0.0-beta.47", "@babel/plugin-transform-unicode-regex": "7.0.0-beta.47", "@babel/template": "7.0.0-beta.47", - "metro-babel7-plugin-react-transform": "0.39.1" + "metro-babel7-plugin-react-transform": "^0.39.1" }, "dependencies": { "metro-babel7-plugin-react-transform": { @@ -2066,7 +2066,7 @@ "integrity": "sha512-7atigK+8EZ1DAWhpcw2a60OhCPihe9TsRHGOKUUwJjXmXDxmYxoxejh1kK5vJSaW38P45PkUBwnfNwISWFv4mQ==", "requires": { "@babel/helper-module-imports": "7.0.0-beta.47", - "lodash": "4.17.10" + "lodash": "^4.17.5" } } } @@ -2076,13 +2076,13 @@ "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "requires": { - "babel-core": "6.26.3", - "babel-runtime": "6.26.0", - "core-js": "2.5.7", - "home-or-tmp": "2.0.0", - "lodash": "4.17.10", - "mkdirp": "0.5.1", - "source-map-support": "0.4.18" + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" }, "dependencies": { "core-js": { @@ -2097,8 +2097,8 @@ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "requires": { - "core-js": "2.5.7", - "regenerator-runtime": "0.11.1" + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" }, "dependencies": { "core-js": { @@ -2113,11 +2113,11 @@ "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "lodash": "4.17.10" + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" } }, "babel-traverse": { @@ -2125,15 +2125,15 @@ "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "requires": { - "babel-code-frame": "6.26.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "debug": "2.6.9", - "globals": "9.18.0", - "invariant": "2.2.4", - "lodash": "4.17.10" + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" } }, "babel-types": { @@ -2141,10 +2141,10 @@ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "requires": { - "babel-runtime": "6.26.0", - "esutils": "2.0.2", - "lodash": "4.17.10", - "to-fast-properties": "1.0.3" + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" } }, "babylon": { @@ -2162,13 +2162,13 @@ "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { "define-property": { @@ -2176,7 +2176,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -2184,7 +2184,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -2192,7 +2192,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -2200,9 +2200,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "isobject": { @@ -2248,7 +2248,7 @@ "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "big-integer": { @@ -2261,8 +2261,8 @@ "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "requires": { - "readable-stream": "2.3.6", - "safe-buffer": "5.1.2" + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" } }, "block-stream": { @@ -2270,7 +2270,7 @@ "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "requires": { - "inherits": "2.0.1" + "inherits": "~2.0.0" } }, "bluebird": { @@ -2283,7 +2283,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "bplist-creator": { @@ -2291,7 +2291,7 @@ "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.7.tgz", "integrity": "sha1-N98VNgkoJLh8QvlXsBNEEXNyrkU=", "requires": { - "stream-buffers": "2.2.0" + "stream-buffers": "~2.2.0" } }, "bplist-parser": { @@ -2299,7 +2299,7 @@ "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz", "integrity": "sha1-1g1dzCDLptx+HymbNdPh+V2vuuY=", "requires": { - "big-integer": "1.6.34" + "big-integer": "^1.6.7" } }, "brace-expansion": { @@ -2307,7 +2307,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -2316,9 +2316,9 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "browser-stdout": { @@ -2332,7 +2332,7 @@ "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", "requires": { - "node-int64": "0.4.0" + "node-int64": "^0.4.0" } }, "buffer": { @@ -2341,8 +2341,8 @@ "integrity": "sha1-pyyTb3e5a/UvX357RnGAYoVR3vs=", "requires": { "base64-js": "0.0.8", - "ieee754": "1.1.12", - "isarray": "1.0.0" + "ieee754": "^1.1.4", + "isarray": "^1.0.0" }, "dependencies": { "base64-js": { @@ -2357,8 +2357,8 @@ "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", "requires": { - "buffer-alloc-unsafe": "1.1.0", - "buffer-fill": "1.0.0" + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" } }, "buffer-alloc-unsafe": { @@ -2396,15 +2396,15 @@ "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" }, "dependencies": { "isobject": { @@ -2420,7 +2420,7 @@ "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, "requires": { - "callsites": "0.2.0" + "callsites": "^0.2.0" } }, "callsites": { @@ -2439,7 +2439,7 @@ "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz", "integrity": "sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28=", "requires": { - "rsvp": "3.6.2" + "rsvp": "^3.3.3" } }, "caseless": { @@ -2453,12 +2453,12 @@ "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", "dev": true, "requires": { - "assertion-error": "1.1.0", - "check-error": "1.0.2", - "deep-eql": "3.0.1", - "get-func-name": "2.0.0", - "pathval": "1.1.0", - "type-detect": "4.0.8" + "assertion-error": "^1.0.1", + "check-error": "^1.0.1", + "deep-eql": "^3.0.0", + "get-func-name": "^2.0.0", + "pathval": "^1.0.0", + "type-detect": "^4.0.0" } }, "chalk": { @@ -2466,11 +2466,11 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "chardet": { @@ -2500,10 +2500,10 @@ "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "arr-union": { @@ -2516,7 +2516,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "isobject": { @@ -2531,7 +2531,7 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "requires": { - "restore-cursor": "2.0.0" + "restore-cursor": "^2.0.0" } }, "cli-width": { @@ -2544,9 +2544,9 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" }, "dependencies": { "is-fullwidth-code-point": { @@ -2554,7 +2554,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "string-width": { @@ -2562,9 +2562,9 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } } } @@ -2584,8 +2584,8 @@ "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, "color-convert": { @@ -2611,7 +2611,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "command-line-args": { @@ -2619,9 +2619,9 @@ "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-4.0.7.tgz", "integrity": "sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA==", "requires": { - "array-back": "2.0.0", - "find-replace": "1.0.3", - "typical": "2.6.1" + "array-back": "^2.0.0", + "find-replace": "^1.0.3", + "typical": "^2.6.1" } }, "commander": { @@ -2644,7 +2644,7 @@ "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.14.tgz", "integrity": "sha1-MmxfUH+7BV9UEWeCuWmoG2einac=", "requires": { - "mime-db": "1.35.0" + "mime-db": ">= 1.34.0 < 2" } }, "compression": { @@ -2652,13 +2652,13 @@ "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", "requires": { - "accepts": "1.3.5", + "accepts": "~1.3.5", "bytes": "3.0.0", - "compressible": "2.0.14", + "compressible": "~2.0.14", "debug": "2.6.9", - "on-headers": "1.0.1", + "on-headers": "~1.0.1", "safe-buffer": "5.1.2", - "vary": "1.1.2" + "vary": "~1.1.2" } }, "concat-map": { @@ -2671,10 +2671,10 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "requires": { - "buffer-from": "1.1.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" }, "dependencies": { "inherits": { @@ -2691,7 +2691,7 @@ "requires": { "debug": "2.6.9", "finalhandler": "1.1.0", - "parseurl": "1.3.2", + "parseurl": "~1.3.2", "utils-merge": "1.0.1" } }, @@ -2725,9 +2725,9 @@ "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.3.tgz", "integrity": "sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==", "requires": { - "fbjs": "0.8.17", - "loose-envify": "1.4.0", - "object-assign": "4.1.1" + "fbjs": "^0.8.9", + "loose-envify": "^1.3.1", + "object-assign": "^4.1.1" } }, "create-react-context": { @@ -2735,8 +2735,8 @@ "resolved": "https://registry.npmjs.org/create-react-context/-/create-react-context-0.2.2.tgz", "integrity": "sha512-KkpaLARMhsTsgp0d2NA/R94F/eDLbhXERdIq3LvX2biCAXcDvHYoOqHfWCHf1+OLj+HKBotLG3KqaOOf+C1C+A==", "requires": { - "fbjs": "0.8.17", - "gud": "1.0.0" + "fbjs": "^0.8.0", + "gud": "^1.0.0" } }, "cross-spawn": { @@ -2744,9 +2744,9 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "requires": { - "lru-cache": "4.1.3", - "shebang-command": "1.2.0", - "which": "1.3.1" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "cryptiles": { @@ -2754,7 +2754,7 @@ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "requires": { - "boom": "2.10.1" + "boom": "2.x.x" } }, "csvtojson": { @@ -2762,9 +2762,9 @@ "resolved": "https://registry.npmjs.org/csvtojson/-/csvtojson-2.0.8.tgz", "integrity": "sha512-DC6YFtsJiA7t/Yz+KjzT6GXuKtU/5gRbbl7HJqvDVVir+dxdw2/1EgwfgJdnsvUT7lOnON5DvGftKuYWX1nMOQ==", "requires": { - "bluebird": "3.5.1", - "lodash": "4.17.10", - "strip-bom": "2.0.0" + "bluebird": "^3.5.1", + "lodash": "^4.17.3", + "strip-bom": "^2.0.0" }, "dependencies": { "strip-bom": { @@ -2772,7 +2772,7 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } } } @@ -2782,7 +2782,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -2820,14 +2820,14 @@ "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz", "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", "requires": { - "decompress-tar": "4.1.1", - "decompress-tarbz2": "4.1.1", - "decompress-targz": "4.1.1", - "decompress-unzip": "4.0.1", - "graceful-fs": "4.1.11", - "make-dir": "1.3.0", - "pify": "2.3.0", - "strip-dirs": "2.1.0" + "decompress-tar": "^4.0.0", + "decompress-tarbz2": "^4.0.0", + "decompress-targz": "^4.0.0", + "decompress-unzip": "^4.0.1", + "graceful-fs": "^4.1.10", + "make-dir": "^1.0.0", + "pify": "^2.3.0", + "strip-dirs": "^2.0.0" }, "dependencies": { "pify": { @@ -2842,9 +2842,9 @@ "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "requires": { - "file-type": "5.2.0", - "is-stream": "1.1.0", - "tar-stream": "1.6.1" + "file-type": "^5.2.0", + "is-stream": "^1.1.0", + "tar-stream": "^1.5.2" } }, "decompress-tarbz2": { @@ -2852,11 +2852,11 @@ "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", "requires": { - "decompress-tar": "4.1.1", - "file-type": "6.2.0", - "is-stream": "1.1.0", - "seek-bzip": "1.0.5", - "unbzip2-stream": "1.2.5" + "decompress-tar": "^4.1.0", + "file-type": "^6.1.0", + "is-stream": "^1.1.0", + "seek-bzip": "^1.0.5", + "unbzip2-stream": "^1.0.9" }, "dependencies": { "file-type": { @@ -2871,9 +2871,9 @@ "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", "requires": { - "decompress-tar": "4.1.1", - "file-type": "5.2.0", - "is-stream": "1.1.0" + "decompress-tar": "^4.1.1", + "file-type": "^5.2.0", + "is-stream": "^1.1.0" } }, "decompress-unzip": { @@ -2881,10 +2881,10 @@ "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", "requires": { - "file-type": "3.9.0", - "get-stream": "2.3.1", - "pify": "2.3.0", - "yauzl": "2.10.0" + "file-type": "^3.8.0", + "get-stream": "^2.2.0", + "pify": "^2.3.0", + "yauzl": "^2.4.2" }, "dependencies": { "file-type": { @@ -2897,8 +2897,8 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", "requires": { - "object-assign": "4.1.1", - "pinkie-promise": "2.0.1" + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" } }, "pify": { @@ -2914,7 +2914,7 @@ "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "dev": true, "requires": { - "type-detect": "4.0.8" + "type-detect": "^4.0.0" } }, "deep-extend": { @@ -2939,8 +2939,8 @@ "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", "dev": true, "requires": { - "foreach": "2.0.5", - "object-keys": "1.0.12" + "foreach": "^2.0.5", + "object-keys": "^1.0.8" } }, "define-property": { @@ -2948,8 +2948,8 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" }, "dependencies": { "is-accessor-descriptor": { @@ -2957,7 +2957,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -2965,7 +2965,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -2973,9 +2973,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "isobject": { @@ -2996,13 +2996,13 @@ "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "dev": true, "requires": { - "globby": "5.0.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.1", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "rimraf": "2.6.2" + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" }, "dependencies": { "pify": { @@ -3043,7 +3043,7 @@ "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, "detect-libc": { @@ -3074,7 +3074,7 @@ "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { - "esutils": "2.0.2" + "esutils": "^2.0.2" } }, "dom-walk": { @@ -3088,8 +3088,8 @@ "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "optional": true, "requires": { - "jsbn": "0.1.1", - "safer-buffer": "2.1.2" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "ee-first": { @@ -3107,7 +3107,7 @@ "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", "requires": { - "iconv-lite": "0.4.23" + "iconv-lite": "~0.4.13" } }, "end-of-stream": { @@ -3115,7 +3115,7 @@ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "envinfo": { @@ -3128,7 +3128,7 @@ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "errorhandler": { @@ -3136,8 +3136,8 @@ "resolved": "https://registry.npmjs.org/errorhandler/-/errorhandler-1.5.0.tgz", "integrity": "sha1-6rpkyl1UKjEayUX1gt78M2Fl2fQ=", "requires": { - "accepts": "1.3.5", - "escape-html": "1.0.3" + "accepts": "~1.3.3", + "escape-html": "~1.0.3" } }, "es-abstract": { @@ -3146,11 +3146,11 @@ "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", "dev": true, "requires": { - "es-to-primitive": "1.1.1", - "function-bind": "1.1.1", - "has": "1.0.3", - "is-callable": "1.1.4", - "is-regex": "1.0.4" + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" } }, "es-to-primitive": { @@ -3159,9 +3159,9 @@ "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", "dev": true, "requires": { - "is-callable": "1.1.4", - "is-date-object": "1.0.1", - "is-symbol": "1.0.1" + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" } }, "escape-html": { @@ -3180,44 +3180,44 @@ "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { - "ajv": "5.5.2", - "babel-code-frame": "6.26.0", - "chalk": "2.4.1", - "concat-stream": "1.6.2", - "cross-spawn": "5.1.0", - "debug": "3.1.0", - "doctrine": "2.1.0", - "eslint-scope": "3.7.3", - "eslint-visitor-keys": "1.0.0", - "espree": "3.5.4", - "esquery": "1.0.1", - "esutils": "2.0.2", - "file-entry-cache": "2.0.0", - "functional-red-black-tree": "1.0.1", - "glob": "7.1.2", - "globals": "11.7.0", - "ignore": "3.3.10", - "imurmurhash": "0.1.4", - "inquirer": "3.3.0", - "is-resolvable": "1.1.0", - "js-yaml": "3.12.0", - "json-stable-stringify-without-jsonify": "1.0.1", - "levn": "0.3.0", - "lodash": "4.17.10", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "optionator": "0.8.2", - "path-is-inside": "1.0.2", - "pluralize": "7.0.0", - "progress": "2.0.0", - "regexpp": "1.1.0", - "require-uncached": "1.0.3", - "semver": "5.5.0", - "strip-ansi": "4.0.0", - "strip-json-comments": "2.0.1", + "ajv": "^5.3.0", + "babel-code-frame": "^6.22.0", + "chalk": "^2.1.0", + "concat-stream": "^1.6.0", + "cross-spawn": "^5.1.0", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^3.7.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^3.5.4", + "esquery": "^1.0.0", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.0.1", + "ignore": "^3.3.3", + "imurmurhash": "^0.1.4", + "inquirer": "^3.0.6", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.9.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.4", + "minimatch": "^3.0.2", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^1.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.3.0", + "strip-ansi": "^4.0.0", + "strip-json-comments": "~2.0.1", "table": "4.0.2", - "text-table": "0.2.0" + "text-table": "~0.2.0" }, "dependencies": { "ajv": { @@ -3226,10 +3226,10 @@ "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "ansi-regex": { @@ -3244,7 +3244,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.2" + "color-convert": "^1.9.0" } }, "chalk": { @@ -3253,9 +3253,9 @@ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "debug": { @@ -3279,7 +3279,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "supports-color": { @@ -3288,7 +3288,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -3299,10 +3299,10 @@ "integrity": "sha512-18rzWn4AtbSUxFKKM7aCVcj5LXOhOKdwBino3KKWy4psxfPW0YtIbE8WNRDUdyHFL50BeLb6qFd4vpvNYyp7hw==", "dev": true, "requires": { - "doctrine": "2.1.0", - "has": "1.0.3", - "jsx-ast-utils": "2.0.1", - "prop-types": "15.6.2" + "doctrine": "^2.1.0", + "has": "^1.0.3", + "jsx-ast-utils": "^2.0.1", + "prop-types": "^15.6.2" } }, "eslint-scope": { @@ -3311,8 +3311,8 @@ "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", "dev": true, "requires": { - "esrecurse": "4.2.1", - "estraverse": "4.2.0" + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, "eslint-visitor-keys": { @@ -3327,8 +3327,8 @@ "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { - "acorn": "5.7.1", - "acorn-jsx": "3.0.1" + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" } }, "esprima": { @@ -3343,7 +3343,7 @@ "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.0.0" } }, "esrecurse": { @@ -3352,7 +3352,7 @@ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.1.0" } }, "estraverse": { @@ -3386,7 +3386,7 @@ "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz", "integrity": "sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw==", "requires": { - "merge": "1.2.0" + "merge": "^1.2.0" } }, "execa": { @@ -3394,13 +3394,13 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "expand-brackets": { @@ -3408,7 +3408,7 @@ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "expand-range": { @@ -3416,7 +3416,7 @@ "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "requires": { - "fill-range": "2.2.4" + "fill-range": "^2.1.0" } }, "extend": { @@ -3429,7 +3429,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", "requires": { - "kind-of": "1.1.0" + "kind-of": "^1.1.0" } }, "external-editor": { @@ -3437,9 +3437,9 @@ "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "requires": { - "chardet": "0.4.2", - "iconv-lite": "0.4.23", - "tmp": "0.0.33" + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" } }, "extglob": { @@ -3447,7 +3447,7 @@ "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "extsprintf": { @@ -3460,9 +3460,9 @@ "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz", "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", "requires": { - "ansi-gray": "0.1.1", - "color-support": "1.1.3", - "time-stamp": "1.1.0" + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "time-stamp": "^1.0.0" } }, "fast-deep-equal": { @@ -3486,7 +3486,7 @@ "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", "requires": { - "bser": "2.0.0" + "bser": "^2.0.0" } }, "fbjs": { @@ -3494,13 +3494,13 @@ "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.17.tgz", "integrity": "sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=", "requires": { - "core-js": "1.2.7", - "isomorphic-fetch": "2.2.1", - "loose-envify": "1.4.0", - "object-assign": "4.1.1", - "promise": "7.3.1", - "setimmediate": "1.0.5", - "ua-parser-js": "0.7.18" + "core-js": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.18" } }, "fbjs-scripts": { @@ -3508,16 +3508,16 @@ "resolved": "https://registry.npmjs.org/fbjs-scripts/-/fbjs-scripts-0.8.3.tgz", "integrity": "sha512-aUJ/uEzMIiBYuj/blLp4sVNkQQ7ZEB/lyplG1IzzOmZ83meiWecrGg5jBo4wWrxXmO4RExdtsSV1QkTjPt2Gag==", "requires": { - "ansi-colors": "1.1.0", - "babel-core": "6.26.3", - "babel-preset-fbjs": "2.2.0", - "core-js": "2.5.7", - "cross-spawn": "5.1.0", - "fancy-log": "1.3.2", - "object-assign": "4.1.1", - "plugin-error": "0.1.2", - "semver": "5.5.0", - "through2": "2.0.3" + "ansi-colors": "^1.0.1", + "babel-core": "^6.7.2", + "babel-preset-fbjs": "^2.1.2", + "core-js": "^2.4.1", + "cross-spawn": "^5.1.0", + "fancy-log": "^1.3.2", + "object-assign": "^4.0.1", + "plugin-error": "^0.1.2", + "semver": "^5.1.0", + "through2": "^2.0.0" }, "dependencies": { "core-js": { @@ -3532,7 +3532,7 @@ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "requires": { - "pend": "1.2.0" + "pend": "~1.2.0" } }, "figures": { @@ -3540,7 +3540,7 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "requires": { - "escape-string-regexp": "1.0.5" + "escape-string-regexp": "^1.0.5" } }, "file-entry-cache": { @@ -3549,8 +3549,8 @@ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "1.3.0", - "object-assign": "4.1.1" + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" } }, "file-type": { @@ -3568,11 +3568,11 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "3.0.0", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" }, "dependencies": { "isobject": { @@ -3591,12 +3591,12 @@ "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", "requires": { "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.3.1", - "unpipe": "1.0.0" + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.3.1", + "unpipe": "~1.0.0" } }, "find-cache-dir": { @@ -3604,9 +3604,9 @@ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", "requires": { - "commondir": "1.0.1", - "make-dir": "1.3.0", - "pkg-dir": "2.0.0" + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" } }, "find-replace": { @@ -3614,8 +3614,8 @@ "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz", "integrity": "sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A=", "requires": { - "array-back": "1.0.4", - "test-value": "2.1.0" + "array-back": "^1.0.4", + "test-value": "^2.1.0" }, "dependencies": { "array-back": { @@ -3623,7 +3623,7 @@ "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", "requires": { - "typical": "2.6.1" + "typical": "^2.6.0" } } } @@ -3633,7 +3633,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "flat-cache": { @@ -3642,10 +3642,10 @@ "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { - "circular-json": "0.3.3", - "del": "2.2.2", - "graceful-fs": "4.1.11", - "write": "0.2.1" + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" } }, "for-in": { @@ -3658,7 +3658,7 @@ "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, "foreach": { @@ -3677,9 +3677,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.19" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" } }, "fragment-cache": { @@ -3687,7 +3687,7 @@ "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "requires": { - "map-cache": "0.2.2" + "map-cache": "^0.2.2" } }, "fresh": { @@ -3705,9 +3705,9 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0", - "klaw": "1.3.1" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0" } }, "fs.realpath": { @@ -4182,10 +4182,10 @@ "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.1", - "mkdirp": "0.5.1", - "rimraf": "2.6.2" + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" } }, "fstream-ignore": { @@ -4193,9 +4193,9 @@ "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", "requires": { - "fstream": "1.0.11", - "inherits": "2.0.1", - "minimatch": "3.0.4" + "fstream": "^1.0.0", + "inherits": "2", + "minimatch": "^3.0.0" } }, "function-bind": { @@ -4215,11 +4215,11 @@ "resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", "requires": { - "ansi": "0.3.1", - "has-unicode": "2.0.1", - "lodash.pad": "4.5.1", - "lodash.padend": "4.6.1", - "lodash.padstart": "4.6.1" + "ansi": "^0.3.0", + "has-unicode": "^2.0.0", + "lodash.pad": "^4.1.0", + "lodash.padend": "^4.1.0", + "lodash.padstart": "^4.1.0" } }, "get-caller-file": { @@ -4248,7 +4248,7 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -4263,12 +4263,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-base": { @@ -4276,8 +4276,8 @@ "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" } }, "glob-parent": { @@ -4285,7 +4285,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "requires": { - "is-glob": "2.0.1" + "is-glob": "^2.0.0" } }, "global": { @@ -4293,8 +4293,8 @@ "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", "requires": { - "min-document": "2.19.0", - "process": "0.5.2" + "min-document": "^2.19.0", + "process": "~0.5.1" } }, "globals": { @@ -4308,12 +4308,12 @@ "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { - "array-union": "1.0.2", - "arrify": "1.0.1", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "dependencies": { "pify": { @@ -4360,8 +4360,8 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" + "ajv": "^4.9.1", + "har-schema": "^1.0.5" } }, "has": { @@ -4370,7 +4370,7 @@ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "function-bind": "1.1.1" + "function-bind": "^1.1.1" } }, "has-ansi": { @@ -4378,7 +4378,7 @@ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-flag": { @@ -4396,9 +4396,9 @@ "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" }, "dependencies": { "isobject": { @@ -4413,8 +4413,8 @@ "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "is-number": { @@ -4422,7 +4422,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -4430,7 +4430,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -4440,7 +4440,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -4450,10 +4450,10 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" } }, "he": { @@ -4477,8 +4477,8 @@ "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" } }, "hosted-git-info": { @@ -4491,9 +4491,9 @@ "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-2.5.1.tgz", "integrity": "sha1-jORHvbW2xXf4pj4/p4BW7Eu02/s=", "requires": { - "caseless": "0.11.0", - "concat-stream": "1.6.2", - "http-response-object": "1.1.0" + "caseless": "~0.11.0", + "concat-stream": "^1.4.6", + "http-response-object": "^1.0.0" }, "dependencies": { "caseless": { @@ -4508,10 +4508,10 @@ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { - "depd": "1.1.2", + "depd": "~1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.0", - "statuses": "1.5.0" + "statuses": ">= 1.4.0 < 2" }, "dependencies": { "inherits": { @@ -4536,9 +4536,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.1", - "sshpk": "1.14.2" + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "iconv-lite": { @@ -4546,7 +4546,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": ">= 2.1.2 < 3" } }, "ieee754": { @@ -4575,8 +4575,8 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -4594,20 +4594,20 @@ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "requires": { - "ansi-escapes": "3.1.0", - "chalk": "2.4.1", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "2.2.0", - "figures": "2.0.0", - "lodash": "4.17.10", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rx-lite": "4.0.8", - "rx-lite-aggregates": "4.0.8", - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "through": "2.3.8" + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" }, "dependencies": { "ansi-regex": { @@ -4620,7 +4620,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { - "color-convert": "1.9.2" + "color-convert": "^1.9.0" } }, "chalk": { @@ -4628,9 +4628,9 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "strip-ansi": { @@ -4638,7 +4638,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "supports-color": { @@ -4646,7 +4646,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -4656,7 +4656,7 @@ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "requires": { - "loose-envify": "1.4.0" + "loose-envify": "^1.0.0" } }, "invert-kv": { @@ -4669,7 +4669,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -4677,7 +4677,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -4697,7 +4697,7 @@ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, "is-callable": { @@ -4711,7 +4711,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -4719,7 +4719,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -4735,9 +4735,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "dependencies": { "kind-of": { @@ -4757,7 +4757,7 @@ "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", "requires": { - "is-primitive": "2.0.0" + "is-primitive": "^2.0.0" } }, "is-extendable": { @@ -4775,7 +4775,7 @@ "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-fullwidth-code-point": { @@ -4788,7 +4788,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-natural-number": { @@ -4801,7 +4801,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -4809,7 +4809,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -4826,7 +4826,7 @@ "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { - "is-path-inside": "1.0.1" + "is-path-inside": "^1.0.0" } }, "is-path-inside": { @@ -4835,7 +4835,7 @@ "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { - "path-is-inside": "1.0.2" + "path-is-inside": "^1.0.1" } }, "is-plain-object": { @@ -4843,7 +4843,7 @@ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" }, "dependencies": { "isobject": { @@ -4874,7 +4874,7 @@ "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { - "has": "1.0.3" + "has": "^1.0.1" } }, "is-resolvable": { @@ -4929,8 +4929,8 @@ "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", "requires": { - "node-fetch": "1.7.3", - "whatwg-fetch": "2.0.4" + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" } }, "isstream": { @@ -4943,7 +4943,7 @@ "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-23.0.1.tgz", "integrity": "sha1-3t3RgzO+XcJBUmCgTvP86SdrVyU=", "requires": { - "detect-newline": "2.1.0" + "detect-newline": "^2.1.0" } }, "jest-haste-map": { @@ -4951,13 +4951,13 @@ "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-23.1.0.tgz", "integrity": "sha1-GObH1ajScTb5G32YUvhd4McHTEk=", "requires": { - "fb-watchman": "2.0.0", - "graceful-fs": "4.1.11", - "jest-docblock": "23.0.1", - "jest-serializer": "23.0.1", - "jest-worker": "23.0.1", - "micromatch": "2.3.11", - "sane": "2.5.2" + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.1.11", + "jest-docblock": "^23.0.1", + "jest-serializer": "^23.0.1", + "jest-worker": "^23.0.1", + "micromatch": "^2.3.11", + "sane": "^2.0.0" } }, "jest-serializer": { @@ -4970,7 +4970,7 @@ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-23.0.1.tgz", "integrity": "sha1-nmSd2WP/QEYCb5HEAX8Dmmqkp7w=", "requires": { - "merge-stream": "1.0.1" + "merge-stream": "^1.0.1" } }, "js-base64": { @@ -4994,8 +4994,8 @@ "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "jsbn": { @@ -5024,7 +5024,7 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "json-stable-stringify-without-jsonify": { @@ -5048,7 +5048,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } }, "jsonify": { @@ -5080,7 +5080,7 @@ "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", "dev": true, "requires": { - "array-includes": "3.0.3" + "array-includes": "^3.0.3" } }, "kind-of": { @@ -5093,7 +5093,7 @@ "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.9" } }, "lcid": { @@ -5101,7 +5101,7 @@ "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "left-pad": { @@ -5115,8 +5115,8 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "load-json-file": { @@ -5124,10 +5124,10 @@ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" }, "dependencies": { "pify": { @@ -5142,8 +5142,8 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -5186,7 +5186,7 @@ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "requires": { - "js-tokens": "4.0.0" + "js-tokens": "^3.0.0 || ^4.0.0" } }, "lru-cache": { @@ -5194,8 +5194,8 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "make-dir": { @@ -5203,7 +5203,7 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" } }, "makeerror": { @@ -5211,7 +5211,7 @@ "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", "requires": { - "tmpl": "1.0.4" + "tmpl": "1.0.x" } }, "map-cache": { @@ -5224,7 +5224,7 @@ "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "requires": { - "object-visit": "1.0.1" + "object-visit": "^1.0.0" } }, "math-random": { @@ -5237,7 +5237,7 @@ "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "merge": { @@ -5250,7 +5250,7 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.1" } }, "metro": { @@ -5292,34 +5292,34 @@ "@babel/template": "7.0.0-beta.47", "@babel/traverse": "7.0.0-beta.47", "@babel/types": "7.0.0-beta.47", - "absolute-path": "0.0.0", - "async": "2.6.1", - "babel-core": "6.26.3", - "babel-plugin-external-helpers": "6.22.0", - "babel-plugin-transform-flow-strip-types": "6.22.0", - "babel-preset-es2015-node": "6.1.1", - "babel-preset-fbjs": "2.2.0", - "babel-preset-react-native": "5.0.2", - "babel-register": "6.26.0", + "absolute-path": "^0.0.0", + "async": "^2.4.0", + "babel-core": "^6.24.1", + "babel-plugin-external-helpers": "^6.22.0", + "babel-plugin-transform-flow-strip-types": "^6.21.0", + "babel-preset-es2015-node": "^6.1.1", + "babel-preset-fbjs": "^2.1.4", + "babel-preset-react-native": "^5.0.0", + "babel-register": "^6.24.1", "babylon": "7.0.0-beta.47", - "chalk": "1.1.3", - "concat-stream": "1.6.2", - "connect": "3.6.6", - "debug": "2.6.9", - "denodeify": "1.2.1", - "eventemitter3": "3.1.0", - "fbjs": "0.8.17", - "fs-extra": "1.0.0", - "graceful-fs": "4.1.11", - "image-size": "0.6.3", + "chalk": "^1.1.1", + "concat-stream": "^1.6.0", + "connect": "^3.6.5", + "debug": "^2.2.0", + "denodeify": "^1.2.1", + "eventemitter3": "^3.0.0", + "fbjs": "^0.8.14", + "fs-extra": "^1.0.0", + "graceful-fs": "^4.1.3", + "image-size": "^0.6.0", "jest-docblock": "23.0.1", "jest-haste-map": "23.1.0", "jest-worker": "23.0.1", - "json-stable-stringify": "1.0.1", - "json5": "0.4.0", - "left-pad": "1.3.0", - "lodash.throttle": "4.1.1", - "merge-stream": "1.0.1", + "json-stable-stringify": "^1.0.1", + "json5": "^0.4.0", + "left-pad": "^1.1.3", + "lodash.throttle": "^4.1.1", + "merge-stream": "^1.0.1", "metro-babel-register": "0.38.4", "metro-babel7-plugin-react-transform": "0.38.4", "metro-cache": "0.38.4", @@ -5328,20 +5328,20 @@ "metro-resolver": "0.38.4", "metro-source-map": "0.38.4", "mime-types": "2.1.11", - "mkdirp": "0.5.1", - "node-fetch": "1.7.3", - "react-transform-hmr": "1.0.4", - "resolve": "1.8.1", - "rimraf": "2.6.2", - "serialize-error": "2.1.0", - "source-map": "0.5.7", + "mkdirp": "^0.5.1", + "node-fetch": "^1.3.3", + "react-transform-hmr": "^1.0.4", + "resolve": "^1.5.0", + "rimraf": "^2.5.4", + "serialize-error": "^2.1.0", + "source-map": "^0.5.6", "temp": "0.8.3", - "throat": "4.1.0", - "wordwrap": "1.0.0", - "write-file-atomic": "1.3.4", - "ws": "1.1.5", - "xpipe": "1.0.5", - "yargs": "9.0.1" + "throat": "^4.1.0", + "wordwrap": "^1.0.0", + "write-file-atomic": "^1.2.0", + "ws": "^1.1.0", + "xpipe": "^1.0.5", + "yargs": "^9.0.0" }, "dependencies": { "@babel/register": { @@ -5349,13 +5349,13 @@ "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.0.0-beta.47.tgz", "integrity": "sha512-r5aS1bAqW0tHvwUNPRRdmIedSWGK/oyv598EENpV/+VZF8EkX9TiVqCpJyg6zucPPyMjtdXN1pK/Yljp5NdGGA==", "requires": { - "core-js": "2.5.7", - "find-cache-dir": "1.0.0", - "home-or-tmp": "3.0.0", - "lodash": "4.17.10", - "mkdirp": "0.5.1", - "pirates": "3.0.2", - "source-map-support": "0.4.18" + "core-js": "^2.5.3", + "find-cache-dir": "^1.0.0", + "home-or-tmp": "^3.0.0", + "lodash": "^4.17.5", + "mkdirp": "^0.5.1", + "pirates": "^3.0.1", + "source-map-support": "^0.4.2" } }, "babylon": { @@ -5388,7 +5388,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", "integrity": "sha1-wlnEcb2oCKhdbNGTtDCl+uRHOzw=", "requires": { - "mime-db": "1.23.0" + "mime-db": "~1.23.0" } } } @@ -5405,8 +5405,8 @@ "@babel/plugin-transform-flow-strip-types": "7.0.0-beta.47", "@babel/plugin-transform-modules-commonjs": "7.0.0-beta.47", "@babel/register": "7.0.0-beta.47", - "core-js": "2.5.7", - "escape-string-regexp": "1.0.5" + "core-js": "^2.2.2", + "escape-string-regexp": "^1.0.5" }, "dependencies": { "@babel/register": { @@ -5414,13 +5414,13 @@ "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.0.0-beta.47.tgz", "integrity": "sha512-r5aS1bAqW0tHvwUNPRRdmIedSWGK/oyv598EENpV/+VZF8EkX9TiVqCpJyg6zucPPyMjtdXN1pK/Yljp5NdGGA==", "requires": { - "core-js": "2.5.7", - "find-cache-dir": "1.0.0", - "home-or-tmp": "3.0.0", - "lodash": "4.17.10", - "mkdirp": "0.5.1", - "pirates": "3.0.2", - "source-map-support": "0.4.18" + "core-js": "^2.5.3", + "find-cache-dir": "^1.0.0", + "home-or-tmp": "^3.0.0", + "lodash": "^4.17.5", + "mkdirp": "^0.5.1", + "pirates": "^3.0.1", + "source-map-support": "^0.4.2" } }, "core-js": { @@ -5441,7 +5441,7 @@ "integrity": "sha512-1mEK3NzZ6fd6cgFtQV+T8q4+Fqzw9rMsLEReLBXvCYZJ/imamTsuIyCBnPy4WhnVcBQON3pFjd/7fV8OOuD/9w==", "requires": { "@babel/helper-module-imports": "7.0.0-beta.47", - "lodash": "4.17.10" + "lodash": "^4.17.5" } }, "metro-cache": { @@ -5451,8 +5451,8 @@ "requires": { "jest-serializer": "23.0.1", "metro-core": "0.38.4", - "mkdirp": "0.5.1", - "rimraf": "2.6.2" + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4" } }, "metro-core": { @@ -5461,9 +5461,9 @@ "integrity": "sha512-FBRWdIcSpzQSVSS4f1pFLsYu8uWOfY/iiwkgnCsrwKryP59g57oFIHdFOBp2l3NE9tKJI0LjnPUJxGJ70SEZyA==", "requires": { "jest-haste-map": "23.1.0", - "lodash.throttle": "4.1.1", + "lodash.throttle": "^4.1.1", "metro-resolver": "0.38.4", - "wordwrap": "1.0.0" + "wordwrap": "^1.0.0" } }, "metro-memory-fs": { @@ -5476,7 +5476,7 @@ "resolved": "https://registry.npmjs.org/metro-minify-uglify/-/metro-minify-uglify-0.38.4.tgz", "integrity": "sha512-XaqbAOg3Dm/2zk/RVf2rr6h03erqitZKw3hvUCRI6EajpJhKdMty3viT6Wet7HHXhOkcZeySvBflua7u5NznFQ==", "requires": { - "uglify-es": "3.3.9" + "uglify-es": "^3.1.9" } }, "metro-resolver": { @@ -5484,7 +5484,7 @@ "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.38.4.tgz", "integrity": "sha512-Hw4bb9iLH+l4kSzmhOAKSkmMJ0MxDF2e6RBNPY2xekBlaaygzLSNebsJSpuhn7zLJZ4nuPRaY3QFo4so6GdZRA==", "requires": { - "absolute-path": "0.0.0" + "absolute-path": "^0.0.0" } }, "metro-source-map": { @@ -5492,7 +5492,7 @@ "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.38.4.tgz", "integrity": "sha512-CUqqe3X+SoQKOxJAgYlmYsqqv0ow+OIJI2/ZE5fXzijo98mIcaZaWeNMM3hXljUqlSHl8+LtIju22Ia002bOXg==", "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } }, "micromatch": { @@ -5500,19 +5500,19 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" }, "dependencies": { "arr-diff": { @@ -5520,7 +5520,7 @@ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "kind-of": { @@ -5528,7 +5528,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -5548,7 +5548,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", "requires": { - "mime-db": "1.35.0" + "mime-db": "~1.35.0" } }, "mimic-fn": { @@ -5561,7 +5561,7 @@ "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", "requires": { - "dom-walk": "0.1.1" + "dom-walk": "^0.1.0" } }, "minimatch": { @@ -5569,7 +5569,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -5582,8 +5582,8 @@ "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -5591,7 +5591,7 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -5651,7 +5651,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -5666,11 +5666,11 @@ "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz", "integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=", "requires": { - "basic-auth": "2.0.0", + "basic-auth": "~2.0.0", "debug": "2.6.9", - "depd": "1.1.2", - "on-finished": "2.3.0", - "on-headers": "1.0.1" + "depd": "~1.1.1", + "on-finished": "~2.3.0", + "on-headers": "~1.0.1" } }, "ms": { @@ -5694,17 +5694,17 @@ "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "arr-diff": { @@ -5722,8 +5722,8 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" } }, "is-extendable": { @@ -5731,7 +5731,7 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } }, "kind-of": { @@ -5757,8 +5757,8 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", "requires": { - "encoding": "0.1.12", - "is-stream": "1.1.0" + "encoding": "^0.1.11", + "is-stream": "^1.0.1" } }, "node-int64": { @@ -5776,10 +5776,10 @@ "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.2.1.tgz", "integrity": "sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg==", "requires": { - "growly": "1.3.0", - "semver": "5.5.0", - "shellwords": "0.1.1", - "which": "1.3.1" + "growly": "^1.3.0", + "semver": "^5.4.1", + "shellwords": "^0.1.1", + "which": "^1.3.0" } }, "node-pre-gyp": { @@ -5787,17 +5787,17 @@ "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz", "integrity": "sha512-OsJV74qxnvz/AMGgcfZoDaeDXKD3oY3QVIbBmwszTFkRisTSXbMQyn4UWzUMOtA5SVhrBZOTp0wcoSBgfMfMmQ==", "requires": { - "detect-libc": "1.0.3", + "detect-libc": "^1.0.2", "hawk": "3.1.3", - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.2", - "rc": "1.2.8", + "mkdirp": "^0.5.1", + "nopt": "^4.0.1", + "npmlog": "^4.0.2", + "rc": "^1.1.7", "request": "2.81.0", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "2.2.1", - "tar-pack": "3.4.1" + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^2.2.1", + "tar-pack": "^3.4.0" }, "dependencies": { "gauge": { @@ -5805,14 +5805,14 @@ "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" } }, "is-fullwidth-code-point": { @@ -5820,7 +5820,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "npmlog": { @@ -5828,10 +5828,10 @@ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" } }, "request": { @@ -5839,28 +5839,28 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.7.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.2", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.19", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.1.2", - "stringstream": "0.0.6", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.3.2" + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" } }, "string-width": { @@ -5868,9 +5868,9 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } } } @@ -5880,8 +5880,8 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" + "abbrev": "1", + "osenv": "^0.1.4" } }, "normalize-package-data": { @@ -5889,10 +5889,10 @@ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "requires": { - "hosted-git-info": "2.7.1", - "is-builtin-module": "1.0.0", - "semver": "5.5.0", - "validate-npm-package-license": "3.0.3" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "normalize-path": { @@ -5900,7 +5900,7 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "requires": { - "remove-trailing-separator": "1.1.0" + "remove-trailing-separator": "^1.0.1" } }, "npm-run-path": { @@ -5908,7 +5908,7 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "npmlog": { @@ -5916,9 +5916,9 @@ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", "requires": { - "ansi": "0.3.1", - "are-we-there-yet": "1.1.5", - "gauge": "1.2.7" + "ansi": "~0.3.1", + "are-we-there-yet": "~1.1.2", + "gauge": "~1.2.5" } }, "number-is-nan": { @@ -5941,9 +5941,9 @@ "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { "define-property": { @@ -5951,7 +5951,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "kind-of": { @@ -5959,7 +5959,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -5980,7 +5980,7 @@ "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.0" }, "dependencies": { "isobject": { @@ -5995,8 +5995,8 @@ "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" } }, "object.pick": { @@ -6004,7 +6004,7 @@ "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" }, "dependencies": { "isobject": { @@ -6037,7 +6037,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "onetime": { @@ -6045,7 +6045,7 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "opn": { @@ -6053,7 +6053,7 @@ "resolved": "https://registry.npmjs.org/opn/-/opn-3.0.3.tgz", "integrity": "sha1-ttmec5n3jWXDuq/+8fsojpuFJDo=", "requires": { - "object-assign": "4.1.1" + "object-assign": "^4.0.1" } }, "optimist": { @@ -6061,8 +6061,8 @@ "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" }, "dependencies": { "minimist": { @@ -6083,12 +6083,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "options": { @@ -6106,9 +6106,9 @@ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "os-tmpdir": { @@ -6121,8 +6121,8 @@ "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, "p-finally": { @@ -6135,7 +6135,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -6143,7 +6143,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "requires": { - "p-limit": "1.3.0" + "p-limit": "^1.1.0" } }, "p-try": { @@ -6156,10 +6156,10 @@ "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" } }, "parse-json": { @@ -6167,7 +6167,7 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "requires": { - "error-ex": "1.3.2" + "error-ex": "^1.2.0" } }, "parseurl": { @@ -6226,7 +6226,7 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "requires": { - "pify": "2.3.0" + "pify": "^2.0.0" }, "dependencies": { "pify": { @@ -6272,7 +6272,7 @@ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pirates": { @@ -6280,7 +6280,7 @@ "resolved": "https://registry.npmjs.org/pirates/-/pirates-3.0.2.tgz", "integrity": "sha512-c5CgUJq6H2k6MJz72Ak1F5sN9n9wlSlJyEnwvpm9/y3WB4E3pHBDT2c6PEiS1vyJvq2bUxUAIu0EGf8Cx4Ic7Q==", "requires": { - "node-modules-regexp": "1.0.0" + "node-modules-regexp": "^1.0.0" } }, "pkg-dir": { @@ -6288,7 +6288,7 @@ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "requires": { - "find-up": "2.1.0" + "find-up": "^2.1.0" } }, "plist": { @@ -6296,9 +6296,9 @@ "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", "integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==", "requires": { - "base64-js": "1.3.0", - "xmlbuilder": "9.0.7", - "xmldom": "0.1.27" + "base64-js": "^1.2.3", + "xmlbuilder": "^9.0.7", + "xmldom": "0.1.x" } }, "plugin-error": { @@ -6306,11 +6306,11 @@ "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", "requires": { - "ansi-cyan": "0.1.1", - "ansi-red": "0.1.1", - "arr-diff": "1.1.0", - "arr-union": "2.1.0", - "extend-shallow": "1.1.4" + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" } }, "pluralize": { @@ -6365,7 +6365,7 @@ "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", "requires": { - "asap": "2.0.6" + "asap": "~2.0.3" } }, "prop-types": { @@ -6373,8 +6373,8 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz", "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==", "requires": { - "loose-envify": "1.4.0", - "object-assign": "4.1.1" + "loose-envify": "^1.3.1", + "object-assign": "^4.1.1" } }, "pseudomap": { @@ -6397,8 +6397,8 @@ "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.1.0.tgz", "integrity": "sha512-pNB/Gr8SA8ff8KpUFM36o/WFAlthgaThka5bV19AD9PNTH20Pwq5Zxodif2YyHwrctp6SkL4GqlOot0qR/wGaw==", "requires": { - "decode-uri-component": "0.2.0", - "strict-uri-encode": "2.0.0" + "decode-uri-component": "^0.2.0", + "strict-uri-encode": "^2.0.0" } }, "querystringify": { @@ -6411,9 +6411,9 @@ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", "requires": { - "is-number": "4.0.0", - "kind-of": "6.0.2", - "math-random": "1.0.1" + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" }, "dependencies": { "is-number": { @@ -6438,10 +6438,10 @@ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" } }, "react": { @@ -6449,10 +6449,10 @@ "resolved": "https://registry.npmjs.org/react/-/react-16.4.1.tgz", "integrity": "sha512-3GEs0giKp6E0Oh/Y9ZC60CmYgUPnp7voH9fbjWsvXtYFb4EWtgQub0ADSq0sJR0BbHc4FThLLtzlcFaFXIorwg==", "requires": { - "fbjs": "0.8.17", - "loose-envify": "1.4.0", - "object-assign": "4.1.1", - "prop-types": "15.6.2" + "fbjs": "^0.8.16", + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.0" } }, "react-clone-referenced-element": { @@ -6470,8 +6470,8 @@ "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-3.2.3.tgz", "integrity": "sha1-o34ZnZSGXiy7YWuXvo9YIGdOar0=", "requires": { - "shell-quote": "1.6.1", - "ws": "3.3.3" + "shell-quote": "^1.6.1", + "ws": "^3.3.1" }, "dependencies": { "ultron": { @@ -6484,9 +6484,9 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "requires": { - "async-limiter": "1.0.0", - "safe-buffer": "5.1.2", - "ultron": "1.1.1" + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" } } } @@ -6507,57 +6507,57 @@ "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.56.0.tgz", "integrity": "sha512-JGKPG77HwrgMdiCkmZmjuczJrwCnq7E28+My+OS3OnmN78uphmtaMqYnv3lJjfb5hKS4kCqYCfFYFMUnmpmxMw==", "requires": { - "absolute-path": "0.0.0", - "art": "0.10.3", - "base64-js": "1.3.0", - "chalk": "1.1.3", - "commander": "2.16.0", - "compression": "1.7.3", - "connect": "3.6.6", - "create-react-class": "15.6.3", - "debug": "2.6.9", - "denodeify": "1.2.1", - "envinfo": "5.10.0", - "errorhandler": "1.5.0", - "escape-string-regexp": "1.0.5", - "event-target-shim": "1.1.1", + "absolute-path": "^0.0.0", + "art": "^0.10.0", + "base64-js": "^1.1.2", + "chalk": "^1.1.1", + "commander": "^2.9.0", + "compression": "^1.7.1", + "connect": "^3.6.5", + "create-react-class": "^15.6.3", + "debug": "^2.2.0", + "denodeify": "^1.2.1", + "envinfo": "^5.7.0", + "errorhandler": "^1.5.0", + "escape-string-regexp": "^1.0.5", + "event-target-shim": "^1.0.5", "fbjs": "0.8.16", - "fbjs-scripts": "0.8.3", - "fs-extra": "1.0.0", - "glob": "7.1.2", - "graceful-fs": "4.1.11", - "inquirer": "3.3.0", - "lodash": "4.17.10", - "metro": "0.38.4", - "metro-babel-register": "0.38.4", - "metro-core": "0.38.4", - "metro-memory-fs": "0.38.4", - "mime": "1.6.0", - "minimist": "1.2.0", - "mkdirp": "0.5.1", - "morgan": "1.9.0", - "node-fetch": "1.7.3", - "node-notifier": "5.2.1", - "npmlog": "2.0.4", - "opn": "3.0.3", - "optimist": "0.6.1", - "plist": "3.0.1", - "pretty-format": "4.3.1", - "promise": "7.3.1", - "prop-types": "15.6.2", - "react-clone-referenced-element": "1.0.1", - "react-devtools-core": "3.2.3", - "react-timer-mixin": "0.13.4", - "regenerator-runtime": "0.11.1", - "rimraf": "2.6.2", - "semver": "5.5.0", - "serve-static": "1.13.2", + "fbjs-scripts": "^0.8.1", + "fs-extra": "^1.0.0", + "glob": "^7.1.1", + "graceful-fs": "^4.1.3", + "inquirer": "^3.0.6", + "lodash": "^4.17.5", + "metro": "^0.38.1", + "metro-babel-register": "^0.38.1", + "metro-core": "^0.38.1", + "metro-memory-fs": "^0.38.1", + "mime": "^1.3.4", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "morgan": "^1.9.0", + "node-fetch": "^1.3.3", + "node-notifier": "^5.2.1", + "npmlog": "^2.0.4", + "opn": "^3.0.2", + "optimist": "^0.6.1", + "plist": "^3.0.0", + "pretty-format": "^4.2.1", + "promise": "^7.1.1", + "prop-types": "^15.5.8", + "react-clone-referenced-element": "^1.0.1", + "react-devtools-core": "^3.2.2", + "react-timer-mixin": "^0.13.2", + "regenerator-runtime": "^0.11.0", + "rimraf": "^2.5.4", + "semver": "^5.0.3", + "serve-static": "^1.13.1", "shell-quote": "1.6.1", - "stacktrace-parser": "0.1.4", - "ws": "1.1.5", - "xcode": "0.9.3", - "xmldoc": "0.4.0", - "yargs": "9.0.1" + "stacktrace-parser": "^0.1.3", + "ws": "^1.1.0", + "xcode": "^0.9.1", + "xmldoc": "^0.4.0", + "yargs": "^9.0.0" }, "dependencies": { "fbjs": { @@ -6565,13 +6565,13 @@ "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", "requires": { - "core-js": "1.2.7", - "isomorphic-fetch": "2.2.1", - "loose-envify": "1.4.0", - "object-assign": "4.1.1", - "promise": "7.3.1", - "setimmediate": "1.0.5", - "ua-parser-js": "0.7.18" + "core-js": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.9" } } } @@ -6581,7 +6581,7 @@ "resolved": "https://registry.npmjs.org/react-native-animatable/-/react-native-animatable-1.3.0.tgz", "integrity": "sha512-GGYEYvderfzPZcPnw7xov4nlRmi9d6oqcIzx0fGkUUsMshOQEtq5IEzFp3np0uTB9n8/gZIZcdbUPggVlVydMg==", "requires": { - "prop-types": "15.6.2" + "prop-types": "^15.5.10" } }, "react-native-calendars": { @@ -6589,10 +6589,10 @@ "resolved": "https://registry.npmjs.org/react-native-calendars/-/react-native-calendars-1.20.0.tgz", "integrity": "sha512-VlRoDcnEAWYE1JBPBh/Bie6baLQCmtuOGhw7V5yk09Y4j7Hy8BtuZIHh2+LU/TFYso+wEHJAFdj6D0QFttDOlg==", "requires": { - "lodash.get": "4.4.2", - "lodash.isequal": "4.5.0", - "prop-types": "15.6.2", - "xdate": "0.8.2" + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "prop-types": "^15.5.10", + "xdate": "^0.8.0" } }, "react-native-dismiss-keyboard": { @@ -6626,8 +6626,8 @@ "resolved": "https://registry.npmjs.org/react-native-fs/-/react-native-fs-2.10.14.tgz", "integrity": "sha512-4bCzkg4dE/xUyXkMVz0AiyqLKAgTZPlZl/nEzRiSr2q6VnWDgO229MSgHLHhUtD2cqZkV0Z83WEbGpvXxWOAHA==", "requires": { - "base-64": "0.1.0", - "utf8": "2.1.2" + "base-64": "^0.1.0", + "utf8": "^2.1.1" } }, "react-native-modal": { @@ -6636,7 +6636,7 @@ "integrity": "sha512-DsF4r8ScW0y+bn+7ThzBLP4az/hsi+e9ge79vExkjpw6uNFwNWQPY21BRE4uyip7PpsqEDSyvVb8GH3UXZIYcA==", "requires": { "prop-types": "15.5.10", - "react-native-animatable": "1.3.0" + "react-native-animatable": "^1.2.3" }, "dependencies": { "prop-types": { @@ -6644,8 +6644,8 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.5.10.tgz", "integrity": "sha1-J5ffwxJhguOpXj37suiT3ddFYVQ=", "requires": { - "fbjs": "0.8.17", - "loose-envify": "1.4.0" + "fbjs": "^0.8.9", + "loose-envify": "^1.3.1" } } } @@ -6655,7 +6655,7 @@ "resolved": "https://registry.npmjs.org/react-native-modal-datetime-picker-nevo/-/react-native-modal-datetime-picker-nevo-4.11.0.tgz", "integrity": "sha512-nDUlHyUoRHO+fzt0cc2g+a8kYx+RZQZnjVY01jDIspAbRGTJuCt9x+LjTvhuDQpoXEJYvBEw1W7dz9mn3tNsoQ==", "requires": { - "moment": "2.22.2", + "moment": "^2.19.0", "prop-types": "15.5.10", "react-native-modal": "3.1.0" }, @@ -6665,8 +6665,8 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.5.10.tgz", "integrity": "sha1-J5ffwxJhguOpXj37suiT3ddFYVQ=", "requires": { - "fbjs": "0.8.17", - "loose-envify": "1.4.0" + "fbjs": "^0.8.9", + "loose-envify": "^1.3.1" } } } @@ -6681,7 +6681,7 @@ "resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.8.0.tgz", "integrity": "sha512-uAUzpBxXPVmfupz71GYcPjUBnZFtDuThKO/Q4FWEUykSuML78lItYR6JRsE006CY6gw6mUwpk4MJjhDE4uZ+Ww==", "requires": { - "hoist-non-react-statics": "2.5.5" + "hoist-non-react-statics": "^2.3.1" } }, "react-native-share": { @@ -6689,17 +6689,12 @@ "resolved": "https://registry.npmjs.org/react-native-share/-/react-native-share-1.1.0.tgz", "integrity": "sha512-uQXo+HzZGUo9VlfgfWwGa9vLrY9OBQOFAsxhH/e3GWAlCxrGGjXNu/La+aJzMJdhoHzzn1+NRWDp1LWvlxJHew==" }, - "react-native-simple-radio-button": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/react-native-simple-radio-button/-/react-native-simple-radio-button-2.7.2.tgz", - "integrity": "sha512-BdlllHsC/gYJtxPJ2tshDWN8CzmlGg1G9uB+Lu4FRGvGkwhvMtJ/uNShMbvxu134xosH/feri6HQgLGlIT202Q==" - }, "react-native-tab-view": { "version": "0.0.77", "resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-0.0.77.tgz", "integrity": "sha512-9vjD4Ly1Zlum1Y4g23ODpi/F3gYIUIsKWrsZO/Oh5cuX1eiB1DRVn11nY1z+j/hsQfhfyW6nDlmySyDvYQvYCA==", "requires": { - "prop-types": "15.6.2" + "prop-types": "^15.6.0" } }, "react-native-vector-icons": { @@ -6707,9 +6702,9 @@ "resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-5.0.0.tgz", "integrity": "sha512-3ZmLGhQFk5QeHuttx0tOpghXhpVMGwXzb3pVaW/M8Qj0qkcg7koVyZmoR9vABQuxFC6KbM3l6/WLYZPh2aGfuQ==", "requires": { - "lodash": "4.17.10", - "prop-types": "15.6.2", - "yargs": "8.0.2" + "lodash": "^4.0.0", + "prop-types": "^15.5.10", + "yargs": "^8.0.2" }, "dependencies": { "yargs": { @@ -6717,19 +6712,19 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", "requires": { - "camelcase": "4.1.0", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.3", - "os-locale": "2.1.0", - "read-pkg-up": "2.0.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "7.0.0" + "camelcase": "^4.1.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "read-pkg-up": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^7.0.0" } } } @@ -6739,13 +6734,13 @@ "resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-2.10.0.tgz", "integrity": "sha512-+Jt2PrJ3H+mYfexBySgvrEfXxJ0AAMZVYJNh8wXInHXGqrZKaSSd73z4yGcOkQQfsNE9sHjZk5yvE101KZJ+Ew==", "requires": { - "clamp": "1.0.1", - "create-react-context": "0.2.2", - "hoist-non-react-statics": "2.5.5", - "path-to-regexp": "1.7.0", - "query-string": "6.1.0", - "react-lifecycles-compat": "3.0.4", - "react-native-safe-area-view": "0.8.0", + "clamp": "^1.0.1", + "create-react-context": "^0.2.1", + "hoist-non-react-statics": "^2.2.0", + "path-to-regexp": "^1.7.0", + "query-string": "^6.1.0", + "react-lifecycles-compat": "^3", + "react-native-safe-area-view": "^0.8.0", "react-navigation-deprecated-tab-navigator": "1.3.0", "react-navigation-drawer": "0.5.0", "react-navigation-tabs": "0.6.0" @@ -6756,7 +6751,7 @@ "resolved": "https://registry.npmjs.org/react-navigation-deprecated-tab-navigator/-/react-navigation-deprecated-tab-navigator-1.3.0.tgz", "integrity": "sha512-Cm+qYOPFWbvvcuv0YYX0ioYwLGgw7XAqdhAfpo3sIr3trxRW8871ePmfFOPezjQtz4v6ItjZt6LPgtBAVZoroQ==", "requires": { - "react-native-tab-view": "0.0.77" + "react-native-tab-view": "^0.0.77" } }, "react-navigation-drawer": { @@ -6764,7 +6759,7 @@ "resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-0.5.0.tgz", "integrity": "sha512-F1y593uC6pqBMGH+Omz75oNODEbxB/s0EGO8QtYwu1NmOOEUuuLA+c14zm+pgMsI4HlDabiHxPkWqsgGz25xVQ==", "requires": { - "react-native-drawer-layout-polyfill": "1.3.2" + "react-native-drawer-layout-polyfill": "^1.3.2" } }, "react-navigation-tabs": { @@ -6772,11 +6767,11 @@ "resolved": "https://registry.npmjs.org/react-navigation-tabs/-/react-navigation-tabs-0.6.0.tgz", "integrity": "sha512-Ax1rujJ51R1Jrz7b5bHUAIgsYC1VrFws+d3hxlPy5dXG84iJdV5dnDFRvdQMDDfDZc+NDx2a223lAYsc3p2+XA==", "requires": { - "hoist-non-react-statics": "2.5.5", - "prop-types": "15.6.2", - "react-lifecycles-compat": "3.0.4", - "react-native-safe-area-view": "0.7.0", - "react-native-tab-view": "1.0.2" + "hoist-non-react-statics": "^2.5.0", + "prop-types": "^15.6.1", + "react-lifecycles-compat": "^3.0.4", + "react-native-safe-area-view": "^0.7.0", + "react-native-tab-view": "^1.0.0" }, "dependencies": { "react-native-safe-area-view": { @@ -6784,7 +6779,7 @@ "resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.7.0.tgz", "integrity": "sha512-SjLdW/Th0WVMhyngH4O6yC21S+O4U4AAG3QxBr7fZ2ftgjXSpKbDHAhEpxBdFwei6HsnsC2h9oYMtPpaW9nfGg==", "requires": { - "hoist-non-react-statics": "2.5.5" + "hoist-non-react-statics": "^2.3.1" } }, "react-native-tab-view": { @@ -6792,7 +6787,7 @@ "resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-1.0.2.tgz", "integrity": "sha512-x8I43V1X7/AyMnIwnqJGMU54LqQRlV6vJ9irbls9asA/axdHIdxagPIV6Jx1ttFe/bPKhFwXL+lRYdYxGyUlWg==", "requires": { - "prop-types": "15.6.2" + "prop-types": "^15.6.1" } } } @@ -6802,8 +6797,8 @@ "resolved": "https://registry.npmjs.org/react-proxy/-/react-proxy-1.1.8.tgz", "integrity": "sha1-nb/Z2SdSjDqp9ETkVYw3gwq4wmo=", "requires": { - "lodash": "4.17.10", - "react-deep-force-update": "1.1.1" + "lodash": "^4.6.1", + "react-deep-force-update": "^1.0.0" } }, "react-test-renderer": { @@ -6812,10 +6807,10 @@ "integrity": "sha512-emEcIPUowMjT5EQ+rrb0FAwVCzuJ+LKDweoYDh073v2/jHxrBDPUk8nzI5dofG3R+140+Bb9TMcT2Ez5OP6pQw==", "dev": true, "requires": { - "fbjs": "0.8.17", - "object-assign": "4.1.1", - "prop-types": "15.6.2", - "react-is": "16.4.2" + "fbjs": "^0.8.16", + "object-assign": "^4.1.1", + "prop-types": "^15.6.0", + "react-is": "^16.3.1" } }, "react-timer-mixin": { @@ -6828,8 +6823,8 @@ "resolved": "https://registry.npmjs.org/react-transform-hmr/-/react-transform-hmr-1.0.4.tgz", "integrity": "sha1-4aQL0Krvxy6N/Xp82gmvhQZjl7s=", "requires": { - "global": "4.3.2", - "react-proxy": "1.1.8" + "global": "^4.3.0", + "react-proxy": "^1.1.7" } }, "read-pkg": { @@ -6837,9 +6832,9 @@ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "requires": { - "load-json-file": "2.0.0", - "normalize-package-data": "2.4.0", - "path-type": "2.0.0" + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" } }, "read-pkg-up": { @@ -6847,8 +6842,8 @@ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "requires": { - "find-up": "2.1.0", - "read-pkg": "2.0.0" + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" } }, "readable-stream": { @@ -6856,13 +6851,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" }, "dependencies": { "inherits": { @@ -6877,20 +6872,20 @@ "resolved": "https://registry.npmjs.org/realm/-/realm-2.14.0.tgz", "integrity": "sha512-HiCj/ZE3iZNOyWexVkhDetNEfcTtSdgsg5lop7g7rcCsE+4NM3hDRxvBjrBSk/mgs6HXBAhHohzGmREbs6piRg==", "requires": { - "command-line-args": "4.0.7", - "decompress": "4.2.0", + "command-line-args": "^4.0.6", + "decompress": "^4.2.0", "deepmerge": "2.1.0", - "fs-extra": "4.0.3", - "ini": "1.3.5", + "fs-extra": "^4.0.2", + "ini": "^1.3.4", "nan": "2.8.0", - "node-fetch": "1.7.3", - "node-pre-gyp": "0.6.39", - "progress": "2.0.0", - "prop-types": "15.6.2", - "request": "2.87.0", - "stream-counter": "1.0.0", - "sync-request": "3.0.1", - "url-parse": "1.4.3" + "node-fetch": "^1.6.3", + "node-pre-gyp": "^0.6.36", + "progress": "^2.0.0", + "prop-types": "^15.5.10", + "request": "^2.78.0", + "stream-counter": "^1.0.0", + "sync-request": "^3.0.1", + "url-parse": "^1.2.0" }, "dependencies": { "fs-extra": { @@ -6898,9 +6893,9 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "4.0.0", - "universalify": "0.1.2" + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" } }, "jsonfile": { @@ -6908,7 +6903,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } }, "nan": { @@ -6928,7 +6923,7 @@ "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz", "integrity": "sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw==", "requires": { - "regenerate": "1.4.0" + "regenerate": "^1.4.0" } }, "regenerator-runtime": { @@ -6941,7 +6936,7 @@ "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.12.4.tgz", "integrity": "sha512-p2I0fY+TbSLD2/VFTFb/ypEHxs3e3AjU0DzttdPqk2bSmDhfSh5E54b86Yc6XhUa5KykK1tgbvZ4Nr82oCJWkQ==", "requires": { - "private": "0.1.8" + "private": "^0.1.6" } }, "regex-cache": { @@ -6949,7 +6944,7 @@ "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "requires": { - "is-equal-shallow": "0.1.3" + "is-equal-shallow": "^0.1.3" } }, "regex-not": { @@ -6957,8 +6952,8 @@ "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" }, "dependencies": { "extend-shallow": { @@ -6966,8 +6961,8 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" } }, "is-extendable": { @@ -6975,7 +6970,7 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -6991,12 +6986,12 @@ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.2.0.tgz", "integrity": "sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw==", "requires": { - "regenerate": "1.4.0", - "regenerate-unicode-properties": "7.0.0", - "regjsgen": "0.4.0", - "regjsparser": "0.3.0", - "unicode-match-property-ecmascript": "1.0.4", - "unicode-match-property-value-ecmascript": "1.0.2" + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^7.0.0", + "regjsgen": "^0.4.0", + "regjsparser": "^0.3.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.0.2" } }, "regjsgen": { @@ -7009,7 +7004,7 @@ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.3.0.tgz", "integrity": "sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA==", "requires": { - "jsesc": "0.5.0" + "jsesc": "~0.5.0" }, "dependencies": { "jsesc": { @@ -7039,7 +7034,7 @@ "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "requires": { - "is-finite": "1.0.2" + "is-finite": "^1.0.0" } }, "request": { @@ -7047,26 +7042,26 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.7.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.2", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.19", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.2", - "safe-buffer": "5.1.2", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.3.2" + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" }, "dependencies": { "ajv": { @@ -7074,10 +7069,10 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "assert-plus": { @@ -7095,9 +7090,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { - "asynckit": "0.4.0", + "asynckit": "^0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.19" + "mime-types": "^2.1.12" } }, "har-schema": { @@ -7110,8 +7105,8 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^5.1.0", + "har-schema": "^2.0.0" } }, "http-signature": { @@ -7119,9 +7114,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.2" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "performance-now": { @@ -7152,8 +7147,8 @@ "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { - "caller-path": "0.1.0", - "resolve-from": "1.0.1" + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" } }, "requires-port": { @@ -7166,7 +7161,7 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "resolve-from": { @@ -7185,8 +7180,8 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "requires": { - "onetime": "2.0.1", - "signal-exit": "3.0.2" + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" } }, "ret": { @@ -7199,7 +7194,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "rsvp": { @@ -7212,7 +7207,7 @@ "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "requires": { - "is-promise": "2.1.0" + "is-promise": "^2.1.0" } }, "rx-lite": { @@ -7225,7 +7220,7 @@ "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", "requires": { - "rx-lite": "4.0.8" + "rx-lite": "*" } }, "safe-buffer": { @@ -7238,7 +7233,7 @@ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "requires": { - "ret": "0.1.15" + "ret": "~0.1.10" } }, "safer-buffer": { @@ -7251,15 +7246,15 @@ "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.2.tgz", "integrity": "sha1-tNwYYcIbQn6SlQej51HiosuKs/o=", "requires": { - "anymatch": "2.0.0", - "capture-exit": "1.2.0", - "exec-sh": "0.2.2", - "fb-watchman": "2.0.0", - "fsevents": "1.2.4", - "micromatch": "3.1.10", - "minimist": "1.2.0", - "walker": "1.0.7", - "watch": "0.18.0" + "anymatch": "^2.0.0", + "capture-exit": "^1.2.0", + "exec-sh": "^0.2.0", + "fb-watchman": "^2.0.0", + "fsevents": "^1.2.3", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5", + "watch": "~0.18.0" }, "dependencies": { "arr-diff": { @@ -7277,16 +7272,16 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -7294,7 +7289,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -7304,13 +7299,13 @@ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -7318,7 +7313,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -7326,7 +7321,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "is-accessor-descriptor": { @@ -7334,7 +7329,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -7342,7 +7337,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -7352,7 +7347,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -7360,7 +7355,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -7370,9 +7365,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" } }, "kind-of": { @@ -7387,8 +7382,8 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -7396,7 +7391,7 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -7406,14 +7401,14 @@ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -7421,7 +7416,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -7429,7 +7424,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -7439,10 +7434,10 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -7450,7 +7445,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -7460,7 +7455,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -7468,7 +7463,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -7476,9 +7471,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "is-number": { @@ -7486,7 +7481,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -7494,7 +7489,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -7514,19 +7509,19 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } } } @@ -7541,7 +7536,7 @@ "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", "requires": { - "commander": "2.8.1" + "commander": "~2.8.1" }, "dependencies": { "commander": { @@ -7549,7 +7544,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "requires": { - "graceful-readlink": "1.0.1" + "graceful-readlink": ">= 1.0.0" } } } @@ -7565,18 +7560,18 @@ "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "requires": { "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.6.3", + "http-errors": "~1.6.2", "mime": "1.4.1", "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" }, "dependencies": { "mime": { @@ -7601,9 +7596,9 @@ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "requires": { - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "parseurl": "1.3.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", "send": "0.16.2" } }, @@ -7617,10 +7612,10 @@ "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -7628,7 +7623,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -7648,7 +7643,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -7661,10 +7656,10 @@ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", "requires": { - "array-filter": "0.0.1", - "array-map": "0.0.0", - "array-reduce": "0.0.0", - "jsonify": "0.0.0" + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" } }, "shellwords": { @@ -7699,7 +7694,7 @@ "requires": { "base64-js": "1.1.2", "xmlbuilder": "8.2.2", - "xmldom": "0.1.27" + "xmldom": "0.1.x" } }, "xmlbuilder": { @@ -7720,7 +7715,7 @@ "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0" + "is-fullwidth-code-point": "^2.0.0" } }, "slide": { @@ -7733,14 +7728,14 @@ "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.2", - "use": "3.1.1" + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" }, "dependencies": { "define-property": { @@ -7748,7 +7743,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -7756,7 +7751,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -7766,9 +7761,9 @@ "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" }, "dependencies": { "define-property": { @@ -7776,7 +7771,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -7784,7 +7779,7 @@ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -7792,7 +7787,7 @@ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -7800,9 +7795,9 @@ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "isobject": { @@ -7822,7 +7817,7 @@ "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.2.0" }, "dependencies": { "kind-of": { @@ -7830,7 +7825,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -7840,7 +7835,7 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "source-map": { @@ -7853,11 +7848,11 @@ "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "requires": { - "atob": "2.1.1", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, "source-map-support": { @@ -7865,7 +7860,7 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } }, "source-map-url": { @@ -7878,8 +7873,8 @@ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -7892,8 +7887,8 @@ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -7906,7 +7901,7 @@ "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "requires": { - "extend-shallow": "3.0.2" + "extend-shallow": "^3.0.0" }, "dependencies": { "extend-shallow": { @@ -7914,8 +7909,8 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" } }, "is-extendable": { @@ -7923,7 +7918,7 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -7939,15 +7934,15 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", "requires": { - "asn1": "0.2.4", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.2", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.2", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "safer-buffer": "2.1.2", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" }, "dependencies": { "assert-plus": { @@ -7967,8 +7962,8 @@ "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "dependencies": { "define-property": { @@ -7976,7 +7971,7 @@ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -8006,8 +8001,8 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" }, "dependencies": { "ansi-regex": { @@ -8020,7 +8015,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } @@ -8030,7 +8025,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } }, "stringstream": { @@ -8043,7 +8038,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -8056,7 +8051,7 @@ "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", "requires": { - "is-natural-number": "4.0.1" + "is-natural-number": "^4.0.1" } }, "strip-eof": { @@ -8079,9 +8074,9 @@ "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-3.0.1.tgz", "integrity": "sha1-yqEjWq+Im6UBB2oYNMQ2gwqC+3M=", "requires": { - "concat-stream": "1.6.2", - "http-response-object": "1.1.0", - "then-request": "2.2.0" + "concat-stream": "^1.4.7", + "http-response-object": "^1.0.1", + "then-request": "^2.0.1" } }, "table": { @@ -8090,12 +8085,12 @@ "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "ajv": "5.5.2", - "ajv-keywords": "2.1.1", - "chalk": "2.4.1", - "lodash": "4.17.10", + "ajv": "^5.2.3", + "ajv-keywords": "^2.1.0", + "chalk": "^2.1.0", + "lodash": "^4.17.4", "slice-ansi": "1.0.0", - "string-width": "2.1.1" + "string-width": "^2.1.1" }, "dependencies": { "ajv": { @@ -8104,10 +8099,10 @@ "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "ansi-styles": { @@ -8116,7 +8111,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.2" + "color-convert": "^1.9.0" } }, "chalk": { @@ -8125,9 +8120,9 @@ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "supports-color": { @@ -8136,7 +8131,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -8146,9 +8141,9 @@ "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.1" + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" } }, "tar-pack": { @@ -8156,14 +8151,14 @@ "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.1.tgz", "integrity": "sha512-PPRybI9+jM5tjtCbN2cxmmRU7YmqT3Zv/UDy48tAh2XRkLa9bAORtSWLkVc13+GJF+cdTh1yEnHEk3cpTaL5Kg==", "requires": { - "debug": "2.6.9", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.3.6", - "rimraf": "2.6.2", - "tar": "2.2.1", - "uid-number": "0.0.6" + "debug": "^2.2.0", + "fstream": "^1.0.10", + "fstream-ignore": "^1.0.5", + "once": "^1.3.3", + "readable-stream": "^2.1.4", + "rimraf": "^2.5.1", + "tar": "^2.2.1", + "uid-number": "^0.0.6" } }, "tar-stream": { @@ -8171,13 +8166,13 @@ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.1.tgz", "integrity": "sha512-IFLM5wp3QrJODQFPm6/to3LJZrONdBY/otxcvDIQzu217zKye6yVR3hhi9lAjrC2Z+m/j5oDxMPb1qcd8cIvpA==", "requires": { - "bl": "1.2.2", - "buffer-alloc": "1.2.0", - "end-of-stream": "1.4.1", - "fs-constants": "1.0.0", - "readable-stream": "2.3.6", - "to-buffer": "1.1.1", - "xtend": "4.0.1" + "bl": "^1.0.0", + "buffer-alloc": "^1.1.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.0", + "xtend": "^4.0.0" } }, "temp": { @@ -8185,8 +8180,8 @@ "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz", "integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=", "requires": { - "os-tmpdir": "1.0.2", - "rimraf": "2.2.8" + "os-tmpdir": "^1.0.0", + "rimraf": "~2.2.6" }, "dependencies": { "rimraf": { @@ -8201,8 +8196,8 @@ "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", "integrity": "sha1-Edpv9nDzRxpztiXKTz/c97t0gpE=", "requires": { - "array-back": "1.0.4", - "typical": "2.6.1" + "array-back": "^1.0.3", + "typical": "^2.6.0" }, "dependencies": { "array-back": { @@ -8210,7 +8205,7 @@ "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", "requires": { - "typical": "2.6.1" + "typical": "^2.6.0" } } } @@ -8226,12 +8221,12 @@ "resolved": "https://registry.npmjs.org/then-request/-/then-request-2.2.0.tgz", "integrity": "sha1-ZnizL6DKIY/laZgbvYhxtZQGDYE=", "requires": { - "caseless": "0.11.0", - "concat-stream": "1.6.2", - "http-basic": "2.5.1", - "http-response-object": "1.1.0", - "promise": "7.3.1", - "qs": "6.4.0" + "caseless": "~0.11.0", + "concat-stream": "^1.4.7", + "http-basic": "^2.5.1", + "http-response-object": "^1.1.0", + "promise": "^7.1.1", + "qs": "^6.1.0" }, "dependencies": { "caseless": { @@ -8256,8 +8251,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "requires": { - "readable-stream": "2.3.6", - "xtend": "4.0.1" + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" } }, "time-stamp": { @@ -8270,7 +8265,7 @@ "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "requires": { - "os-tmpdir": "1.0.2" + "os-tmpdir": "~1.0.2" } }, "tmpl": { @@ -8293,7 +8288,7 @@ "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -8301,7 +8296,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -8311,10 +8306,10 @@ "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" }, "dependencies": { "extend-shallow": { @@ -8322,8 +8317,8 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" } }, "is-extendable": { @@ -8331,7 +8326,7 @@ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -8341,8 +8336,8 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" }, "dependencies": { "is-number": { @@ -8350,7 +8345,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "kind-of": { @@ -8358,7 +8353,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -8368,7 +8363,7 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "trim-right": { @@ -8381,7 +8376,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -8396,7 +8391,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "type-detect": { @@ -8425,8 +8420,8 @@ "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", "requires": { - "commander": "2.13.0", - "source-map": "0.6.1" + "commander": "~2.13.0", + "source-map": "~0.6.1" }, "dependencies": { "commander": { @@ -8456,8 +8451,8 @@ "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz", "integrity": "sha512-izD3jxT8xkzwtXRUZjtmRwKnZoeECrfZ8ra/ketwOcusbZEp4mjULMnJOCfTDZBgGQAAY1AJ/IgxcwkavcX9Og==", "requires": { - "buffer": "3.6.0", - "through": "2.3.8" + "buffer": "^3.0.1", + "through": "^2.3.6" } }, "unicode-canonical-property-names-ecmascript": { @@ -8470,8 +8465,8 @@ "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", "requires": { - "unicode-canonical-property-names-ecmascript": "1.0.4", - "unicode-property-aliases-ecmascript": "1.0.4" + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" } }, "unicode-match-property-value-ecmascript": { @@ -8489,10 +8484,10 @@ "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" }, "dependencies": { "arr-union": { @@ -8505,7 +8500,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "set-value": { @@ -8513,10 +8508,10 @@ "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" } } } @@ -8536,8 +8531,8 @@ "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { "has-value": { @@ -8545,9 +8540,9 @@ "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" }, "dependencies": { "isobject": { @@ -8582,8 +8577,8 @@ "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz", "integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==", "requires": { - "querystringify": "2.0.0", - "requires-port": "1.0.0" + "querystringify": "^2.0.0", + "requires-port": "^1.0.0" } }, "use": { @@ -8624,8 +8619,8 @@ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "vary": { @@ -8638,9 +8633,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" }, "dependencies": { "assert-plus": { @@ -8655,7 +8650,7 @@ "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", "requires": { - "makeerror": "1.0.11" + "makeerror": "1.0.x" } }, "watch": { @@ -8663,8 +8658,8 @@ "resolved": "https://registry.npmjs.org/watch/-/watch-0.18.0.tgz", "integrity": "sha1-KAlUdsbffJDJYxOJkMClQj60uYY=", "requires": { - "exec-sh": "0.2.2", - "minimist": "1.2.0" + "exec-sh": "^0.2.0", + "minimist": "^1.2.0" } }, "whatwg-fetch": { @@ -8677,7 +8672,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -8690,7 +8685,7 @@ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "requires": { - "string-width": "2.1.1" + "string-width": "^1.0.2 || 2" } }, "wordwrap": { @@ -8703,8 +8698,8 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { "is-fullwidth-code-point": { @@ -8712,7 +8707,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "string-width": { @@ -8720,9 +8715,9 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } } } @@ -8738,7 +8733,7 @@ "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, "requires": { - "mkdirp": "0.5.1" + "mkdirp": "^0.5.1" } }, "write-file-atomic": { @@ -8746,9 +8741,9 @@ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "slide": "1.1.6" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" } }, "ws": { @@ -8756,8 +8751,8 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", "requires": { - "options": "0.0.6", - "ultron": "1.0.2" + "options": ">=0.0.5", + "ultron": "1.0.x" } }, "xcode": { @@ -8765,8 +8760,8 @@ "resolved": "https://registry.npmjs.org/xcode/-/xcode-0.9.3.tgz", "integrity": "sha1-kQqJwWrubMC0LKgFptC0z4chHPM=", "requires": { - "pegjs": "0.10.0", - "simple-plist": "0.2.1", + "pegjs": "^0.10.0", + "simple-plist": "^0.2.1", "uuid": "3.0.1" }, "dependencies": { @@ -8792,7 +8787,7 @@ "resolved": "https://registry.npmjs.org/xmldoc/-/xmldoc-0.4.0.tgz", "integrity": "sha1-0lciS+g5PqrL+DfvIn/Y7CWzaIg=", "requires": { - "sax": "1.1.6" + "sax": "~1.1.1" } }, "xmldom": { @@ -8825,19 +8820,19 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-9.0.1.tgz", "integrity": "sha1-UqzCP+7Kw0BCB47njAwAf1CF20w=", "requires": { - "camelcase": "4.1.0", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.3", - "os-locale": "2.1.0", - "read-pkg-up": "2.0.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "7.0.0" + "camelcase": "^4.1.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "read-pkg-up": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^7.0.0" } }, "yargs-parser": { @@ -8845,7 +8840,7 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" } }, "yauzl": { @@ -8853,8 +8848,8 @@ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", "requires": { - "buffer-crc32": "0.2.13", - "fd-slicer": "1.1.0" + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" } } } diff --git a/package.json b/package.json index 11c62a8..10449e5 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "react-native-modal-datetime-picker-nevo": "^4.11.0", "react-native-push-notification": "^3.1.1", "react-native-share": "^1.1.0", - "react-native-simple-radio-button": "^2.7.1", "react-native-vector-icons": "^5.0.0", "react-navigation": "^2.0.4", "realm": "^2.7.1", diff --git a/styles/index.js b/styles/index.js index 9a1e6a9..b357a82 100644 --- a/styles/index.js +++ b/styles/index.js @@ -5,6 +5,9 @@ export const secondaryColor = '#351c4d' export const fontOnPrimaryColor = 'white' export default StyleSheet.create({ + appText: { + color: 'black' + }, welcome: { fontSize: 20, margin: 30, @@ -25,6 +28,8 @@ export default StyleSheet.create({ }, symptomViewHeading: { fontSize: 20, + color: 'black', + marginBottom: 5 }, symptomBoxImage: { width: 50, @@ -208,6 +213,9 @@ export default StyleSheet.create({ flexWrap: 'wrap', marginVertical: 10, }, + radioButtonGroup: { + marginTop: 10 + }, radioButton: { width: 20, height: 20, @@ -215,7 +223,8 @@ export default StyleSheet.create({ borderStyle: 'solid', borderWidth: 2, borderColor: secondaryColor, - marginBottom: 5, + marginBottom: 3, + marginRight: 10, alignItems: 'center', justifyContent: 'center' }, @@ -225,17 +234,13 @@ export default StyleSheet.create({ borderRadius: 100, backgroundColor: secondaryColor }, - radioButtonGroup: { - flexDirection: 'row', - flexWrap: 'wrap', - marginVertical: 10, - }, radioButtonTextGroup: { - alignItems: 'center', - marginHorizontal: 10 + marginRight: 10, + flexDirection: 'row', + marginBottom: 10 }, page: { - padding: 10 + marginHorizontal: 10 } }) From 1d0b2497b442071056f0792b1c8320e314e9a660 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 18:28:05 +0200 Subject: [PATCH 05/60] Make select box text a child not a prop --- components/cycle-day/select-box.js | 2 +- components/cycle-day/symptoms/sex.js | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/cycle-day/select-box.js b/components/cycle-day/select-box.js index 4fcdd29..62daece 100644 --- a/components/cycle-day/select-box.js +++ b/components/cycle-day/select-box.js @@ -17,7 +17,7 @@ export default class SelectBox extends Component { return ( - {this.props.label} + {this.props.children} ) diff --git a/components/cycle-day/symptoms/sex.js b/components/cycle-day/symptoms/sex.js index ddb1831..248ef40 100644 --- a/components/cycle-day/symptoms/sex.js +++ b/components/cycle-day/symptoms/sex.js @@ -63,9 +63,10 @@ export default class Sex extends Component { this.toggleState(stateKey)} - label={label} key={stateKey} - /> + > + {label} + ) }) } @@ -85,12 +86,14 @@ export default class Sex extends Component { {this.makeSelectBoxes(contraceptiveBoxes)} { this.toggleState('other') this.setState({ focusTextArea: true }) }} - /> + > + {contraceptiveLabels.other} + + {this.state.other && Date: Sat, 1 Sep 2018 19:11:44 +0200 Subject: [PATCH 06/60] Convert radio button group to select tab group --- components/cycle-day/radio-button-group.js | 36 ----------------- components/cycle-day/select-tab-group.js | 46 ++++++++++++++++++++++ components/cycle-day/symptoms/bleeding.js | 4 +- components/cycle-day/symptoms/cervix.js | 8 ++-- components/cycle-day/symptoms/desire.js | 4 +- components/cycle-day/symptoms/mucus.js | 6 +-- styles/index.js | 38 +++++++++--------- 7 files changed, 77 insertions(+), 65 deletions(-) delete mode 100644 components/cycle-day/radio-button-group.js create mode 100644 components/cycle-day/select-tab-group.js diff --git a/components/cycle-day/radio-button-group.js b/components/cycle-day/radio-button-group.js deleted file mode 100644 index 8b7ffac..0000000 --- a/components/cycle-day/radio-button-group.js +++ /dev/null @@ -1,36 +0,0 @@ -import React, { Component } from 'react' -import { - View, - TouchableOpacity, -} from 'react-native' -import styles from '../../styles' -import { AppText } from '../app-text' - -export default class RadioButton extends Component { - render() { - return ( - - { - this.props.buttons.map(({ label, value }) => { - const isActive = value === this.props.active - return ( - this.props.onSelect(value)} - key={value} - activeOpacity={1} - > - - - {isActive ? - : null} - - {label} - - - ) - }) - } - - ) - } -} \ No newline at end of file diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js new file mode 100644 index 0000000..f402240 --- /dev/null +++ b/components/cycle-day/select-tab-group.js @@ -0,0 +1,46 @@ +import React, { Component } from 'react' +import { + View, + TouchableOpacity, +} from 'react-native' +import styles from '../../styles' +import { AppText } from '../app-text' + +export default class SelectTabGroup extends Component { + render() { + return ( + + { + this.props.buttons.map(({ label, value }, i) => { + let firstOrLastStyle + if (i === this.props.buttons.length - 1) { + firstOrLastStyle = styles.selectTabLast + } else if (i === 0) { + firstOrLastStyle = styles.selectTabFirst + } + let activeStyle + const isActive = value === this.props.active + if (isActive) activeStyle = styles.selectTabActive + return ( + this.props.onSelect(value)} + key={value} + activeOpacity={1} + > + + + {label} + + + + ) + }) + } + + ) + } +} \ No newline at end of file diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index 57a084a..1321162 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -8,7 +8,7 @@ import styles from '../../../styles' import { saveSymptom } from '../../../db' import { bleeding as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' -import RadioButtonGroup from '../radio-button-group' +import SelectTabGroup from '../select-tab-group' import { SymptomSectionHeader, AppText } from '../../app-text' export default class Bleeding extends Component { @@ -39,7 +39,7 @@ export default class Bleeding extends Component { Heaviness How heavy is the bleeding? - this.setState({ currentValue: val })} diff --git a/components/cycle-day/symptoms/cervix.js b/components/cycle-day/symptoms/cervix.js index 86d46aa..ba1872e 100644 --- a/components/cycle-day/symptoms/cervix.js +++ b/components/cycle-day/symptoms/cervix.js @@ -12,7 +12,7 @@ import { cervixPosition as positionLabels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' -import RadioButtonGroup from '../radio-button-group' +import SelectTabGroup from '../select-tab-group' import { SymptomSectionHeader } from '../../app-text' export default class Cervix extends Component { @@ -54,19 +54,19 @@ export default class Cervix extends Component { Opening - this.setState({ opening: val })} /> Firmness - this.setState({ firmness: val })} /> Position - this.setState({ position: val })} diff --git a/components/cycle-day/symptoms/desire.js b/components/cycle-day/symptoms/desire.js index 64a0306..d78bcff 100644 --- a/components/cycle-day/symptoms/desire.js +++ b/components/cycle-day/symptoms/desire.js @@ -7,7 +7,7 @@ import styles from '../../../styles' import { saveSymptom } from '../../../db' import { intensity as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' -import RadioButtonGroup from '../radio-button-group' +import SelectTabGroup from '../select-tab-group' export default class Desire extends Component { constructor(props) { @@ -31,7 +31,7 @@ export default class Desire extends Component { - this.setState({ currentValue: val })} diff --git a/components/cycle-day/symptoms/mucus.js b/components/cycle-day/symptoms/mucus.js index f8c3534..586fcb2 100644 --- a/components/cycle-day/symptoms/mucus.js +++ b/components/cycle-day/symptoms/mucus.js @@ -12,7 +12,7 @@ import { } from '../labels/labels' import computeSensiplanValue from '../../../lib/sensiplan-mucus' import ActionButtonFooter from './action-button-footer' -import RadioButtonGroup from '../radio-button-group' +import SelectTabGroup from '../select-tab-group' import { SymptomSectionHeader } from '../../app-text' @@ -52,13 +52,13 @@ export default class Mucus extends Component { Feeling - this.setState({ feeling: val })} active={this.state.feeling} /> Texture - this.setState({ texture: val })} active={this.state.texture} diff --git a/styles/index.js b/styles/index.js index b357a82..e3fd7d2 100644 --- a/styles/index.js +++ b/styles/index.js @@ -213,31 +213,33 @@ export default StyleSheet.create({ flexWrap: 'wrap', marginVertical: 10, }, - radioButtonGroup: { - marginTop: 10 + selectTabGroup: { + marginTop: 10, + flexDirection: 'row' }, - radioButton: { - width: 20, - height: 20, - borderRadius: 100, + selectTab: { + backgroundColor: 'lightgrey', borderStyle: 'solid', - borderWidth: 2, - borderColor: secondaryColor, + borderLeftWidth: 1, + paddingVertical: 10, + paddingHorizontal: 15, + borderColor: 'white', marginBottom: 3, - marginRight: 10, alignItems: 'center', justifyContent: 'center' }, - radioButtonActiveDot: { - width: 10, - height: 10, - borderRadius: 100, - backgroundColor: secondaryColor + selectTabActive: { + backgroundColor: secondaryColor, + color: fontOnPrimaryColor }, - radioButtonTextGroup: { - marginRight: 10, - flexDirection: 'row', - marginBottom: 10 + selectTabLast: { + borderTopRightRadius: 10, + borderBottomRightRadius: 10, + }, + selectTabFirst: { + borderTopLeftRadius: 10, + borderBottomLeftRadius: 10, + borderLeftWidth: null }, page: { marginHorizontal: 10 From 2ec6626b4e013f9bbada16df18625c8d5560e27c Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 19:36:04 +0200 Subject: [PATCH 07/60] Use select box group instead of single select boxes --- components/cycle-day/select-box-group.js | 34 ++++++++++++++++++ components/cycle-day/select-box.js | 25 ------------- components/cycle-day/symptoms/sex.js | 45 ++++++++++-------------- 3 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 components/cycle-day/select-box-group.js delete mode 100644 components/cycle-day/select-box.js diff --git a/components/cycle-day/select-box-group.js b/components/cycle-day/select-box-group.js new file mode 100644 index 0000000..bde9177 --- /dev/null +++ b/components/cycle-day/select-box-group.js @@ -0,0 +1,34 @@ +import React, { Component } from 'react' +import { + View, + TouchableOpacity, +} from 'react-native' +import styles from '../../styles' +import { AppText } from '../app-text' + +export default class SelectBoxGroup extends Component { + render() { + return ( + + {this.props.data.map(({ label, stateKey }) => { + const style = [styles.selectBox] + const textStyle = [] + if (this.props.optionsState[stateKey]) { + style.push(styles.selectBoxActive) + textStyle.push(styles.selectBoxTextActive) + } + return ( + this.props.onSelect(stateKey)} + key={stateKey} + > + + {label} + + + ) + })} + + ) + } +} \ No newline at end of file diff --git a/components/cycle-day/select-box.js b/components/cycle-day/select-box.js deleted file mode 100644 index 62daece..0000000 --- a/components/cycle-day/select-box.js +++ /dev/null @@ -1,25 +0,0 @@ -import React, { Component } from 'react' -import { - View, - TouchableOpacity, -} from 'react-native' -import styles from '../../styles' -import { AppText } from '../app-text' - -export default class SelectBox extends Component { - render () { - const style = [styles.selectBox] - const textStyle = [] - if (this.props.value) { - style.push(styles.selectBoxActive) - textStyle.push(styles.selectBoxTextActive) - } - return ( - - - {this.props.children} - - - ) - } -} \ No newline at end of file diff --git a/components/cycle-day/symptoms/sex.js b/components/cycle-day/symptoms/sex.js index 248ef40..0019eb4 100644 --- a/components/cycle-day/symptoms/sex.js +++ b/components/cycle-day/symptoms/sex.js @@ -11,7 +11,7 @@ import { contraceptives as contraceptiveLabels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' -import SelectBox from '../select-box' +import SelectBoxGroup from '../select-box-group' import { SymptomSectionHeader } from '../../app-text' const sexBoxes = [{ @@ -40,6 +40,9 @@ const contraceptiveBoxes = [{ }, { label: contraceptiveLabels.implant, stateKey: 'implant' +}, { + label: contraceptiveLabels.other, + stateKey: 'other' }] export default class Sex extends Component { @@ -57,23 +60,12 @@ export default class Sex extends Component { } } - makeSelectBoxes(boxes) { - return boxes.map(({ label, stateKey }) => { - return ( - this.toggleState(stateKey)} - key={stateKey} - > - {label} - - ) - }) - } - - toggleState(key) { + toggleState = (key) => { const curr = this.state[key] this.setState({[key]: !curr}) + if (key === 'other' && !curr) { + this.setState({focusTextArea: true}) + } } render() { @@ -81,18 +73,17 @@ export default class Sex extends Component { Activity - {this.makeSelectBoxes(sexBoxes)} + Contraceptives - {this.makeSelectBoxes(contraceptiveBoxes)} - { - this.toggleState('other') - this.setState({ focusTextArea: true }) - }} - > - {contraceptiveLabels.other} - + {this.state.other && Date: Sat, 1 Sep 2018 19:51:12 +0200 Subject: [PATCH 08/60] Remove unused style --- styles/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/styles/index.js b/styles/index.js index e3fd7d2..77ad045 100644 --- a/styles/index.js +++ b/styles/index.js @@ -148,9 +148,6 @@ export default StyleSheet.create({ symptomEditButton: { width: 130 }, - radioButtonRow: { - marginTop: 15, - }, statsIntro: { fontSize: 18, margin: 10, From ac9ff0dc03bbfcf9c3bc405bb2773076d2508662 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 19:53:54 +0200 Subject: [PATCH 09/60] Correct style --- styles/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/index.js b/styles/index.js index 77ad045..55b21c9 100644 --- a/styles/index.js +++ b/styles/index.js @@ -211,7 +211,7 @@ export default StyleSheet.create({ marginVertical: 10, }, selectTabGroup: { - marginTop: 10, + marginVertical: 10, flexDirection: 'row' }, selectTab: { From 083e55eee8a6ee05854a2e95298baec6d2012b3f Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 20:11:31 +0200 Subject: [PATCH 10/60] Apply select tab group to pain edit view --- components/cycle-day/cycle-day-overview.js | 10 +- components/cycle-day/symptoms/pain.js | 128 +++++++-------------- components/cycle-day/symptoms/sex.js | 18 +-- 3 files changed, 55 insertions(+), 101 deletions(-) diff --git a/components/cycle-day/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js index 21e0df8..9a058ee 100644 --- a/components/cycle-day/cycle-day-overview.js +++ b/components/cycle-day/cycle-day-overview.js @@ -98,16 +98,16 @@ export default class CycleDayOverView extends Component { data={getLabel('sex', cycleDay.sex)} disabled={dateInFuture} /> - this.navigate('NoteEditView')} - data={getLabel('note', cycleDay.note)} - /> this.navigate('PainEditView')} data={getLabel('pain', cycleDay.pain)} /> + this.navigate('NoteEditView')} + data={getLabel('note', cycleDay.note)} + /> {/* this is just to make the last row adhere to the grid (and) because there are no pseudo properties in RN */} diff --git a/components/cycle-day/symptoms/pain.js b/components/cycle-day/symptoms/pain.js index 6365065..18f80e4 100644 --- a/components/cycle-day/symptoms/pain.js +++ b/components/cycle-day/symptoms/pain.js @@ -1,17 +1,39 @@ import React, { Component } from 'react' import { - CheckBox, ScrollView, - Text, TextInput, View } from 'react-native' -import styles from '../../../styles' import { saveSymptom } from '../../../db' -import { - pain as painLabels -} from '../labels/labels' +import { pain as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' +import SelectBoxGroup from '../select-box-group' + +const boxes = [{ + label: labels.cramps, + stateKey: 'cramps' +}, { + label: labels.ovulationPain, + stateKey: 'ovulationPain' +}, { + label: labels.headache, + stateKey: 'headache' +}, { + label: labels.backache, + stateKey: 'backache' +}, { + label: labels.nausea, + stateKey: 'nausea' +}, { + label: labels.tenderBreasts, + stateKey: 'tenderBreasts' +}, { + label: labels.migraine, + stateKey: 'migraine' +}, { + label: labels.other, + stateKey: 'other' +}] export default class Pain extends Component { constructor(props) { @@ -26,92 +48,24 @@ export default class Pain extends Component { } } + toggleState = (key) => { + const curr = this.state[key] + this.setState({[key]: !curr}) + if (key === 'other' && !curr) { + this.setState({focusTextArea: true}) + } + } + render() { return ( - - {painLabels.cramps} - { - this.setState({cramps: val}) - }} - /> - - {painLabels.ovulationPain} - - { - this.setState({ovulationPain: val}) - }} - /> - - - - {painLabels.headache} - - { - this.setState({headache: val}) - }} - /> - - {painLabels.backache} - - { - this.setState({backache: val}) - }} - /> - - - - {painLabels.nausea} - - { - this.setState({nausea: val}) - }} - /> - - {painLabels.tenderBreasts} - - { - this.setState({tenderBreasts: val}) - }} - /> - - - - {painLabels.migraine} - - { - this.setState({migraine: val}) - }} - /> - - {painLabels.other} - - { - this.setState({ - other: val, - focusTextArea: true - }) - }} - /> - + { this.state.other && Date: Sat, 1 Sep 2018 20:15:27 +0200 Subject: [PATCH 11/60] Appease linter --- components/cycle-day/symptoms/bleeding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index 1321162..ecfaf20 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -47,7 +47,7 @@ export default class Bleeding extends Component { Exclude - You can exclude this value if it's not menstrual bleeding + {"You can exclude this value if it's not menstrual bleeding"} { From 9868e8a9436b0c64bb7f1c96f7b2e5665d743dd5 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 20:47:57 +0200 Subject: [PATCH 12/60] Add explainer texts to cervix --- components/cycle-day/labels/labels.js | 19 ++++++++++++++--- components/cycle-day/symptoms/cervix.js | 27 ++++++++++++------------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/components/cycle-day/labels/labels.js b/components/cycle-day/labels/labels.js index 90faf28..522686f 100644 --- a/components/cycle-day/labels/labels.js +++ b/components/cycle-day/labels/labels.js @@ -2,10 +2,23 @@ export const bleeding = ['spotting', 'light', 'medium', 'heavy'] export const mucusFeeling = ['dry', 'nothing', 'wet', 'slippery'] export const mucusTexture = ['nothing', 'creamy', 'egg white'] export const mucusNFP = ['t', 'Ø', 'f', 'S', 'S+'] -export const cervixOpening = ['closed', 'medium', 'open'] -export const cervixFirmness = ['hard', 'soft'] -export const cervixPosition = ['low', 'medium', 'high'] export const intensity = ['low', 'medium', 'high'] + +export const cervix = { + opening: { + categories: ['closed', 'medium', 'open'], + explainer: 'Is your cervix open or closed?' + }, + firmness: { + categories: ['hard', 'soft'], + explainer: "When it's hard it might feel like the tip of your nose" + }, + position: { + categories: ['low', 'medium', 'high'], + explainer: 'How high up in the vagina is the cervix?' + } +} + export const sex = { solo: 'Solo', partner: 'Partner', diff --git a/components/cycle-day/symptoms/cervix.js b/components/cycle-day/symptoms/cervix.js index ba1872e..a2ff978 100644 --- a/components/cycle-day/symptoms/cervix.js +++ b/components/cycle-day/symptoms/cervix.js @@ -6,14 +6,10 @@ import { } from 'react-native' import styles from '../../../styles' import { saveSymptom } from '../../../db' -import { - cervixOpening as openingLabels, - cervixFirmness as firmnessLabels, - cervixPosition as positionLabels -} from '../labels/labels' +import {cervix as labels} from '../labels/labels' import ActionButtonFooter from './action-button-footer' import SelectTabGroup from '../select-tab-group' -import { SymptomSectionHeader } from '../../app-text' +import { SymptomSectionHeader, AppText } from '../../app-text' export default class Cervix extends Component { constructor(props) { @@ -36,36 +32,39 @@ export default class Cervix extends Component { render() { const cervixOpeningRadioProps = [ - {label: openingLabels[0], value: 0}, - {label: openingLabels[1], value: 1}, - {label: openingLabels[2], value: 2} + {label: labels.opening.categories[0], value: 0}, + {label: labels.opening.categories[1], value: 1}, + {label: labels.opening.categories[2], value: 2} ] const cervixFirmnessRadioProps = [ - {label: firmnessLabels[0], value: 0 }, - {label: firmnessLabels[1], value: 1 } + {label: labels.firmness.categories[0], value: 0 }, + {label: labels.firmness.categories[1], value: 1 } ] const cervixPositionRadioProps = [ - {label: positionLabels[0], value: 0 }, - {label: positionLabels[1], value: 1 }, - { label: positionLabels[2], value: 2 } + {label: labels.position.categories[0], value: 0 }, + {label: labels.position.categories[1], value: 1 }, + { label: labels.position.categories[2], value: 2 } ] return ( Opening + {labels.opening.explainer} this.setState({ opening: val })} /> Firmness + {labels.firmness.explainer} this.setState({ firmness: val })} /> Position + {labels.position.explainer} Date: Sat, 1 Sep 2018 20:53:30 +0200 Subject: [PATCH 13/60] Fix whitespace --- components/cycle-day/symptoms/cervix.js | 74 ++++++++++++------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/components/cycle-day/symptoms/cervix.js b/components/cycle-day/symptoms/cervix.js index a2ff978..b05f975 100644 --- a/components/cycle-day/symptoms/cervix.js +++ b/components/cycle-day/symptoms/cervix.js @@ -6,7 +6,7 @@ import { } from 'react-native' import styles from '../../../styles' import { saveSymptom } from '../../../db' -import {cervix as labels} from '../labels/labels' +import { cervix as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' import SelectTabGroup from '../select-tab-group' import { SymptomSectionHeader, AppText } from '../../app-text' @@ -32,53 +32,51 @@ export default class Cervix extends Component { render() { const cervixOpeningRadioProps = [ - {label: labels.opening.categories[0], value: 0}, - {label: labels.opening.categories[1], value: 1}, - {label: labels.opening.categories[2], value: 2} + { label: labels.opening.categories[0], value: 0 }, + { label: labels.opening.categories[1], value: 1 }, + { label: labels.opening.categories[2], value: 2 } ] const cervixFirmnessRadioProps = [ - {label: labels.firmness.categories[0], value: 0 }, - {label: labels.firmness.categories[1], value: 1 } + { label: labels.firmness.categories[0], value: 0 }, + { label: labels.firmness.categories[1], value: 1 } ] const cervixPositionRadioProps = [ - {label: labels.position.categories[0], value: 0 }, - {label: labels.position.categories[1], value: 1 }, + { label: labels.position.categories[0], value: 0 }, + { label: labels.position.categories[1], value: 1 }, { label: labels.position.categories[2], value: 2 } ] return ( - - Opening - {labels.opening.explainer} - this.setState({ opening: val })} + Opening + {labels.opening.explainer} + this.setState({ opening: val })} + /> + Firmness + {labels.firmness.explainer} + this.setState({ firmness: val })} + /> + Position + {labels.position.explainer} + this.setState({ position: val })} + /> + + Exclude + { + this.setState({ exclude: val }) + }} + value={this.state.exclude} /> - Firmness - {labels.firmness.explainer} - this.setState({ firmness: val })} - /> - Position - {labels.position.explainer} - this.setState({ position: val })} - /> - - Exclude - { - this.setState({ exclude: val }) - }} - value={this.state.exclude} - /> - Date: Sat, 1 Sep 2018 20:53:37 +0200 Subject: [PATCH 14/60] Add explainer to desire --- components/cycle-day/labels/labels.js | 5 +++++ components/cycle-day/symptoms/desire.js | 23 ++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/components/cycle-day/labels/labels.js b/components/cycle-day/labels/labels.js index 522686f..a1f3990 100644 --- a/components/cycle-day/labels/labels.js +++ b/components/cycle-day/labels/labels.js @@ -19,6 +19,11 @@ export const cervix = { } } +export const desire = { + header: 'Intensity', + explainer: 'How would you rate your sexual desire?' +} + export const sex = { solo: 'Solo', partner: 'Partner', diff --git a/components/cycle-day/symptoms/desire.js b/components/cycle-day/symptoms/desire.js index d78bcff..0802e6c 100644 --- a/components/cycle-day/symptoms/desire.js +++ b/components/cycle-day/symptoms/desire.js @@ -5,9 +5,10 @@ import { } from 'react-native' import styles from '../../../styles' import { saveSymptom } from '../../../db' -import { intensity as labels } from '../labels/labels' +import { intensity, desire } from '../labels/labels' import ActionButtonFooter from './action-button-footer' import SelectTabGroup from '../select-tab-group' +import { SymptomSectionHeader, AppText } from '../../app-text'; export default class Desire extends Component { constructor(props) { @@ -23,20 +24,20 @@ export default class Desire extends Component { render() { const desireRadioProps = [ - { label: labels[0], value: 0 }, - { label: labels[1], value: 1 }, - { label: labels[2], value: 2 } + { label: intensity[0], value: 0 }, + { label: intensity[1], value: 1 }, + { label: intensity[2], value: 2 } ] return ( - - this.setState({ currentValue: val })} - /> - + {desire.header} + {desire.explainer} + this.setState({ currentValue: val })} + /> Date: Sat, 1 Sep 2018 21:17:54 +0200 Subject: [PATCH 15/60] Make symptom section component --- components/cycle-day/symptoms/bleeding.js | 35 ++++++----- components/cycle-day/symptoms/cervix.js | 62 +++++++++++-------- components/cycle-day/symptoms/desire.js | 19 +++--- .../cycle-day/symptoms/symptom-section.js | 19 ++++++ 4 files changed, 85 insertions(+), 50 deletions(-) create mode 100644 components/cycle-day/symptoms/symptom-section.js diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index ecfaf20..25e697c 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -9,7 +9,7 @@ import { saveSymptom } from '../../../db' import { bleeding as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' import SelectTabGroup from '../select-tab-group' -import { SymptomSectionHeader, AppText } from '../../app-text' +import SymptomSection from './symptom-section' export default class Bleeding extends Component { constructor(props) { @@ -36,27 +36,28 @@ export default class Bleeding extends Component { return ( - - Heaviness - How heavy is the bleeding? + this.setState({ currentValue: val })} /> - Exclude - - - {"You can exclude this value if it's not menstrual bleeding"} - - { - this.setState({ exclude: val }) - }} - value={this.state.exclude} - /> - - + + + { + this.setState({ exclude: val }) + }} + value={this.state.exclude} + /> + - Opening - {labels.opening.explainer} - this.setState({ opening: val })} - /> - Firmness - {labels.firmness.explainer} - this.setState({ firmness: val })} - /> - Position - {labels.position.explainer} - this.setState({ position: val })} - /> - - Exclude + + this.setState({ opening: val })} + /> + + + this.setState({ firmness: val })} + /> + + + this.setState({ position: val })} + /> + + { this.setState({ exclude: val }) }} value={this.state.exclude} /> - + - {desire.header} - {desire.explainer} - this.setState({ currentValue: val })} - /> + + this.setState({ currentValue: val })} + /> + + {this.props.header} + + + {this.props.explainer} + + {this.props.children} + + + ) + } +} \ No newline at end of file From cffa42ed1c8513bf7c2c50d6690b9fb53600fa97 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 22:01:05 +0200 Subject: [PATCH 16/60] Add explainers to mucus --- components/cycle-day/labels/labels.js | 14 ++++++- components/cycle-day/symptoms/mucus.js | 56 ++++++++++++++------------ 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/components/cycle-day/labels/labels.js b/components/cycle-day/labels/labels.js index a1f3990..c0af37b 100644 --- a/components/cycle-day/labels/labels.js +++ b/components/cycle-day/labels/labels.js @@ -1,6 +1,4 @@ export const bleeding = ['spotting', 'light', 'medium', 'heavy'] -export const mucusFeeling = ['dry', 'nothing', 'wet', 'slippery'] -export const mucusTexture = ['nothing', 'creamy', 'egg white'] export const mucusNFP = ['t', 'Ø', 'f', 'S', 'S+'] export const intensity = ['low', 'medium', 'high'] @@ -19,6 +17,18 @@ export const cervix = { } } +export const mucus = { + feeling: { + categories: ['dry', 'nothing', 'wet', 'slippery'], + explainer: 'What does your vaginal entrance feel like?' + }, + texture: { + categories: ['nothing', 'creamy', 'egg white'], + explainer: "Looking at and touching your cervical mucus, which describes it best?" + }, + excludeExplainer: "You can exclude this value if you don't want to use it for fertility detection" +} + export const desire = { header: 'Intensity', explainer: 'How would you rate your sexual desire?' diff --git a/components/cycle-day/symptoms/mucus.js b/components/cycle-day/symptoms/mucus.js index 586fcb2..d1b7966 100644 --- a/components/cycle-day/symptoms/mucus.js +++ b/components/cycle-day/symptoms/mucus.js @@ -6,14 +6,11 @@ import { } from 'react-native' import styles from '../../../styles' import { saveSymptom } from '../../../db' -import { - mucusFeeling as feelingLabels, - mucusTexture as textureLabels -} from '../labels/labels' +import { mucus as labels } from '../labels/labels' import computeSensiplanValue from '../../../lib/sensiplan-mucus' import ActionButtonFooter from './action-button-footer' import SelectTabGroup from '../select-tab-group' -import { SymptomSectionHeader } from '../../app-text' +import SymptomSection from './symptom-section'; export default class Mucus extends Component { @@ -37,42 +34,51 @@ export default class Mucus extends Component { render() { const mucusFeeling = [ - { label: feelingLabels[0], stateKey: ''}, - { label: feelingLabels[1], value: 1 }, - { label: feelingLabels[2], value: 2 }, - { label: feelingLabels[3], value: 3 } + { label: labels.feeling.categories[0], stateKey: ''}, + { label: labels.feeling.categories[1], value: 1 }, + { label: labels.feeling.categories[2], value: 2 }, + { label: labels.feeling.categories[3], value: 3 } ] const mucusTexture = [ - { label: textureLabels[0], value: 0 }, - { label: textureLabels[1], value: 1 }, - { label: textureLabels[2], value: 2 } + { label: labels.texture.categories[0], value: 0 }, + { label: labels.texture.categories[1], value: 1 }, + { label: labels.texture.categories[2], value: 2 } ] return ( - - Feeling + this.setState({ feeling: val })} active={this.state.feeling} /> - Texture + + this.setState({ texture: val })} active={this.state.texture} /> - - Exclude - { - this.setState({ exclude: val }) - }} - value={this.state.exclude} - /> - - + + + { + this.setState({ exclude: val }) + }} + value={this.state.exclude} + /> + Date: Sat, 1 Sep 2018 22:19:05 +0200 Subject: [PATCH 17/60] Add explainer to note --- components/cycle-day/labels/labels.js | 2 ++ components/cycle-day/symptoms/mucus.js | 10 ++++++---- components/cycle-day/symptoms/note.js | 8 ++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/components/cycle-day/labels/labels.js b/components/cycle-day/labels/labels.js index c0af37b..2d200b0 100644 --- a/components/cycle-day/labels/labels.js +++ b/components/cycle-day/labels/labels.js @@ -70,3 +70,5 @@ export const temperature = { outOfAbsoluteRangeWarning: 'This temperature value is too high or low to be shown on the temperature chart.', saveAnyway: 'Save anyway' } + +export const noteExplainer = "Anything you want to add for the day?" diff --git a/components/cycle-day/symptoms/mucus.js b/components/cycle-day/symptoms/mucus.js index d1b7966..6e80ffc 100644 --- a/components/cycle-day/symptoms/mucus.js +++ b/components/cycle-day/symptoms/mucus.js @@ -10,7 +10,7 @@ import { mucus as labels } from '../labels/labels' import computeSensiplanValue from '../../../lib/sensiplan-mucus' import ActionButtonFooter from './action-button-footer' import SelectTabGroup from '../select-tab-group' -import SymptomSection from './symptom-section'; +import SymptomSection from './symptom-section' export default class Mucus extends Component { @@ -84,10 +84,12 @@ export default class Mucus extends Component { symptom='mucus' cycleDay={this.cycleDay} saveAction={() => { + const feeling = this.state.feeling + const texture = this.state.texture saveSymptom('mucus', this.cycleDay, { - feeling: this.state.feeling, - texture: this.state.texture, - value: computeSensiplanValue(this.state.feeling, this.state.texture), + feeling, + texture, + value: computeSensiplanValue(feeling, texture), exclude: this.state.exclude }) }} diff --git a/components/cycle-day/symptoms/note.js b/components/cycle-day/symptoms/note.js index d43c5fe..93d8e19 100644 --- a/components/cycle-day/symptoms/note.js +++ b/components/cycle-day/symptoms/note.js @@ -8,6 +8,8 @@ import { import styles from '../../../styles' import { saveSymptom } from '../../../db' import ActionButtonFooter from './action-button-footer' +import SymptomSection from './symptom-section' +import { noteExplainer } from '../labels/labels' export default class Note extends Component { constructor(props) { @@ -25,7 +27,9 @@ export default class Note extends Component { return ( - + - + Date: Sat, 1 Sep 2018 22:39:01 +0200 Subject: [PATCH 18/60] Fix labels on overview --- components/cycle-day/cycle-day-overview.js | 46 +++++++++++++--------- components/cycle-day/labels/labels.js | 21 +++++----- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/components/cycle-day/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js index 9a058ee..4076936 100644 --- a/components/cycle-day/cycle-day-overview.js +++ b/components/cycle-day/cycle-day-overview.js @@ -11,20 +11,19 @@ import { getOrCreateCycleDay } from '../../db' import cycleModule from '../../lib/cycle' import Icon from 'react-native-vector-icons/FontAwesome' import styles, { iconStyles } from '../../styles' -import { - bleeding as bleedingLabels, - mucusFeeling as feelingLabels, - mucusTexture as textureLabels, - mucusNFP as computeSensiplanMucusLabels, - cervixOpening as openingLabels, - cervixFirmness as firmnessLabels, - cervixPosition as positionLabels, - intensity as intensityLabels, - pain as painLabels, - sex as sexLabels -} from './labels/labels' +import * as labels from './labels/labels' import { AppText } from '../app-text' +const bleedingLabels = labels.bleeding +const feelingLabels = labels.mucus.feeling.categories +const textureLabels = labels.mucus.texture.categories +const openingLabels = labels.cervix.opening.categories +const firmnessLabels = labels.cervix.firmness.categories +const positionLabels = labels.cervix.position.categories +const intensityLabels = labels.intensity +const sexLabels = labels.sex +const painLabels = labels.pain.categories + export default class CycleDayOverView extends Component { constructor(props) { super(props) @@ -51,7 +50,9 @@ export default class CycleDayOverView extends Component { const cycleDay = this.state.cycleDay const getCycleDayNumber = cycleModule().getCycleDayNumber const cycleDayNumber = getCycleDayNumber(cycleDay.date) - const dateInFuture = LocalDate.now().isBefore(LocalDate.parse(this.state.cycleDay.date)) + const dateInFuture = LocalDate + .now() + .isBefore(LocalDate.parse(this.state.cycleDay.date)) return (
{ if (typeof bleeding.value === 'number') { let bleedingLabel = `${bleedingLabels[bleeding.value]}` @@ -140,7 +141,7 @@ function getLabel(symptomName, symptom) { const categories = ['feeling', 'texture', 'value'] if (categories.every(c => typeof mucus[c] === 'number')) { let mucusLabel = [feelingLabels[mucus.feeling], textureLabels[mucus.texture]].join(', ') - mucusLabel += `\n${computeSensiplanMucusLabels[mucus.value]}` + mucusLabel += `\n${labels.mucusNFP[mucus.value]}` if (mucus.exclude) mucusLabel = `(${mucusLabel})` return mucusLabel } @@ -210,7 +211,7 @@ function getLabel(symptomName, symptom) { } if (!symptom) return - const label = labels[symptomName](symptom) + const label = l[symptomName](symptom) if (label.length < 45) return label return label.slice(0, 42) + '...' } @@ -221,18 +222,25 @@ class SymptomBox extends Component { const d = this.props.data const boxActive = d ? styles.symptomBoxActive : {} const iconActive = d ? iconStyles.symptomBoxActive : {} - const iconStyle = Object.assign({}, iconStyles.symptomBox, iconActive, disabledStyle) + const iconStyle = Object.assign( + {}, iconStyles.symptomBox, iconActive, disabledStyle + ) const textActive = d ? styles.symptomTextActive : {} const disabledStyle = this.props.disabled ? styles.symptomInFuture : {} return ( - + - {this.props.title} + + {this.props.title} + {this.props.data} diff --git a/components/cycle-day/labels/labels.js b/components/cycle-day/labels/labels.js index 2d200b0..d8ebd2c 100644 --- a/components/cycle-day/labels/labels.js +++ b/components/cycle-day/labels/labels.js @@ -47,15 +47,18 @@ export const sex = { } export const pain = { - cramps: 'Cramps', - ovulationPain: 'Ovulation pain', - headache: 'Headache', - backache: 'Backache', - nausea: 'Nausea', - tenderBreasts: 'Tender breasts', - migraine: 'Migraine', - other: 'Other', - note: 'Note' + categories: { + cramps: 'Cramps', + ovulationPain: 'Ovulation pain', + headache: 'Headache', + backache: 'Backache', + nausea: 'Nausea', + tenderBreasts: 'Tender breasts', + migraine: 'Migraine', + other: 'Other', + note: 'Note', + }, + explainer: 'How did your body feel today?' } export const fertilityStatus = { From 4768057e32e615c2370d127156c3b47c5d4bb455 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 22:39:10 +0200 Subject: [PATCH 19/60] Fix typo --- components/cycle-day/symptoms/desire.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cycle-day/symptoms/desire.js b/components/cycle-day/symptoms/desire.js index 9377603..d9be3b3 100644 --- a/components/cycle-day/symptoms/desire.js +++ b/components/cycle-day/symptoms/desire.js @@ -37,7 +37,7 @@ export default class Desire extends Component { > this.setState({ currentValue: val })} /> From 51622867a23277046f0842da771cfd467e9b84bc Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 22:39:35 +0200 Subject: [PATCH 20/60] Add explainer to pain --- components/cycle-day/symptoms/pain.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/components/cycle-day/symptoms/pain.js b/components/cycle-day/symptoms/pain.js index 18f80e4..cc103bc 100644 --- a/components/cycle-day/symptoms/pain.js +++ b/components/cycle-day/symptoms/pain.js @@ -8,30 +8,32 @@ import { saveSymptom } from '../../../db' import { pain as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' import SelectBoxGroup from '../select-box-group' +import SymptomSection from './symptom-section' +const categories = labels.categories const boxes = [{ - label: labels.cramps, + label: categories.cramps, stateKey: 'cramps' }, { - label: labels.ovulationPain, + label: categories.ovulationPain, stateKey: 'ovulationPain' }, { - label: labels.headache, + label: categories.headache, stateKey: 'headache' }, { - label: labels.backache, + label: categories.backache, stateKey: 'backache' }, { - label: labels.nausea, + label: categories.nausea, stateKey: 'nausea' }, { - label: labels.tenderBreasts, + label: categories.tenderBreasts, stateKey: 'tenderBreasts' }, { - label: labels.migraine, + label: categories.migraine, stateKey: 'migraine' }, { - label: labels.other, + label: categories.other, stateKey: 'other' }] @@ -60,7 +62,9 @@ export default class Pain extends Component { return ( - + } - + Date: Sat, 1 Sep 2018 22:46:02 +0200 Subject: [PATCH 21/60] Add explainers to sex view --- components/cycle-day/labels/labels.js | 4 +- components/cycle-day/symptoms/sex.js | 54 +++++++++++++++------------ 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/components/cycle-day/labels/labels.js b/components/cycle-day/labels/labels.js index d8ebd2c..05473c1 100644 --- a/components/cycle-day/labels/labels.js +++ b/components/cycle-day/labels/labels.js @@ -43,7 +43,9 @@ export const sex = { patch: 'Patch', ring: 'Ring', implant: 'Implant', - other: 'Other' + other: 'Other', + activityExplainer: 'Were you sexually active today?', + contraceptiveExplainer: 'Did you use contraceptives?' } export const pain = { diff --git a/components/cycle-day/symptoms/sex.js b/components/cycle-day/symptoms/sex.js index adcfcef..a51b5c0 100644 --- a/components/cycle-day/symptoms/sex.js +++ b/components/cycle-day/symptoms/sex.js @@ -6,39 +6,39 @@ import { } from 'react-native' import styles from '../../../styles' import { saveSymptom } from '../../../db' -import { sex as sexLabels } from '../labels/labels' +import { sex as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' import SelectBoxGroup from '../select-box-group' -import { SymptomSectionHeader } from '../../app-text' +import SymptomSection from './symptom-section' const sexBoxes = [{ - label: sexLabels.solo, + label: labels.solo, stateKey: 'solo' }, { - label: sexLabels.partner, + label: labels.partner, stateKey: 'partner' }] const contraceptiveBoxes = [{ - label: sexLabels.condom, + label: labels.condom, stateKey: 'condom' }, { - label: sexLabels.pill, + label: labels.pill, stateKey: 'pill' }, { - label: sexLabels.iud, + label: labels.iud, stateKey: 'iud' }, { - label: sexLabels.patch, + label: labels.patch, stateKey: 'patch' }, { - label: sexLabels.ring, + label: labels.ring, stateKey: 'ring' }, { - label: sexLabels.implant, + label: labels.implant, stateKey: 'implant' }, { - label: sexLabels.other, + label: labels.other, stateKey: 'other' }] @@ -69,18 +69,26 @@ export default class Sex extends Component { return ( - Activity - - Contraceptives - + + + + + + {this.state.other && Date: Sat, 1 Sep 2018 22:49:02 +0200 Subject: [PATCH 22/60] Remove old styles --- styles/index.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/styles/index.js b/styles/index.js index 55b21c9..f8f3dc8 100644 --- a/styles/index.js +++ b/styles/index.js @@ -81,17 +81,6 @@ export default StyleSheet.create({ symptomDataText: { fontSize: 12 }, - symptomEditRow: { - justifyContent: 'space-between', - marginBottom: 10, - }, - symptomViewRowInline: { - flexDirection: 'row', - justifyContent: 'space-between', - marginBottom: 10, - alignItems: 'center', - height: 50 - }, header: { backgroundColor: primaryColor, paddingHorizontal: 15, From 6fa18d70feffcc24be724e3aa41ea90dc92ee3ff Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 23:33:41 +0200 Subject: [PATCH 23/60] Add explainer to temperature --- components/cycle-day/labels/labels.js | 9 ++- components/cycle-day/symptoms/bleeding.js | 2 +- components/cycle-day/symptoms/cervix.js | 2 +- components/cycle-day/symptoms/mucus.js | 2 +- .../cycle-day/symptoms/symptom-section.js | 21 ++++-- components/cycle-day/symptoms/temperature.js | 66 +++++++++++-------- 6 files changed, 65 insertions(+), 37 deletions(-) diff --git a/components/cycle-day/labels/labels.js b/components/cycle-day/labels/labels.js index 05473c1..5566f73 100644 --- a/components/cycle-day/labels/labels.js +++ b/components/cycle-day/labels/labels.js @@ -73,7 +73,14 @@ export const fertilityStatus = { export const temperature = { outOfRangeWarning: 'This temperature value is out of the current range for the temperature chart. You can change the range in the settings.', outOfAbsoluteRangeWarning: 'This temperature value is too high or low to be shown on the temperature chart.', - saveAnyway: 'Save anyway' + saveAnyway: 'Save anyway', + temperature: { + explainer: 'Take your temperature right after waking up, before getting out of bed' + }, + note: { + explainer: 'Is there anything that could have influenced this value, such as bad sleep or alcohol consumption?' + }, + excludeExplainer: "You can exclude this value if you don't want to use it for fertility detection" } export const noteExplainer = "Anything you want to add for the day?" diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index 25e697c..76985f4 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -49,7 +49,7 @@ export default class Bleeding extends Component { { diff --git a/components/cycle-day/symptoms/cervix.js b/components/cycle-day/symptoms/cervix.js index 4b792be..7d2ce6c 100644 --- a/components/cycle-day/symptoms/cervix.js +++ b/components/cycle-day/symptoms/cervix.js @@ -81,7 +81,7 @@ export default class Cervix extends Component { { diff --git a/components/cycle-day/symptoms/mucus.js b/components/cycle-day/symptoms/mucus.js index 6e80ffc..ef730f7 100644 --- a/components/cycle-day/symptoms/mucus.js +++ b/components/cycle-day/symptoms/mucus.js @@ -70,7 +70,7 @@ export default class Mucus extends Component { { diff --git a/components/cycle-day/symptoms/symptom-section.js b/components/cycle-day/symptoms/symptom-section.js index c1af4d7..8d0603b 100644 --- a/components/cycle-day/symptoms/symptom-section.js +++ b/components/cycle-day/symptoms/symptom-section.js @@ -4,14 +4,25 @@ import { SymptomSectionHeader, AppText } from '../../app-text' export default class SymptomSection extends Component { render() { + const p = this.props + let placeHeadingInline + if (!p.explainer && p.inline) { + placeHeadingInline = { + flexDirection: 'row', + alignItems: "center" + } + } return ( - - {this.props.header} - + + {p.header} + - {this.props.explainer} + {p.explainer} - {this.props.children} + {p.children} ) diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index 336fa43..6be7111 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -12,12 +12,13 @@ import DateTimePicker from 'react-native-modal-datetime-picker-nevo' import { getPreviousTemperature, saveSymptom } from '../../../db' import styles from '../../../styles' import { LocalTime, ChronoUnit } from 'js-joda' -import { temperature as tempLabels } from '../labels/labels' +import { temperature as labels } from '../labels/labels' import { scaleObservable } from '../../../local-storage' import { shared } from '../../labels' import ActionButtonFooter from './action-button-footer' import config from '../../../config' import { SymptomSectionHeader } from '../../app-text' +import SymptomSection from './symptom-section' const minutes = ChronoUnit.MINUTES @@ -72,9 +73,9 @@ export default class Temp extends Component { const scale = scaleObservable.value let warningMsg if (value < absolute.min || value > absolute.max) { - warningMsg = tempLabels.outOfAbsoluteRangeWarning + warningMsg = labels.outOfAbsoluteRangeWarning } else if (value < scale.min || value > scale.max) { - warningMsg = tempLabels.outOfRangeWarning + warningMsg = labels.outOfRangeWarning } if (warningMsg) { @@ -98,16 +99,21 @@ export default class Temp extends Component { - - Temperature (°C) + this.setState(val)} isSuggestion={this.state.isSuggestion} /> - - - Time + + { @@ -116,40 +122,44 @@ export default class Temp extends Component { }} value={this.state.time} /> - - { - this.setState({ - time: `${jsDate.getHours()}:${jsDate.getMinutes()}`, - isTimePickerVisible: false - }) - }} - onCancel={() => this.setState({ isTimePickerVisible: false })} - /> - Note - + { + this.setState({ + time: `${jsDate.getHours()}:${jsDate.getMinutes()}`, + isTimePickerVisible: false + }) + }} + onCancel={() => this.setState({ isTimePickerVisible: false })} + /> + + { this.setState({ note: val }) }} /> - - - Exlude + + { this.setState({ exclude: val }) }} value={this.state.exclude} /> - + Date: Sat, 1 Sep 2018 23:35:50 +0200 Subject: [PATCH 24/60] Fix section layout --- components/cycle-day/symptoms/symptom-section.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/cycle-day/symptoms/symptom-section.js b/components/cycle-day/symptoms/symptom-section.js index 8d0603b..d29d7fb 100644 --- a/components/cycle-day/symptoms/symptom-section.js +++ b/components/cycle-day/symptoms/symptom-section.js @@ -16,8 +16,9 @@ export default class SymptomSection extends Component { {p.header} {p.explainer} From a2113a5ede7bb54eedebc0d7d3aa32e31c959f98 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 23:37:59 +0200 Subject: [PATCH 25/60] Fix key --- components/cycle-day/select-tab-group.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index f402240..a8673fd 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -24,7 +24,7 @@ export default class SelectTabGroup extends Component { return ( this.props.onSelect(value)} - key={value} + key={i} activeOpacity={1} > From be6545ec036238bb777e557d315b3bcc4bd2e973 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 23:44:14 +0200 Subject: [PATCH 26/60] Style fixes --- components/cycle-day/select-box-group.js | 2 +- components/cycle-day/symptoms/pain.js | 3 ++- styles/index.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/cycle-day/select-box-group.js b/components/cycle-day/select-box-group.js index bde9177..ca14494 100644 --- a/components/cycle-day/select-box-group.js +++ b/components/cycle-day/select-box-group.js @@ -9,7 +9,7 @@ import { AppText } from '../app-text' export default class SelectBoxGroup extends Component { render() { return ( - + {this.props.data.map(({ label, stateKey }) => { const style = [styles.selectBox] const textStyle = [] diff --git a/components/cycle-day/symptoms/pain.js b/components/cycle-day/symptoms/pain.js index cc103bc..9005d1e 100644 --- a/components/cycle-day/symptoms/pain.js +++ b/components/cycle-day/symptoms/pain.js @@ -9,6 +9,7 @@ import { pain as labels } from '../labels/labels' import ActionButtonFooter from './action-button-footer' import SelectBoxGroup from '../select-box-group' import SymptomSection from './symptom-section' +import styles from '../../../styles' const categories = labels.categories const boxes = [{ @@ -61,7 +62,7 @@ export default class Pain extends Component { render() { return ( - + diff --git a/styles/index.js b/styles/index.js index f8f3dc8..2108476 100644 --- a/styles/index.js +++ b/styles/index.js @@ -182,7 +182,8 @@ export default StyleSheet.create({ }, selectBox: { backgroundColor: 'lightgrey', - margin: 7, + marginRight: 7, + marginVertical: 5, paddingHorizontal: 15, paddingVertical: 10, borderRadius: 10 From 25018a35f31b7644ff489b17c63cf833e23c4962 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Sat, 1 Sep 2018 23:49:18 +0200 Subject: [PATCH 27/60] Remove unused import --- components/cycle-day/symptoms/temperature.js | 1 - 1 file changed, 1 deletion(-) diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index 6be7111..1e7c750 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -17,7 +17,6 @@ import { scaleObservable } from '../../../local-storage' import { shared } from '../../labels' import ActionButtonFooter from './action-button-footer' import config from '../../../config' -import { SymptomSectionHeader } from '../../app-text' import SymptomSection from './symptom-section' const minutes = ChronoUnit.MINUTES From 3ff7dd734080ec9db7087b0f1a3109ce1c8b419e Mon Sep 17 00:00:00 2001 From: emelko Date: Fri, 31 Aug 2018 00:36:19 +0200 Subject: [PATCH 28/60] Merge branch 'master' --- README.md | 3 + components/chart/day-column.js | 3 +- components/chart/styles.js | 5 + components/home.js | 14 +- db/fixtures.js | 28 +- db/index.js | 34 +- lib/sympto/cervix.js | 41 ++ lib/sympto/index.js | 38 +- test/sympto/cervix-temp-fixtures.js | 215 ++++++ test/sympto/cervix-temp.spec.js | 199 ++++++ test/sympto/cervix.spec.js | 114 +++ test/sympto/index.spec.js | 660 ----------------- .../{fixtures.js => mucus-temp-fixtures.js} | 50 +- test/sympto/mucus-temp.spec.js | 661 ++++++++++++++++++ 14 files changed, 1359 insertions(+), 706 deletions(-) create mode 100644 lib/sympto/cervix.js create mode 100644 test/sympto/cervix-temp-fixtures.js create mode 100644 test/sympto/cervix-temp.spec.js create mode 100644 test/sympto/cervix.spec.js delete mode 100644 test/sympto/index.spec.js rename test/sympto/{fixtures.js => mucus-temp-fixtures.js} (92%) create mode 100644 test/sympto/mucus-temp.spec.js diff --git a/README.md b/README.md index a186717..466431e 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,6 @@ You can run the tests with `npm test`. ## Debugging When running into an old version of the app try to run the following command first: `react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res` + +## NFP rules +More information about how the app calculates fertility status and bleeding predictions in the [wiki on Gitlab](https://gitlab.com/bloodyhealth/drip/wikis/home) diff --git a/components/chart/day-column.js b/components/chart/day-column.js index 268df06..20fbcf8 100644 --- a/components/chart/day-column.js +++ b/components/chart/day-column.js @@ -29,6 +29,7 @@ export default class DayColumn extends Component { temperatureExclude, bleeding, mucus, + cervix, drawFhmLine, drawLtlAt, rightY, @@ -135,4 +136,4 @@ export default class DayColumn extends Component { ) } -} \ No newline at end of file +} diff --git a/components/chart/styles.js b/components/chart/styles.js index d7ab484..0b8a49c 100644 --- a/components/chart/styles.js +++ b/components/chart/styles.js @@ -61,6 +61,11 @@ const styles = { '#a64ca6', '#993299' ], + cervixIcon: { + width: 12, + height: 12, + borderRadius: 50 + }, yAxis: { width: config.columnWidth, borderRightWidth: 0.5, diff --git a/components/home.js b/components/home.js index 6f4ab05..1fa051d 100644 --- a/components/home.js +++ b/components/home.js @@ -8,7 +8,7 @@ import { import { LocalDate, ChronoUnit } from 'js-joda' import styles from '../styles/index' import cycleModule from '../lib/cycle' -import { getOrCreateCycleDay, bleedingDaysSortedByDate, fillWithDummyData, deleteAll } from '../db' +import { getOrCreateCycleDay, bleedingDaysSortedByDate, fillWithMucusDummyData, fillWithCervixDummyData, deleteAll } from '../db' import {bleedingPrediction as labels} from './labels' const getCycleDayNumber = cycleModule().getCycleDayNumber @@ -62,8 +62,14 @@ export default class Home extends Component { + + + @@ -107,4 +113,4 @@ function determinePredictionText() { } else { return labels.predictionStartedXDaysLeft(daysToEnd) } -} \ No newline at end of file +} diff --git a/db/fixtures.js b/db/fixtures.js index a9075f7..321c6df 100644 --- a/db/fixtures.js +++ b/db/fixtures.js @@ -1,6 +1,9 @@ function convertToSymptoFormat(val) { const sympto = { date: val.date } - if (val.temperature) sympto.temperature = { value: val.temperature, exclude: false } + if (val.temperature) sympto.temperature = { + value: val.temperature, + exclude: false + } if (val.mucus) sympto.mucus = { value: val.mucus, exclude: false, @@ -11,7 +14,7 @@ function convertToSymptoFormat(val) { return sympto } -export const cycleWithFhm = [ +export const cycleWithFhmMucus = [ { date: '2018-07-01', bleeding: 2 }, { date: '2018-07-02', bleeding: 1 }, { date: '2018-07-06', temperature: 36.2}, @@ -26,6 +29,27 @@ export const cycleWithFhm = [ { date: '2018-07-18', temperature: 36.9, mucus: 2 } ].map(convertToSymptoFormat).reverse() +export const cycleWithFhmCervix = [ + { date: '2018-08-01', bleeding: 2 }, + { date: '2018-08-02', bleeding: 1 }, + { date: '2018-08-03', bleeding: 0 }, + { date: '2018-08-04', bleeding: 0 }, + { date: '2018-08-05', temperature: 36.07 }, + { date: '2018-08-06', temperature: 36.2 }, + { date: '2018-08-07', temperature: 36.35 }, + { date: '2018-08-08', temperature: 36.4 }, + { date: '2018-08-09', temperature: 36.3 }, + { date: '2018-08-10', temperature: 36.45 }, + { date: '2018-08-11', temperature: 36.45 }, + { date: '2018-08-12', temperature: 36.7, cervix: { isClosed: false, isHard: false } }, + { date: '2018-08-13', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, + { date: '2018-08-14', temperature: 36.75, cervix: { isClosed: true, isHard: true } }, + { date: '2018-08-15', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, + { date: '2018-08-16', temperature: 36.95, cervix: { isClosed: true, isHard: true } }, + { date: '2018-08-17', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, + { date: '2018-08-18', temperature: 36.9, cervix: { isClosed: false, isHard: true } } +].map(convertToSymptoFormat).reverse() + export const longAndComplicatedCycle = [ { date: '2018-06-01', temperature: 36.6, bleeding: 2 }, { date: '2018-06-02', temperature: 36.65 }, diff --git a/db/index.js b/db/index.js index 1845674..433d000 100644 --- a/db/index.js +++ b/db/index.js @@ -2,7 +2,8 @@ import Realm from 'realm' import { LocalDate, ChronoUnit } from 'js-joda' import { cycleWithTempAndNoMucusShift, - cycleWithFhm, + cycleWithFhmMucus, + cycleWithFhmCervix, longAndComplicatedCycle } from './fixtures' @@ -179,9 +180,9 @@ function getCycleDay(localDate) { return db.objectForPrimaryKey('CycleDay', localDate) } -function fillWithDummyData() { +function fillWithMucusDummyData() { const dummyCycles = [ - cycleWithFhm, + cycleWithFhmMucus, longAndComplicatedCycle, cycleWithTempAndNoMucusShift ] @@ -204,6 +205,30 @@ function fillWithDummyData() { }) } +function fillWithCervixDummyData() { + const dummyCycles = [ + cycleWithFhmCervix + ] + + db.write(() => { + db.deleteAll() + dummyCycles.forEach(cycle => { + cycle.forEach(day => { + const existing = getCycleDay(day.date) + if (existing) { + Object.keys(day).forEach(key => { + if (key === 'date') return + existing[key] = day[key] + }) + } else { + db.create('CycleDay', day) + } + }) + }) + }) +} + + function deleteAll() { db.write(() => { db.deleteAll() @@ -266,7 +291,8 @@ export { bleedingDaysSortedByDate, temperatureDaysSortedByDate, cycleDaysSortedByDate, - fillWithDummyData, + fillWithMucusDummyData, + fillWithCervixDummyData, deleteAll, getPreviousTemperature, getCycleDay, diff --git a/lib/sympto/cervix.js b/lib/sympto/cervix.js new file mode 100644 index 0000000..01abe36 --- /dev/null +++ b/lib/sympto/cervix.js @@ -0,0 +1,41 @@ +export default function (cycleDays, tempEvalEndIndex) { + const cervixDays = cycleDays.filter(day => day.cervix && !day.cervix.exclude) + + for (let i = 0; i < cervixDays.length; i++) { + const day = cervixDays[i] + if (isClosedAndHard(day.cervix)) continue + // the three following days must be with closed and hard cervix + // AND no other cervix value may occur until temperature evaluation has + // been completed + const threeFollowingDays = cervixDays.slice(i + 1, i + 4) + if (threeFollowingDays.length < 3) continue + + const fertileCervixOccursIn3FollowingDays = threeFollowingDays.some(day => { + return !isClosedAndHard(day.cervix) + }) + if (fertileCervixOccursIn3FollowingDays) continue + + const cycleDayIndex = cycleDays.indexOf(day) + const relevantDays = cycleDays + .slice(cycleDayIndex + 1, tempEvalEndIndex + 1) + .filter(day => day.cervix && !day.cervix.exclude) + + const onlyClosedAndHardUntilEndOfTempEval = relevantDays.every(day => { + return isClosedAndHard(day.cervix) + }) + + if (onlyClosedAndHardUntilEndOfTempEval) { + return { + detected: true, + cervixPeak: day, + evaluationCompleteDay: threeFollowingDays[threeFollowingDays.length - 1] + } + } + } + + return { detected: false } +} + +function isClosedAndHard (cervixValue) { + return cervixValue.isClosed && cervixValue.isHard +} diff --git a/lib/sympto/index.js b/lib/sympto/index.js index c85b3ca..ccfbf32 100644 --- a/lib/sympto/index.js +++ b/lib/sympto/index.js @@ -1,11 +1,12 @@ import getTemperatureShift from './temperature' import getMucusShift from './mucus' +import getCervixShift from './cervix' import getPreOvulatoryPhase from './pre-ovulatory' import { LocalDate } from 'js-joda' import assert from 'assert' -export default function getSymptoThermalStatus(cycles) { - const { cycle, previousCycle, earlierCycles = [] } = cycles +export default function getSymptoThermalStatus(cycleInfo) { + const { cycle, previousCycle, earlierCycles = [], secondarySymptom = 'mucus' } = cycleInfo throwIfArgsAreNotInRequiredFormat([cycle, ...earlierCycles]) const status = { @@ -48,20 +49,28 @@ export default function getSymptoThermalStatus(cycles) { } const temperatureShift = getTemperatureShift(cycle) + if (!temperatureShift.detected) return status const tempEvalEndIndex = cycle.indexOf(temperatureShift.evaluationCompleteDay) - const mucusShift = getMucusShift(cycle, tempEvalEndIndex) - if (!mucusShift.detected) return status + + let secondaryShift + if (secondarySymptom === 'mucus') { + secondaryShift = getMucusShift(cycle, tempEvalEndIndex) + } else if (secondarySymptom === 'cervix') { + secondaryShift = getCervixShift(cycle, tempEvalEndIndex) + } + + if (!secondaryShift.detected) return status let periOvulatoryEnd const tempOver = temperatureShift.evaluationCompleteDay.date - const mucusOver = mucusShift.evaluationCompleteDay.date + const secondarySymptomOver = secondaryShift.evaluationCompleteDay.date - if (tempOver > mucusOver) { + if (tempOver > secondarySymptomOver) { periOvulatoryEnd = temperatureShift.evaluationCompleteDay } else { - periOvulatoryEnd = mucusShift.evaluationCompleteDay + periOvulatoryEnd = secondaryShift.evaluationCompleteDay } const previousPeriDays = periPhase.cycleDays @@ -78,7 +87,12 @@ export default function getSymptoThermalStatus(cycles) { periPhase.cycleDays = previousPeriDays.slice(0, previousPeriEndIndex + 1) periPhase.end = status.phases.postOvulatory.start - status.mucusShift = mucusShift + if (secondarySymptom === 'mucus') { + status.mucusShift = secondaryShift + } else if (secondarySymptom === 'cervix') { + status.cervixShift = secondaryShift + } + status.temperatureShift = temperatureShift return status @@ -87,9 +101,9 @@ export default function getSymptoThermalStatus(cycles) { function throwIfArgsAreNotInRequiredFormat(cycles) { cycles.forEach(cycle => { assert.ok(Array.isArray(cycle)) - assert.ok(cycle.length > 0) + assert.ok(cycle.length > 0) //what about 2 cycles of 1 day each?! assert.ok(cycle[0].bleeding !== null) - assert.equal(typeof cycle[0].bleeding, 'object') + assert.equal(typeof cycle[0].bleeding, 'object', "First cycle day must contain bleeding value") assert.equal(typeof cycle[0].bleeding.value, 'number') cycle.forEach(day => { assert.equal(typeof day.date, 'string') @@ -98,6 +112,8 @@ function throwIfArgsAreNotInRequiredFormat(cycles) { if (day.mucus) assert.equal(typeof day.mucus.value, 'number') if (day.mucus) assert.ok(day.mucus.value >= 0) if (day.mucus) assert.ok(day.mucus.value < 5) + if (day.cervix) assert.equal(typeof day.cervix.isClosed, 'boolean') + if (day.cervix) assert.equal(typeof day.cervix.isHard, 'boolean') }) }) -} \ No newline at end of file +} diff --git a/test/sympto/cervix-temp-fixtures.js b/test/sympto/cervix-temp-fixtures.js new file mode 100644 index 0000000..0d6d42c --- /dev/null +++ b/test/sympto/cervix-temp-fixtures.js @@ -0,0 +1,215 @@ + +function convertToSymptoFormat(val) { + const sympto = { date: val.date } + if (val.temperature) sympto.temperature = { + value: val.temperature, + exclude: false + } + if (val.cervix) sympto.cervix = { + value: val.cervix, + exclude: false + } + if (val.bleeding) sympto.bleeding = { + value: val.bleeding, + exclude: false + } + return sympto +} + +export const idealCycle = [ + { date: '2018-08-01', bleeding: 1, cervix: { isClosed: false, isHard: false } }, + { date: '2018-08-02', bleeding: 2, cervix: { isClosed: false, isHard: false } }, + { date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { isClosed: false, isHard: false } }, + { date: '2018-08-04', temperature: 36.55, bleeding: 1, cervix: { isClosed: false, isHard: true } }, + { date: '2018-08-05', temperature: 36.6, bleeding: null, cervix: { isClosed: true, isHard: false } }, + { date: '2018-08-06', temperature: 36.65, bleeding: null, cervix: { isClosed: true, isHard: false } }, + { date: '2018-08-07', temperature: 36.7, bleeding: null, cervix: { isClosed: false, isHard: true } }, + { date: '2018-08-08', temperature: 36.6, bleeding: null, cervix: { isClosed: true, isHard: false } }, + { date: '2018-08-09', temperature: 36.8, bleeding: null, cervix: { isClosed: true, isHard: true } }, + { date: '2018-08-10', temperature: 36.75, bleeding: null, cervix: { isClosed: true, isHard: true } }, + { date: '2018-08-11', temperature: 36.9, bleeding: null, cervix: { isClosed: true, isHard: true } }, + { date: '2018-08-12', temperature: 36.95, bleeding: null, cervix: { isClosed: true, isHard: true } }, + { date: '2018-08-13', temperature: 36.95, bleeding: null, cervix: { isClosed: true, isHard: true } } +].map(convertToSymptoFormat) + +export const cycleWithFhmNoCervixShift = [ + { date: '2018-06-01', temperature: 36.6, bleeding: 2 }, + { date: '2018-06-02', temperature: 36.65 }, + { date: '2018-06-04', temperature: 36.6 }, + { date: '2018-06-05', temperature: 36.55 }, + { date: '2018-06-06', temperature: 36.7 }, + { date: '2018-06-08', temperature: 36.7 }, + { date: '2018-06-09', temperature: 36.7 }, + { date: '2018-06-10', temperature: 36.7 }, + { date: '2018-06-11', temperature: 36.7 }, + { date: '2018-06-12', temperature: 36.7 }, + { date: '2018-06-13', temperature: 36.8 }, + { date: '2018-06-15', temperature: 36.9 }, + { date: '2018-06-16', temperature: 36.9 }, + { date: '2018-06-17', temperature: 36.9 }, + { date: '2018-06-18', temperature: 36.9 } +].map(convertToSymptoFormat) + +export const cycleWithoutFhm = [ + { date: '2018-06-02', temperature: 36.6, bleeding: 2 }, + { date: '2018-06-03', temperature: 36.65 }, + { date: '2018-06-04', temperature: 36.6 }, + { date: '2018-06-05', temperature: 36.55 }, + { date: '2018-06-06', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-09', temperature: 36.8, cervix: { isClosed: true, isHard: false } }, + { date: '2018-06-10', temperature: 36.9, cervix: { isClosed: false, isHard: true } }, + { date: '2018-06-13', temperature: 36.9, cervix: { isClosed: false, isHard: false } } +].map(convertToSymptoFormat) + +export const cycleWithoutAnyShifts = [ + { date: '2018-07-01', temperature: 36.65, bleeding: 2, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-02', temperature: 36.45, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-03', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-04', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-05', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-06', temperature: 36.85, cervix: { isClosed: true, isHard: false } }, + { date: '2018-07-07', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-08', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-09', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-10', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-11', temperature: 36.35, cervix: { isClosed: true, isHard: true } }, + { date: '2018-07-12', temperature: 36.65, cervix: { isClosed: true, isHard: true } }, + { date: '2018-07-13', temperature: 36.25, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-14', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-15', temperature: 36.65, cervix: { isClosed: false, isHard: true } }, + { date: '2018-07-16', temperature: 36.15, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-17', temperature: 36.65, cervix: { isClosed: true, isHard: false } }, + { date: '2018-07-18', temperature: 36.25, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-19', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-20', temperature: 36.45, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-21', temperature: 36.5, cervix: { isClosed: true, isHard: true } }, + { date: '2018-07-22', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-23', temperature: 36.75, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-24', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-25', temperature: 36.65, cervix: { isClosed: true, isHard: false } }, + { date: '2018-07-26', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, +].map(convertToSymptoFormat) + +export const longAndComplicatedCycle = [ + { date: '2018-06-01', temperature: 36.6, bleeding: 2 }, + { date: '2018-06-02', temperature: 36.65 }, + { date: '2018-06-04', temperature: 36.6 }, + { date: '2018-06-05', temperature: 36.55 }, + { date: '2018-06-06', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-09', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-10', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-13', temperature: 36.45, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-14', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-15', temperature: 36.55, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-16', temperature: 36.7, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-17', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-18', temperature: 36.75, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-19', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-20', temperature: 36.85, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-21', temperature: 36.8, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-22', temperature: 36.9, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-25', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-26', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-27', temperature: 36.9, cervix: { isClosed: true, isHard: true } } +].map(convertToSymptoFormat) + +export const tempAndCervixEvalEndOnSameDay = [ + { date: '2018-06-01', bleeding: 2 }, + { date: '2018-06-02', bleeding: 1 }, + { date: '2018-06-03', bleeding: 1 }, + { date: '2018-06-04', bleeding: 2 }, + { date: '2018-06-05', bleeding: 1 }, + { date: '2018-06-06', bleeding: 1 }, + { date: '2018-06-07', cervix: { isClosed: false, isHard: true } }, + { date: '2018-06-08', temperature: 36.45, cervix: { isClosed: true, isHard: false } }, + { date: '2018-06-09', temperature: 36.5, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-10', temperature: 36.30, cervix: { isClosed: true, isHard: false } }, + { date: '2018-06-11', temperature: 36.30, cervix: { isClosed: false, isHard: true } }, + { date: '2018-06-12', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-13', temperature: 36.3, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-14', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-15', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-16', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-17', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-18', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-19', temperature: 36.95, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-20', temperature: 37.0, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-21', temperature: 37.0, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-22', temperature: 37.0, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-23', cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-24', cervix: { isClosed: true, isHard: true }}, + { date: '2018-06-25', cervix: { isClosed: false, isHard: false } } +].map(convertToSymptoFormat) + +export const cervixShiftWaitsForTempShift = [ + { date: '2018-05-08', bleeding: 3 }, + { date: '2018-05-09', bleeding: 2 }, + { date: '2018-05-10', bleeding: 2 }, + { date: '2018-05-11', bleeding: 1 }, + { date: '2018-05-12', temperature: 36.3, cervix: { isClosed: false, isHard: false } }, + { date: '2018-05-13', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, + { date: '2018-05-14', temperature: 36.3, cervix: { isClosed: false, isHard: false } }, + { date: '2018-05-15', temperature: 36.2, cervix: { isClosed: false, isHard: false } }, + { date: '2018-05-16', temperature: 36.3, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-17', temperature: 36.3, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-18', temperature: 36.55, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-19', temperature: 36.65, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-20', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-21', temperature: 36.6, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-22', temperature: 36.85, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-23', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-24', temperature: 36.85, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-25', temperature: 36.95, cervix: { isClosed: true, isHard: true } }, + { date: '2018-05-26', temperature: 36.85, cervix: { isClosed: true, isHard: false } }, + { date: '2018-05-27', temperature: 36.8, cervix: { isClosed: false, isHard: true } }, + { date: '2018-05-28', temperature: 36.6, cervix: { isClosed: false, isHard: true } }, + { date: '2018-05-29', bleeding: 2 } +].map(convertToSymptoFormat) + +export const tempShiftWaitsForCervixShift = [ + { date: '2018-04-05', bleeding: 3 }, + { date: '2018-04-06', bleeding: 2 }, + { date: '2018-04-07', bleeding: 2 }, + { date: '2018-04-08', bleeding: 1 }, + { date: '2018-04-09', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, + { date: '2018-04-10', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, + { date: '2018-04-11', temperature: 36.55, cervix: { isClosed: false, isHard: false } }, + { date: '2018-04-12', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, + { date: '2018-04-13', temperature: 36.35, cervix: { isClosed: false, isHard: false } }, + { date: '2018-04-14', temperature: 36.35, cervix: { isClosed: false, isHard: false } }, + { date: '2018-04-15', temperature: 36.6, cervix: { isClosed: false, isHard: false } }, + { date: '2018-04-16', temperature: 36.8, cervix: { isClosed: false, isHard: false } }, + { date: '2018-04-17', cervix: { isClosed: false, isHard: false } }, + { date: '2018-04-18', temperature: 36.8, cervix: { isClosed: false, isHard: true } }, + { date: '2018-04-19', temperature: 36.85, cervix: { isClosed: true, isHard: true } }, + { date: '2018-04-20', temperature: 37.0, cervix: { isClosed: true, isHard: true } }, + { date: '2018-04-21', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, + { date: '2018-04-22', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, + { date: '2018-04-23', temperature: 37.1, cervix: { isClosed: true, isHard: true } }, + { date: '2018-04-24', temperature: 36.75, cervix: { isClosed: false, isHard: false } } +].map(convertToSymptoFormat) + +export const noInfertilePhaseDetected = [ + { date: '2018-03-08', bleeding: 3 }, + { date: '2018-03-09', bleeding: 3 }, + { date: '2018-03-10', bleeding: 3 }, + { date: '2018-03-11', bleeding: 3 }, + { date: '2018-03-12', temperature: 36.3, cervix: { isClosed: true, isHard: false } }, + { date: '2018-03-13', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, + { date: '2018-03-14', temperature: 36.45, cervix: { isClosed: false, isHard: false } }, + { date: '2018-03-15', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, + { date: '2018-03-16', temperature: 36.2, cervix: { isClosed: false, isHard: false } }, + { date: '2018-03-17', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, + { date: '2018-03-18', temperature: 36.6, cervix: { isClosed: false, isHard: false } }, + { date: '2018-03-19', temperature: 36.35, cervix: { isClosed: false, isHard: true } }, + { date: '2018-03-20', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, + { date: '2018-03-21', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, + { date: '2018-03-22', temperature: 36.7, cervix: { isClosed: true, isHard: false } }, + { date: '2018-03-23', temperature: 36.7, cervix: { isClosed: true, isHard: true } } +].map(convertToSymptoFormat) + +export const fiveDayCycle = [ + { date: '2018-08-01', bleeding: 2 }, + { date: '2018-08-03', bleeding: 3 }, + { date: '2018-08-05', bleeding: 0 } +].map(convertToSymptoFormat) diff --git a/test/sympto/cervix-temp.spec.js b/test/sympto/cervix-temp.spec.js new file mode 100644 index 0000000..a610d65 --- /dev/null +++ b/test/sympto/cervix-temp.spec.js @@ -0,0 +1,199 @@ +import chai from 'chai' +import getSensiplanStatus from '../../lib/sympto' +import { + idealCycle, + cycleWithFhmNoCervixShift, + cycleWithoutFhm, + cycleWithoutAnyShifts, + tempAndCervixEvalEndOnSameDay, + cervixShiftWaitsForTempShift, + tempShiftWaitsForCervixShift, + noInfertilePhaseDetected, + fiveDayCycle +} from './cervix-temp-fixtures' + +const expect = chai.expect + +describe('sympto', () => { + describe('combining temperature and cervix tracking', () => { + describe('with no previous higher temp measurement', () => { + + it('with no temp or cervix shifts detects only peri-ovulatory', function () { + const status = getSensiplanStatus({ + cycle: cycleWithoutAnyShifts, + previousCycle: cycleWithoutFhm, + secondarySymptom: 'cervix' + }) + expect(Object.keys(status.phases).length).to.eql(1) + expect(status).to.eql({ + phases: { + periOvulatory: { + start: { date: '2018-07-01' }, + cycleDays: cycleWithoutAnyShifts + } + } + }) + }) + + it('with temp but no cervix shift detects only peri-ovulatory', function () { + const status = getSensiplanStatus({ + cycle: cycleWithFhmNoCervixShift, + previousCycle: cycleWithoutFhm, + secondarySymptom: 'cervix' + }) + expect(Object.keys(status.phases).length).to.eql(1) + expect(status).to.eql({ + phases: { + periOvulatory: { + start: { date: '2018-06-01' }, + cycleDays: cycleWithFhmNoCervixShift + } + } + }) + }) + + it('with temp and cervix shifts detects only peri- and post-ovulatory phases', function () { + const status = getSensiplanStatus({ + cycle: idealCycle, + previousCycle: cycleWithoutFhm, + secondarySymptom: 'cervix' + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.cervixShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-08-01' }, + end: { date: '2018-08-11', time: '18:00' }, + cycleDays: idealCycle + .filter(({date}) => date <= '2018-08-11') + }) + expect(status.phases.postOvulatory).to.eql({ + start: { date: '2018-08-11', time: '18:00' }, + cycleDays: idealCycle + .filter(({date}) => date >= '2018-08-11') + }) + }) + + }) + describe('with previous higher temp measurement', () => { + + describe('with no shifts detects only peri-ovulatory', function () { + it.skip('according to 5-day rule', function () { + const status = getSensiplanStatus({ + cycle: fiveDayCycle, + previousCycle: cycleWithFhmNoCervixShift + }) + + expect(Object.keys(status.phases).length).to.eql(1) + expect(status.phases.preOvulatory).to.eql({ + cycleDays: fiveDayCycle, + start: { date: '2018-08-01' }, + end: { date: '2018-08-05' } + }) + }) + }) + + describe('with no shifts detects pre- and peri-ovulatory phase', () => { + it.skip('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: cycleWithoutAnyShifts, + previousCycle: cycleWithFhmNoCervixShift + }) + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.preOvulatory).to.eql({ + cycleDays: cycleWithoutAnyShifts + .filter(({date}) => date <= '2018-07-05'), + start: { date: '2018-07-01' }, + end: { date: '2018-07-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithoutAnyShifts + .filter(({date}) => date > '2018-07-05'), + start: { date: '2018-07-06' } + }) + }) + }) + + it('with evaluation of temperature and cervix end on same day', () => { + const status = getSensiplanStatus({ + cycle: tempAndCervixEvalEndOnSameDay, + previousCycle: cycleWithFhmNoCervixShift, + secondarySymptom: 'cervix' + }) + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: tempAndCervixEvalEndOnSameDay + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-17', time: '18:00' }, + cycleDays: tempAndCervixEvalEndOnSameDay + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-17' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { date: '2018-06-17', time: '18:00' }, + cycleDays: tempAndCervixEvalEndOnSameDay + .filter(({date}) => date >= '2018-06-17') + }) + expect(status.cervixShift.detected).to.be.true() + expect(status.cervixShift.cervixPeak.date).to.eql('2018-06-14') + expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-06-17') + }) + + + it('when cervix shift waits for temperature shift', () => { + const status = getSensiplanStatus({ + cycle: cervixShiftWaitsForTempShift, + previousCycle: cycleWithFhmNoCervixShift, + secondarySymptom: 'cervix' + }) + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.cervixShift.detected).to.be.true() + }) + + it('when temperature shift waits for cervix shift', () => { + const status = getSensiplanStatus({ + cycle: tempShiftWaitsForCervixShift, + previousCycle: cycleWithFhmNoCervixShift, + secondarySymptom: 'cervix' + }) + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.cervixShift.detected).to.be.true() + }) + + it('when no infertile phase can be detected', () => { + const status = getSensiplanStatus({ + cycle: noInfertilePhaseDetected, + previousCycle: cycleWithFhmNoCervixShift, + secondarySymptom: 'cervix' + }) + expect(Object.keys(status.phases).length).to.eql(2) + }) + + }) + + it('', function () { + const status = getSensiplanStatus({ + cycle: idealCycle, + previousCycle: idealCycle, + secondarySymptom: 'cervix' + }) + + expect(Object.keys(status.phases).length).to.eql() + expect(status).to.eql({ + phases: { + + } + }) + }) + + }) +}) diff --git a/test/sympto/cervix.spec.js b/test/sympto/cervix.spec.js new file mode 100644 index 0000000..9bcc2a2 --- /dev/null +++ b/test/sympto/cervix.spec.js @@ -0,0 +1,114 @@ +import chai from 'chai' +import getCervixStatus from '../../lib/sympto/cervix' + +const expect = chai.expect + +function turnIntoCycleDayObject(value, fakeDate) { + const hardAndClosed = { + isHard: true, + isClosed: true + } + const hardAndOpen = { + isHard: true, + isClosed: false + } + const softAndClosed = { + isHard: false, + isClosed: true + } + const softAndOpen = { + isHard: false, + isClosed: false + } + const cervixStates = [hardAndClosed, hardAndOpen, softAndClosed, softAndOpen] + return { + cervix : cervixStates[value], + date: fakeDate + } +} + +describe('sympto', () => { + describe('detects cervix shift', () => { + it('when an ideal cycle happens', function () { + const values = [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 0, 0, 0, 0] + .map(turnIntoCycleDayObject) + const status = getCervixStatus(values) + expect(status).to.eql({ + detected: true, + cervixPeak: { + date: 13, + cervix: { + isHard: true, + isClosed: false + } + }, + evaluationCompleteDay: { + date: 16, + cervix: { + isHard: true, + isClosed: true + } + } + }) + }) + + it('at the very first day of cycle days even if later shift happens again', function () { + const values = [2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + .map(turnIntoCycleDayObject) + const status = getCervixStatus(values) + expect(status).to.eql({ + detected: true, + cervixPeak: { + date: 0, + cervix: { + isHard: false, + isClosed: true + } + }, + evaluationCompleteDay: { + date: 3, + cervix: { + isHard: true, + isClosed: true + } + } + }) + }) + }) + + describe('detects no cervix shift', () => { + it('if there are less than 3 days closed and hard cervix', function () { + const values = [0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 0, 0, 2, 0] + .map(turnIntoCycleDayObject) + const status = getCervixStatus(values) + expect(status).to.eql({ detected: false }) + }) + + it('if there are no cervix values', function () { + const values = [].map(turnIntoCycleDayObject) + const status = getCervixStatus(values) + expect(status).to.eql({ detected: false }) + }) + + it('when the cervix values are all the same', function () { + const values = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + .map(turnIntoCycleDayObject) + const status = getCervixStatus(values) + expect(status).to.eql({ detected: false }) + }) + + it('if no days of hard and closed cervix are tracked', function () { + const values = [1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1] + .map(turnIntoCycleDayObject) + const status = getCervixStatus(values) + expect(status).to.eql({ detected: false }) + }) + + it('if days of hard and closed cervix are fewer than 3', function () { + const values = [1, 3, 2, 1, 0, 2, 1, 3, 2, 0, 0, 2, 1, 3, 2, 1] + .map(turnIntoCycleDayObject) + const status = getCervixStatus(values) + expect(status).to.eql({ detected: false }) + }) + }) +}) diff --git a/test/sympto/index.spec.js b/test/sympto/index.spec.js deleted file mode 100644 index 8f1df47..0000000 --- a/test/sympto/index.spec.js +++ /dev/null @@ -1,660 +0,0 @@ -import chai from 'chai' -import getSensiplanStatus from '../../lib/sympto' -import { AssertionError } from 'assert' -import { - cycleWithoutFhm, - longAndComplicatedCycle, - cycleWithTempAndNoMucusShift, - cycleWithFhm, - cycleWithoutAnyShifts, - fiveDayCycle, - cycleWithEarlyMucus, - cycleWithMucusOnFirstDay, - mucusPeakAndFhmOnSameDay, - fhmTwoDaysBeforeMucusPeak, - fhm5DaysAfterMucusPeak, - mucusPeak5DaysAfterFhm, - mucusPeakTwoDaysBeforeFhm, - fhmOnDay12, - fhmOnDay15, - mucusPeakSlightlyBeforeTempShift, - highestMucusQualityAfterEndOfEval -} from './fixtures' - -const expect = chai.expect - -describe('sympto', () => { - describe('with no previous higher measurement', () => { - it('with no shifts detects only peri-ovulatory', function () { - const status = getSensiplanStatus({ - cycle: cycleWithoutAnyShifts, - previousCycle: cycleWithoutFhm - }) - - expect(status).to.eql({ - - phases: { - periOvulatory: { - start: { date: '2018-06-01' }, - cycleDays: cycleWithoutAnyShifts - } - }, - }) - }) - - it('with shifts detects only peri-ovulatory and post-ovulatory', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-21') - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - describe('with previous higher measurement', () => { - describe('with no shifts detects pre-ovulatory phase', function () { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: fiveDayCycle, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(1) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: fiveDayCycle, - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - }) - - }) - describe('with no shifts detects pre- and peri-ovulatory phase', () => { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: cycleWithTempAndNoMucusShift, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date <= '2018-06-05'), - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date > '2018-06-05'), - start: { date: '2018-06-06' } - }) - }) - it('according to 5-day-rule with shortened pre-phase', function () { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: [cycleWithEarlyMucus[0]], - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithEarlyMucus.slice(1), - start: { date: '2018-06-02' } - }) - }) - }) - describe('with shifts detects pre- and peri-ovulatory phase', function () { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(3) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05'), - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00'} - }) - expect(status.phases.postOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21'), - start: { date: '2018-06-21', time: '18:00'} - }) - }) - - }) - }) - - describe('combining first higher measurment and mucus peak', () => { - it('with fhM + mucus peak on same day finds start of postovu phase', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakAndFhmOnSameDay, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { - const status = getSensiplanStatus({ - cycle: fhmTwoDaysBeforeMucusPeak, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-26', time: '18:00' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-26' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-26', - time: '18:00' - }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date >= '2018-06-26') - }) - }) - - it('another example for mucus peak before temp shift', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakSlightlyBeforeTempShift, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-17', time: '18:00' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-17' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-17', - time: '18:00' - }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date >= '2018-06-17') - }) - }) - - it('with another mucus peak 5 days after fHM ignores it', () => { - const status = getSensiplanStatus({ - cycle: mucusPeak5DaysAfterFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - end: { date: '2018-06-22', time: '18:00' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => { - return date > '2018-06-01' && date <= '2018-06-22' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-22', - time: '18:00' - }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date >= '2018-06-22') - }) - }) - - it('with mucus peak 2 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakTwoDaysBeforeFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-07-03', time: '18:00' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-07-03' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-07-03', - time: '18:00' - }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date >= '2018-07-03') - }) - }) - - it('with mucus peak 5 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: fhm5DaysAfterMucusPeak, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('with highest quality after end of eval', () => { - const status = getSensiplanStatus({ - cycle: highestMucusQualityAfterEndOfEval, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: highestMucusQualityAfterEndOfEval - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-17', time: '18:00' }, - cycleDays: highestMucusQualityAfterEndOfEval - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-17' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-17', - time: '18:00' - }, - cycleDays: highestMucusQualityAfterEndOfEval - .filter(({date}) => date >= '2018-06-17') - }) - }) - }) - - describe('applying the minus-8 rule', () => { - it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - it('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - it('shortens the pre-ovu phase if mucus occurs', () => { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => { - return date > '2018-06-01' - }) - }) - }) - - it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { - const status = getSensiplanStatus({ - cycle: cycleWithMucusOnFirstDay, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(1) - - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - cycleDays: cycleWithMucusOnFirstDay - }) - }) - - it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(11).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-07' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-07') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-08' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-07' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not lengthen the pre-ovu phase if < 12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(10).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm, - earlierCycles: [...Array(12).fill(fhmOnDay15)] - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date >= '2018-06-01' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - - describe('when args are wrong', () => { - it('throws when arg object is not in right format', () => { - const wrongObject = { hello: 'world' } - expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) - }) - it('throws if cycle array is empty', () => { - expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) - }) - it('throws if cycle days are not in right format', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - hello: 'world', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2018-04-13', - temperature: {value: '35'}, - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '09-14-2017', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - }) - it('throws if first cycle day does not have bleeding value', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2017-01-01', - bleeding: { - value: 'medium' - } - }], - earlierCycles: [[ - { - date: '2017-09-23', - } - ]] - })).to.throw(AssertionError) - }) - }) -}) \ No newline at end of file diff --git a/test/sympto/fixtures.js b/test/sympto/mucus-temp-fixtures.js similarity index 92% rename from test/sympto/fixtures.js rename to test/sympto/mucus-temp-fixtures.js index 0bb4f9f..c313629 100644 --- a/test/sympto/fixtures.js +++ b/test/sympto/mucus-temp-fixtures.js @@ -15,7 +15,7 @@ export const cycleWithFhm = [ { date: '2018-06-06', temperature: 36.7, mucus: 0 }, { date: '2018-06-13', temperature: 36.8, mucus: 4 }, { date: '2018-06-15', temperature: 36.9, mucus: 2 }, - { date: '2018-06-17', temperature: 36.9, mucus: 2 }, + { date: '2018-06-16', temperature: 36.9, mucus: 2 }, { date: '2018-06-17', temperature: 36.9, mucus: 2 }, { date: '2018-06-18', temperature: 36.9, mucus: 2 } ].map(convertToSymptoFormat) @@ -227,6 +227,31 @@ export const mucusPeak5DaysAfterFhm = [ { date: '2018-07-02', temperature: 36.9, mucus: 1 } ].map(convertToSymptoFormat) +export const highestMucusQualityAfterEndOfEval = [ + { date: '2018-06-01', temperature: 36.6, bleeding: 2 }, + { date: '2018-06-02', temperature: 36.65, mucus: 2 }, + { date: '2018-06-04', temperature: 36.6 }, + { date: '2018-06-05', temperature: 36.55 }, + { date: '2018-06-06', temperature: 36.7, mucus: 0 }, + { date: '2018-06-09', temperature: 36.5, mucus: 1 }, + { date: '2018-06-10', temperature: 36.4, mucus: 2 }, + { date: '2018-06-13', temperature: 36.45, mucus: 3 }, + { date: '2018-06-14', temperature: 36.5, mucus: 3 }, + { date: '2018-06-15', temperature: 36.55, mucus: 3 }, + { date: '2018-06-16', temperature: 36.7, mucus: 3 }, + { date: '2018-06-17', temperature: 36.65, mucus: 3 }, + { date: '2018-06-18', temperature: 36.60, mucus: 2 }, + { date: '2018-06-19', temperature: 36.8, mucus: 3 }, + { date: '2018-06-20', temperature: 36.85, mucus: 3 }, + { date: '2018-06-21', temperature: 36.8, mucus: 3 }, + { date: '2018-06-22', temperature: 36.9, mucus: 1 }, + { date: '2018-06-25', temperature: 36.9, mucus: 1 }, + { date: '2018-06-26', temperature: 36.8, mucus: 1 }, + { date: '2018-06-30', temperature: 36.9, mucus: 1 }, + { date: '2018-07-01', temperature: 36.9, mucus: 4 }, + { date: '2018-07-02', temperature: 36.9, mucus: 1 } +].map(convertToSymptoFormat) + export const fhm5DaysAfterMucusPeak = [ { date: '2018-06-01', temperature: 36.6, bleeding: 2 }, { date: '2018-06-02', temperature: 36.65 }, @@ -299,26 +324,3 @@ export const mucusPeakSlightlyBeforeTempShift = [ { date: '2018-06-21', temperature: 36.8, mucus: 1}, { date: '2018-06-22', temperature: 36.8, mucus: 1} ].map(convertToSymptoFormat) - - -export const highestMucusQualityAfterEndOfEval = [ - { date: '2018-06-01', temperature: 36.6, bleeding: 2 }, - { date: '2018-06-02', temperature: 36.65 }, - { date: '2018-06-04', temperature: 36.6 }, - { date: '2018-06-07', temperature: 36.4, mucus: 1 }, - { date: '2018-06-08', temperature: 36.35, mucus: 2}, - { date: '2018-06-09', temperature: 36.4, mucus: 2}, - { date: '2018-06-10', temperature: 36.45, mucus: 2}, - { date: '2018-06-11', temperature: 36.4, mucus: 2}, - { date: '2018-06-12', temperature: 36.45, mucus: 2}, - { date: '2018-06-13', temperature: 36.45, mucus: 3}, - { date: '2018-06-14', temperature: 36.55, mucus: 2}, - { date: '2018-06-15', temperature: 36.6, mucus: 2}, - { date: '2018-06-16', temperature: 36.6, mucus: 2}, - { date: '2018-06-17', temperature: 36.55, mucus: 2}, - { date: '2018-06-18', temperature: 36.6, mucus: 1}, - { date: '2018-06-19', temperature: 36.7, mucus: 4}, - { date: '2018-06-20', temperature: 36.75, mucus: 1}, - { date: '2018-06-21', temperature: 36.8, mucus: 1}, - { date: '2018-06-22', temperature: 36.8, mucus: 1} -].map(convertToSymptoFormat) \ No newline at end of file diff --git a/test/sympto/mucus-temp.spec.js b/test/sympto/mucus-temp.spec.js new file mode 100644 index 0000000..92f346d --- /dev/null +++ b/test/sympto/mucus-temp.spec.js @@ -0,0 +1,661 @@ +import chai from 'chai' +import getSensiplanStatus from '../../lib/sympto' +import { AssertionError } from 'assert' +import { + cycleWithoutFhm, + longAndComplicatedCycle, + cycleWithTempAndNoMucusShift, + cycleWithFhm, + cycleWithoutAnyShifts, + fiveDayCycle, + cycleWithEarlyMucus, + cycleWithMucusOnFirstDay, + mucusPeakAndFhmOnSameDay, + fhmTwoDaysBeforeMucusPeak, + fhm5DaysAfterMucusPeak, + mucusPeak5DaysAfterFhm, + mucusPeakTwoDaysBeforeFhm, + fhmOnDay12, + fhmOnDay15, + mucusPeakSlightlyBeforeTempShift, + highestMucusQualityAfterEndOfEval +} from './mucus-temp-fixtures' + +const expect = chai.expect + +describe('sympto', () => { + describe('combining temperature and mucus tracking', () => { + describe('with no previous higher temp measurement', () => { + + it('with no shifts detects only peri-ovulatory', function () { + const status = getSensiplanStatus({ + cycle: cycleWithoutAnyShifts, + previousCycle: cycleWithoutFhm + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + cycleDays: cycleWithoutAnyShifts + }) + }) + + it('with temp and mucus shifts detects only peri-ovulatory and post-ovulatory', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm + }) + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-21') + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + + }) + }) + + describe('with previous higher measurement', () => { + describe('with no shifts detects pre-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: fiveDayCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(1) + expect(status.phases.preOvulatory).to.eql({ + cycleDays: fiveDayCycle, + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + }) + }) + describe('with no shifts detects pre- and peri-ovulatory phase', () => { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: cycleWithTempAndNoMucusShift, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date > '2018-06-05'), + start: { date: '2018-06-06' } + }) + }) + it('according to 5-day-rule with shortened pre-phase', function () { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: [cycleWithEarlyMucus[0]], + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithEarlyMucus.slice(1), + start: { date: '2018-06-02' } + }) + }) + }) + describe('with shifts detects pre- and peri-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(3) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00'} + }) + expect(status.phases.postOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21'), + start: { date: '2018-06-21', time: '18:00'} + }) + }) + + }) + }) + + describe('combining first higher measurment and mucus peak', () => { + it('with fhM + mucus peak on same day finds start of postovu phase', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakAndFhmOnSameDay, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { + const status = getSensiplanStatus({ + cycle: fhmTwoDaysBeforeMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-26', time: '18:00' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-26' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-26', + time: '18:00' + }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date >= '2018-06-26') + }) + }) + + it('another example for mucus peak before temp shift', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakSlightlyBeforeTempShift, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-17', time: '18:00' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-17' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-17', + time: '18:00' + }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date >= '2018-06-17') + }) + }) + + it('with another mucus peak 5 days after fHM ignores it', () => { + const status = getSensiplanStatus({ + cycle: mucusPeak5DaysAfterFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + end: { date: '2018-06-22', time: '18:00' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => { + return date > '2018-06-01' && date <= '2018-06-22' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-22', + time: '18:00' + }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date >= '2018-06-22') + }) + }) + + it('with mucus peak 2 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakTwoDaysBeforeFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-07-03', time: '18:00' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-07-03' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-07-03', + time: '18:00' + }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date >= '2018-07-03') + }) + }) + + it('with mucus peak 5 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: fhm5DaysAfterMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + + describe('applying the minus-8 rule', () => { + it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + // #TODO + it.only('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date >= '2018-06-21') + }) + }) + + // #TODO + it('with highest quality after end of eval', () => { + const status = getSensiplanStatus({ + cycle: highestMucusQualityAfterEndOfEval, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: highestMucusQualityAfterEndOfEval + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-26', time: '18:00' }, + cycleDays: highestMucusQualityAfterEndOfEval + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-26' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-26', + time: '18:00' + }, + cycleDays: highestMucusQualityAfterEndOfEval + .filter(({date}) => date >= '2018-06-26') + }) + }) + }) + + describe('something', () => { + + it('shortens the pre-ovu phase if mucus occurs', () => { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => { + return date > '2018-06-01' + }) + }) + }) + + it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { + const status = getSensiplanStatus({ + cycle: cycleWithMucusOnFirstDay, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + + expect(Object.keys(status.phases).length).to.eql(1) + + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + cycleDays: cycleWithMucusOnFirstDay + }) + }) + + it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: Array(11).fill(fhmOnDay15) + }) + + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-07' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-07') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-08' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-07' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('does not lengthen the pre-ovu phase if < 12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: Array(10).fill(fhmOnDay15) + }) + + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm, + earlierCycles: [...Array(12).fill(fhmOnDay15)] + }) + + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date >= '2018-06-01' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + + describe('when args are wrong', () => { + it('throws when arg object is not in right format', () => { + const wrongObject = { hello: 'world' } + expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) + }) + it('throws if cycle array is empty', () => { + expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) + }) + it('throws if cycle days are not in right format', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + hello: 'world', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2018-04-13', + temperature: {value: '35'}, + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '09-14-2017', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + }) + it('throws if first cycle day does not have bleeding value', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2017-01-01', + bleeding: { + value: 'medium' + } + }], + earlierCycles: [[ + { + date: '2017-09-23', + } + ]] + })).to.throw(AssertionError) + }) + }) + }) +}) From 60d6e21c5706be65a680425916407a0f0eb9c45d Mon Sep 17 00:00:00 2001 From: emelko Date: Wed, 25 Jul 2018 15:50:41 +0200 Subject: [PATCH 30/60] Detects cervix shift in one happy path; including test --- test/sympto/index.spec.js | 660 +++++++++++++++++++++++++++++ test/sympto/mucus-temp-fixtures.js | 8 + 2 files changed, 668 insertions(+) create mode 100644 test/sympto/index.spec.js diff --git a/test/sympto/index.spec.js b/test/sympto/index.spec.js new file mode 100644 index 0000000..88ada86 --- /dev/null +++ b/test/sympto/index.spec.js @@ -0,0 +1,660 @@ +import chai from 'chai' +import getSensiplanStatus from '../../lib/sympto' +import { AssertionError } from 'assert' +import { + cycleWithoutFhm, + longAndComplicatedCycle, + cycleWithTempAndNoMucusShift, + cycleWithFhm, + cycleWithoutAnyShifts, + fiveDayCycle, + cycleWithEarlyMucus, + cycleWithMucusOnFirstDay, + mucusPeakAndFhmOnSameDay, + fhmTwoDaysBeforeMucusPeak, + fhm5DaysAfterMucusPeak, + mucusPeak5DaysAfterFhm, + mucusPeakTwoDaysBeforeFhm, + fhmOnDay12, + fhmOnDay15, + mucusPeakSlightlyBeforeTempShift, + tempAndCervixEvalEndOnSameDay +} from './fixtures' + +const expect = chai.expect + +describe('sympto', () => { + describe('with no previous higher measurement', () => { + it('with no shifts detects only peri-ovulatory', function () { + const status = getSensiplanStatus({ + cycle: cycleWithoutAnyShifts, + previousCycle: cycleWithoutFhm + }) + + expect(status).to.eql({ + + phases: { + periOvulatory: { + start: { date: '2018-06-01' }, + cycleDays: cycleWithoutAnyShifts + } + }, + }) + }) + + it('with shifts detects only peri-ovulatory and post-ovulatory', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-21') + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + describe('with previous higher measurement', () => { + describe('with no shifts detects pre-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: fiveDayCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(1) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: fiveDayCycle, + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + }) + + }) + describe('with no shifts detects pre- and peri-ovulatory phase', () => { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: cycleWithTempAndNoMucusShift, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date > '2018-06-05'), + start: { date: '2018-06-06' } + }) + }) + it('according to 5-day-rule with shortened pre-phase', function () { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: [cycleWithEarlyMucus[0]], + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithEarlyMucus.slice(1), + start: { date: '2018-06-02' } + }) + }) + }) + describe('with shifts detects pre- and peri-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(3) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00'} + }) + expect(status.phases.postOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21'), + start: { date: '2018-06-21', time: '18:00'} + }) + }) + + }) + }) + + describe('combining first higher measurment and mucus peak', () => { + it('with fhM + mucus peak on same day finds start of postovu phase', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakAndFhmOnSameDay, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { + const status = getSensiplanStatus({ + cycle: fhmTwoDaysBeforeMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-26', time: '18:00' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-26' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-26', + time: '18:00' + }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date >= '2018-06-26') + }) + }) + + it('another example for mucus peak before temp shift', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakSlightlyBeforeTempShift, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-17', time: '18:00' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-17' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-17', + time: '18:00' + }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date >= '2018-06-17') + }) + }) + + it('with another mucus peak 5 days after fHM ignores it', () => { + const status = getSensiplanStatus({ + cycle: mucusPeak5DaysAfterFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + end: { date: '2018-06-22', time: '18:00' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => { + return date > '2018-06-01' && date <= '2018-06-22' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-22', + time: '18:00' + }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date >= '2018-06-22') + }) + }) + + it('with mucus peak 2 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakTwoDaysBeforeFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-07-03', time: '18:00' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-07-03' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-07-03', + time: '18:00' + }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date >= '2018-07-03') + }) + }) + + it('with mucus peak 5 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: fhm5DaysAfterMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + + describe('combining temperature and cervix measurment', () => { + it('with evaluation of temperature and cervix end on same day', () => { + const status = getSensiplanStatus({ + cycle: tempAndCervixEvalEndOnSameDay, + previousCycle: cycleWithFhm, + secondarySymptom: 'cervix' + }) + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: tempAndCervixEvalEndOnSameDay + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-17', time: '18:00' }, + cycleDays: tempAndCervixEvalEndOnSameDay + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-17' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { date: '2018-06-17', time: '18:00' }, + cycleDays: tempAndCervixEvalEndOnSameDay + .filter(({date}) => date >= '2018-06-17') + }) + expect(status.cervixShift.detected).to.be.true() + expect(status.cervixShift.cervixPeak.date).to.eql('2018-06-14') + expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-06-17') + + }) + }) + + describe('applying the minus-8 rule', () => { + it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + it('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + it('shortens the pre-ovu phase if mucus occurs', () => { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => { + return date > '2018-06-01' + }) + }) + }) + + it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { + const status = getSensiplanStatus({ + cycle: cycleWithMucusOnFirstDay, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + + expect(Object.keys(status.phases).length).to.eql(1) + + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + cycleDays: cycleWithMucusOnFirstDay + }) + }) + + it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: Array(11).fill(fhmOnDay15) + }) + + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-07' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-07') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-08' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-07' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('does not lengthen the pre-ovu phase if < 12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: Array(10).fill(fhmOnDay15) + }) + + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm, + earlierCycles: [...Array(12).fill(fhmOnDay15)] + }) + + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date >= '2018-06-01' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + + describe('when args are wrong', () => { + it('throws when arg object is not in right format', () => { + const wrongObject = { hello: 'world' } + expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) + }) + it('throws if cycle array is empty', () => { + expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) + }) + it('throws if cycle days are not in right format', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + hello: 'world', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2018-04-13', + temperature: {value: '35'}, + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '09-14-2017', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + }) + it('throws if first cycle day does not have bleeding value', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2017-01-01', + bleeding: { + value: 'medium' + } + }], + earlierCycles: [[ + { + date: '2017-09-23', + } + ]] + })).to.throw(AssertionError) + }) + }) +}) \ No newline at end of file diff --git a/test/sympto/mucus-temp-fixtures.js b/test/sympto/mucus-temp-fixtures.js index c313629..705e6dc 100644 --- a/test/sympto/mucus-temp-fixtures.js +++ b/test/sympto/mucus-temp-fixtures.js @@ -4,6 +4,14 @@ function convertToSymptoFormat(val) { if (val.temperature) sympto.temperature = { value: val.temperature } if (val.mucus) sympto.mucus = { value: val.mucus } if (val.bleeding) sympto.bleeding = { value: val.bleeding } + if (val.cervix) { + sympto.cervix = {} + if (val.cervix === 'firm & closed') { + sympto.cervix.firmAndClosed = true + } else { + sympto.cervix.firmAndClosed = false + } + } return sympto } From 9e1393766ad8ffca5ffa89d2d1795966bba95fd0 Mon Sep 17 00:00:00 2001 From: emelko Date: Mon, 30 Jul 2018 14:42:00 +0200 Subject: [PATCH 32/60] Split fixtures into temp & mucus and temp & cervix files Add first blueprint for temp&cervix tests --- test/sympto/index.spec.js | 660 --------------- test/sympto/mucus-temp-fixtures.js | 8 - test/sympto/mucus-temp.spec.js | 1208 +++++++++++++-------------- test/sympto/mucus-temp.spec.js~HEAD | 661 +++++++++++++++ 4 files changed, 1247 insertions(+), 1290 deletions(-) delete mode 100644 test/sympto/index.spec.js create mode 100644 test/sympto/mucus-temp.spec.js~HEAD diff --git a/test/sympto/index.spec.js b/test/sympto/index.spec.js deleted file mode 100644 index 88ada86..0000000 --- a/test/sympto/index.spec.js +++ /dev/null @@ -1,660 +0,0 @@ -import chai from 'chai' -import getSensiplanStatus from '../../lib/sympto' -import { AssertionError } from 'assert' -import { - cycleWithoutFhm, - longAndComplicatedCycle, - cycleWithTempAndNoMucusShift, - cycleWithFhm, - cycleWithoutAnyShifts, - fiveDayCycle, - cycleWithEarlyMucus, - cycleWithMucusOnFirstDay, - mucusPeakAndFhmOnSameDay, - fhmTwoDaysBeforeMucusPeak, - fhm5DaysAfterMucusPeak, - mucusPeak5DaysAfterFhm, - mucusPeakTwoDaysBeforeFhm, - fhmOnDay12, - fhmOnDay15, - mucusPeakSlightlyBeforeTempShift, - tempAndCervixEvalEndOnSameDay -} from './fixtures' - -const expect = chai.expect - -describe('sympto', () => { - describe('with no previous higher measurement', () => { - it('with no shifts detects only peri-ovulatory', function () { - const status = getSensiplanStatus({ - cycle: cycleWithoutAnyShifts, - previousCycle: cycleWithoutFhm - }) - - expect(status).to.eql({ - - phases: { - periOvulatory: { - start: { date: '2018-06-01' }, - cycleDays: cycleWithoutAnyShifts - } - }, - }) - }) - - it('with shifts detects only peri-ovulatory and post-ovulatory', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-21') - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - describe('with previous higher measurement', () => { - describe('with no shifts detects pre-ovulatory phase', function () { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: fiveDayCycle, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(1) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: fiveDayCycle, - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - }) - - }) - describe('with no shifts detects pre- and peri-ovulatory phase', () => { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: cycleWithTempAndNoMucusShift, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date <= '2018-06-05'), - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date > '2018-06-05'), - start: { date: '2018-06-06' } - }) - }) - it('according to 5-day-rule with shortened pre-phase', function () { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: [cycleWithEarlyMucus[0]], - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithEarlyMucus.slice(1), - start: { date: '2018-06-02' } - }) - }) - }) - describe('with shifts detects pre- and peri-ovulatory phase', function () { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(3) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05'), - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00'} - }) - expect(status.phases.postOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21'), - start: { date: '2018-06-21', time: '18:00'} - }) - }) - - }) - }) - - describe('combining first higher measurment and mucus peak', () => { - it('with fhM + mucus peak on same day finds start of postovu phase', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakAndFhmOnSameDay, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { - const status = getSensiplanStatus({ - cycle: fhmTwoDaysBeforeMucusPeak, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-26', time: '18:00' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-26' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-26', - time: '18:00' - }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date >= '2018-06-26') - }) - }) - - it('another example for mucus peak before temp shift', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakSlightlyBeforeTempShift, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-17', time: '18:00' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-17' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-17', - time: '18:00' - }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date >= '2018-06-17') - }) - }) - - it('with another mucus peak 5 days after fHM ignores it', () => { - const status = getSensiplanStatus({ - cycle: mucusPeak5DaysAfterFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - end: { date: '2018-06-22', time: '18:00' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => { - return date > '2018-06-01' && date <= '2018-06-22' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-22', - time: '18:00' - }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date >= '2018-06-22') - }) - }) - - it('with mucus peak 2 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakTwoDaysBeforeFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-07-03', time: '18:00' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-07-03' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-07-03', - time: '18:00' - }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date >= '2018-07-03') - }) - }) - - it('with mucus peak 5 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: fhm5DaysAfterMucusPeak, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - - describe('combining temperature and cervix measurment', () => { - it('with evaluation of temperature and cervix end on same day', () => { - const status = getSensiplanStatus({ - cycle: tempAndCervixEvalEndOnSameDay, - previousCycle: cycleWithFhm, - secondarySymptom: 'cervix' - }) - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: tempAndCervixEvalEndOnSameDay - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-17', time: '18:00' }, - cycleDays: tempAndCervixEvalEndOnSameDay - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-17' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { date: '2018-06-17', time: '18:00' }, - cycleDays: tempAndCervixEvalEndOnSameDay - .filter(({date}) => date >= '2018-06-17') - }) - expect(status.cervixShift.detected).to.be.true() - expect(status.cervixShift.cervixPeak.date).to.eql('2018-06-14') - expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-06-17') - - }) - }) - - describe('applying the minus-8 rule', () => { - it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - it('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - it('shortens the pre-ovu phase if mucus occurs', () => { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => { - return date > '2018-06-01' - }) - }) - }) - - it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { - const status = getSensiplanStatus({ - cycle: cycleWithMucusOnFirstDay, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(1) - - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - cycleDays: cycleWithMucusOnFirstDay - }) - }) - - it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(11).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-07' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-07') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-08' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-07' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not lengthen the pre-ovu phase if < 12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(10).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm, - earlierCycles: [...Array(12).fill(fhmOnDay15)] - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date >= '2018-06-01' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - - describe('when args are wrong', () => { - it('throws when arg object is not in right format', () => { - const wrongObject = { hello: 'world' } - expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) - }) - it('throws if cycle array is empty', () => { - expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) - }) - it('throws if cycle days are not in right format', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - hello: 'world', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2018-04-13', - temperature: {value: '35'}, - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '09-14-2017', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - }) - it('throws if first cycle day does not have bleeding value', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2017-01-01', - bleeding: { - value: 'medium' - } - }], - earlierCycles: [[ - { - date: '2017-09-23', - } - ]] - })).to.throw(AssertionError) - }) - }) -}) \ No newline at end of file diff --git a/test/sympto/mucus-temp-fixtures.js b/test/sympto/mucus-temp-fixtures.js index 705e6dc..c313629 100644 --- a/test/sympto/mucus-temp-fixtures.js +++ b/test/sympto/mucus-temp-fixtures.js @@ -4,14 +4,6 @@ function convertToSymptoFormat(val) { if (val.temperature) sympto.temperature = { value: val.temperature } if (val.mucus) sympto.mucus = { value: val.mucus } if (val.bleeding) sympto.bleeding = { value: val.bleeding } - if (val.cervix) { - sympto.cervix = {} - if (val.cervix === 'firm & closed') { - sympto.cervix.firmAndClosed = true - } else { - sympto.cervix.firmAndClosed = false - } - } return sympto } diff --git a/test/sympto/mucus-temp.spec.js b/test/sympto/mucus-temp.spec.js index 92f346d..c0f850a 100644 --- a/test/sympto/mucus-temp.spec.js +++ b/test/sympto/mucus-temp.spec.js @@ -17,645 +17,609 @@ import { mucusPeakTwoDaysBeforeFhm, fhmOnDay12, fhmOnDay15, - mucusPeakSlightlyBeforeTempShift, - highestMucusQualityAfterEndOfEval + mucusPeakSlightlyBeforeTempShift } from './mucus-temp-fixtures' const expect = chai.expect describe('sympto', () => { - describe('combining temperature and mucus tracking', () => { - describe('with no previous higher temp measurement', () => { - - it('with no shifts detects only peri-ovulatory', function () { - const status = getSensiplanStatus({ - cycle: cycleWithoutAnyShifts, - previousCycle: cycleWithoutFhm - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - cycleDays: cycleWithoutAnyShifts - }) + describe('with no previous higher measurement', () => { + it('with no shifts detects only peri-ovulatory', function () { + const status = getSensiplanStatus({ + cycle: cycleWithoutAnyShifts, + previousCycle: cycleWithoutFhm }) - it('with temp and mucus shifts detects only peri-ovulatory and post-ovulatory', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm - }) - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-21') - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) + expect(status).to.eql({ - }) - }) - - describe('with previous higher measurement', () => { - describe('with no shifts detects pre-ovulatory phase', function () { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: fiveDayCycle, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(1) - expect(status.phases.preOvulatory).to.eql({ - cycleDays: fiveDayCycle, + phases: { + periOvulatory: { start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - }) - }) - describe('with no shifts detects pre- and peri-ovulatory phase', () => { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: cycleWithTempAndNoMucusShift, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date <= '2018-06-05'), - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date > '2018-06-05'), - start: { date: '2018-06-06' } - }) - }) - it('according to 5-day-rule with shortened pre-phase', function () { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: [cycleWithEarlyMucus[0]], - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithEarlyMucus.slice(1), - start: { date: '2018-06-02' } - }) - }) - }) - describe('with shifts detects pre- and peri-ovulatory phase', function () { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(3) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05'), - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00'} - }) - expect(status.phases.postOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21'), - start: { date: '2018-06-21', time: '18:00'} - }) - }) - + cycleDays: cycleWithoutAnyShifts + } + }, }) }) - describe('combining first higher measurment and mucus peak', () => { - it('with fhM + mucus peak on same day finds start of postovu phase', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakAndFhmOnSameDay, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date >= '2018-06-21') - }) + it('with shifts detects only peri-ovulatory and post-ovulatory', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm }) - it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { - const status = getSensiplanStatus({ - cycle: fhmTwoDaysBeforeMucusPeak, - previousCycle: cycleWithFhm - }) + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-26', time: '18:00' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-26' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-26', - time: '18:00' - }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date >= '2018-06-26') - }) + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-21') }) - - it('another example for mucus peak before temp shift', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakSlightlyBeforeTempShift, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-17', time: '18:00' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-17' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-17', - time: '18:00' - }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date >= '2018-06-17') - }) - }) - - it('with another mucus peak 5 days after fHM ignores it', () => { - const status = getSensiplanStatus({ - cycle: mucusPeak5DaysAfterFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - end: { date: '2018-06-22', time: '18:00' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => { - return date > '2018-06-01' && date <= '2018-06-22' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-22', - time: '18:00' - }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date >= '2018-06-22') - }) - }) - - it('with mucus peak 2 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakTwoDaysBeforeFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-07-03', time: '18:00' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-07-03' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-07-03', - time: '18:00' - }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date >= '2018-07-03') - }) - }) - - it('with mucus peak 5 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: fhm5DaysAfterMucusPeak, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - - describe('applying the minus-8 rule', () => { - it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - // #TODO - it.only('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date >= '2018-06-21') - }) - }) - - // #TODO - it('with highest quality after end of eval', () => { - const status = getSensiplanStatus({ - cycle: highestMucusQualityAfterEndOfEval, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: highestMucusQualityAfterEndOfEval - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-26', time: '18:00' }, - cycleDays: highestMucusQualityAfterEndOfEval - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-26' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-26', - time: '18:00' - }, - cycleDays: highestMucusQualityAfterEndOfEval - .filter(({date}) => date >= '2018-06-26') - }) - }) - }) - - describe('something', () => { - - it('shortens the pre-ovu phase if mucus occurs', () => { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => { - return date > '2018-06-01' - }) - }) - }) - - it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { - const status = getSensiplanStatus({ - cycle: cycleWithMucusOnFirstDay, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(1) - - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - cycleDays: cycleWithMucusOnFirstDay - }) - }) - - it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(11).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-07' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-07') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-08' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-07' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not lengthen the pre-ovu phase if < 12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(10).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm, - earlierCycles: [...Array(12).fill(fhmOnDay15)] - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date >= '2018-06-01' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - - describe('when args are wrong', () => { - it('throws when arg object is not in right format', () => { - const wrongObject = { hello: 'world' } - expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) - }) - it('throws if cycle array is empty', () => { - expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) - }) - it('throws if cycle days are not in right format', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - hello: 'world', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2018-04-13', - temperature: {value: '35'}, - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '09-14-2017', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - }) - it('throws if first cycle day does not have bleeding value', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2017-01-01', - bleeding: { - value: 'medium' - } - }], - earlierCycles: [[ - { - date: '2017-09-23', - } - ]] - })).to.throw(AssertionError) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') }) }) }) + describe('with previous higher measurement', () => { + describe('with no shifts detects pre-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: fiveDayCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(1) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: fiveDayCycle, + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + }) + + }) + describe('with no shifts detects pre- and peri-ovulatory phase', () => { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: cycleWithTempAndNoMucusShift, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date > '2018-06-05'), + start: { date: '2018-06-06' } + }) + }) + it('according to 5-day-rule with shortened pre-phase', function () { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: [cycleWithEarlyMucus[0]], + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithEarlyMucus.slice(1), + start: { date: '2018-06-02' } + }) + }) + }) + describe('with shifts detects pre- and peri-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(3) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00'} + }) + expect(status.phases.postOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21'), + start: { date: '2018-06-21', time: '18:00'} + }) + }) + + }) + }) + + describe('combining first higher measurment and mucus peak', () => { + it('with fhM + mucus peak on same day finds start of postovu phase', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakAndFhmOnSameDay, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { + const status = getSensiplanStatus({ + cycle: fhmTwoDaysBeforeMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-26', time: '18:00' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-26' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-26', + time: '18:00' + }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date >= '2018-06-26') + }) + }) + + it('another example for mucus peak before temp shift', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakSlightlyBeforeTempShift, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-17', time: '18:00' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-17' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-17', + time: '18:00' + }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date >= '2018-06-17') + }) + }) + + it('with another mucus peak 5 days after fHM ignores it', () => { + const status = getSensiplanStatus({ + cycle: mucusPeak5DaysAfterFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + end: { date: '2018-06-22', time: '18:00' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => { + return date > '2018-06-01' && date <= '2018-06-22' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-22', + time: '18:00' + }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date >= '2018-06-22') + }) + }) + + it('with mucus peak 2 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakTwoDaysBeforeFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-07-03', time: '18:00' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-07-03' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-07-03', + time: '18:00' + }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date >= '2018-07-03') + }) + }) + + it('with mucus peak 5 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: fhm5DaysAfterMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + + describe('applying the minus-8 rule', () => { + it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + it('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + it('shortens the pre-ovu phase if mucus occurs', () => { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => { + return date > '2018-06-01' + }) + }) + }) + + it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { + const status = getSensiplanStatus({ + cycle: cycleWithMucusOnFirstDay, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + + expect(Object.keys(status.phases).length).to.eql(1) + + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + cycleDays: cycleWithMucusOnFirstDay + }) + }) + + it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: Array(11).fill(fhmOnDay15) + }) + + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-07' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-07') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-08' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-07' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('does not lengthen the pre-ovu phase if < 12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: Array(10).fill(fhmOnDay15) + }) + + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm, + earlierCycles: [...Array(12).fill(fhmOnDay15)] + }) + + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date >= '2018-06-01' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + + describe('when args are wrong', () => { + it('throws when arg object is not in right format', () => { + const wrongObject = { hello: 'world' } + expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) + }) + it('throws if cycle array is empty', () => { + expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) + }) + it('throws if cycle days are not in right format', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + hello: 'world', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2018-04-13', + temperature: {value: '35'}, + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '09-14-2017', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + }) + it('throws if first cycle day does not have bleeding value', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2017-01-01', + bleeding: { + value: 'medium' + } + }], + earlierCycles: [[ + { + date: '2017-09-23', + } + ]] + })).to.throw(AssertionError) + }) + }) }) diff --git a/test/sympto/mucus-temp.spec.js~HEAD b/test/sympto/mucus-temp.spec.js~HEAD new file mode 100644 index 0000000..92f346d --- /dev/null +++ b/test/sympto/mucus-temp.spec.js~HEAD @@ -0,0 +1,661 @@ +import chai from 'chai' +import getSensiplanStatus from '../../lib/sympto' +import { AssertionError } from 'assert' +import { + cycleWithoutFhm, + longAndComplicatedCycle, + cycleWithTempAndNoMucusShift, + cycleWithFhm, + cycleWithoutAnyShifts, + fiveDayCycle, + cycleWithEarlyMucus, + cycleWithMucusOnFirstDay, + mucusPeakAndFhmOnSameDay, + fhmTwoDaysBeforeMucusPeak, + fhm5DaysAfterMucusPeak, + mucusPeak5DaysAfterFhm, + mucusPeakTwoDaysBeforeFhm, + fhmOnDay12, + fhmOnDay15, + mucusPeakSlightlyBeforeTempShift, + highestMucusQualityAfterEndOfEval +} from './mucus-temp-fixtures' + +const expect = chai.expect + +describe('sympto', () => { + describe('combining temperature and mucus tracking', () => { + describe('with no previous higher temp measurement', () => { + + it('with no shifts detects only peri-ovulatory', function () { + const status = getSensiplanStatus({ + cycle: cycleWithoutAnyShifts, + previousCycle: cycleWithoutFhm + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + cycleDays: cycleWithoutAnyShifts + }) + }) + + it('with temp and mucus shifts detects only peri-ovulatory and post-ovulatory', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm + }) + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-21') + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + + }) + }) + + describe('with previous higher measurement', () => { + describe('with no shifts detects pre-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: fiveDayCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(1) + expect(status.phases.preOvulatory).to.eql({ + cycleDays: fiveDayCycle, + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + }) + }) + describe('with no shifts detects pre- and peri-ovulatory phase', () => { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: cycleWithTempAndNoMucusShift, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date > '2018-06-05'), + start: { date: '2018-06-06' } + }) + }) + it('according to 5-day-rule with shortened pre-phase', function () { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: [cycleWithEarlyMucus[0]], + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithEarlyMucus.slice(1), + start: { date: '2018-06-02' } + }) + }) + }) + describe('with shifts detects pre- and peri-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(3) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00'} + }) + expect(status.phases.postOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21'), + start: { date: '2018-06-21', time: '18:00'} + }) + }) + + }) + }) + + describe('combining first higher measurment and mucus peak', () => { + it('with fhM + mucus peak on same day finds start of postovu phase', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakAndFhmOnSameDay, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { + const status = getSensiplanStatus({ + cycle: fhmTwoDaysBeforeMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-26', time: '18:00' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-26' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-26', + time: '18:00' + }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date >= '2018-06-26') + }) + }) + + it('another example for mucus peak before temp shift', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakSlightlyBeforeTempShift, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-17', time: '18:00' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-17' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-17', + time: '18:00' + }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date >= '2018-06-17') + }) + }) + + it('with another mucus peak 5 days after fHM ignores it', () => { + const status = getSensiplanStatus({ + cycle: mucusPeak5DaysAfterFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + end: { date: '2018-06-22', time: '18:00' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => { + return date > '2018-06-01' && date <= '2018-06-22' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-22', + time: '18:00' + }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date >= '2018-06-22') + }) + }) + + it('with mucus peak 2 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakTwoDaysBeforeFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-07-03', time: '18:00' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-07-03' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-07-03', + time: '18:00' + }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date >= '2018-07-03') + }) + }) + + it('with mucus peak 5 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: fhm5DaysAfterMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + + describe('applying the minus-8 rule', () => { + it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + // #TODO + it.only('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date >= '2018-06-21') + }) + }) + + // #TODO + it('with highest quality after end of eval', () => { + const status = getSensiplanStatus({ + cycle: highestMucusQualityAfterEndOfEval, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: highestMucusQualityAfterEndOfEval + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-26', time: '18:00' }, + cycleDays: highestMucusQualityAfterEndOfEval + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-26' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-26', + time: '18:00' + }, + cycleDays: highestMucusQualityAfterEndOfEval + .filter(({date}) => date >= '2018-06-26') + }) + }) + }) + + describe('something', () => { + + it('shortens the pre-ovu phase if mucus occurs', () => { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => { + return date > '2018-06-01' + }) + }) + }) + + it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { + const status = getSensiplanStatus({ + cycle: cycleWithMucusOnFirstDay, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + + expect(Object.keys(status.phases).length).to.eql(1) + + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + cycleDays: cycleWithMucusOnFirstDay + }) + }) + + it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: Array(11).fill(fhmOnDay15) + }) + + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-07' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-07') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-08' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-07' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('does not lengthen the pre-ovu phase if < 12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: Array(10).fill(fhmOnDay15) + }) + + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm, + earlierCycles: [...Array(12).fill(fhmOnDay15)] + }) + + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date >= '2018-06-01' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + + describe('when args are wrong', () => { + it('throws when arg object is not in right format', () => { + const wrongObject = { hello: 'world' } + expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) + }) + it('throws if cycle array is empty', () => { + expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) + }) + it('throws if cycle days are not in right format', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + hello: 'world', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2018-04-13', + temperature: {value: '35'}, + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '09-14-2017', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + }) + it('throws if first cycle day does not have bleeding value', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2017-01-01', + bleeding: { + value: 'medium' + } + }], + earlierCycles: [[ + { + date: '2017-09-23', + } + ]] + })).to.throw(AssertionError) + }) + }) + }) +}) From 21d6e24f23dd0a90d63e708f2c77fe5b78dd7424 Mon Sep 17 00:00:00 2001 From: emelko Date: Mon, 13 Aug 2018 11:31:21 +0200 Subject: [PATCH 34/60] Add more details to cervix-temp fixtures and to mucus-temp spec --- test/sympto/cervix-temp-fixtures.js | 17 +- test/sympto/mucus-temp.spec.js | 1113 +++++++++++++-------------- 2 files changed, 560 insertions(+), 570 deletions(-) diff --git a/test/sympto/cervix-temp-fixtures.js b/test/sympto/cervix-temp-fixtures.js index 0d6d42c..66239e5 100644 --- a/test/sympto/cervix-temp-fixtures.js +++ b/test/sympto/cervix-temp-fixtures.js @@ -37,17 +37,12 @@ export const cycleWithFhmNoCervixShift = [ { date: '2018-06-02', temperature: 36.65 }, { date: '2018-06-04', temperature: 36.6 }, { date: '2018-06-05', temperature: 36.55 }, - { date: '2018-06-06', temperature: 36.7 }, - { date: '2018-06-08', temperature: 36.7 }, - { date: '2018-06-09', temperature: 36.7 }, - { date: '2018-06-10', temperature: 36.7 }, - { date: '2018-06-11', temperature: 36.7 }, - { date: '2018-06-12', temperature: 36.7 }, - { date: '2018-06-13', temperature: 36.8 }, - { date: '2018-06-15', temperature: 36.9 }, - { date: '2018-06-16', temperature: 36.9 }, - { date: '2018-06-17', temperature: 36.9 }, - { date: '2018-06-18', temperature: 36.9 } + { date: '2018-06-06', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, + { date: '2018-06-13', temperature: 36.8, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-15', temperature: 36.9, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-17', temperature: 36.9, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-17', temperature: 36.9, cervix: { isClosed: false, isHard: false } }, + { date: '2018-06-18', temperature: 36.9, cervix: { isClosed: false, isHard: false } } ].map(convertToSymptoFormat) export const cycleWithoutFhm = [ diff --git a/test/sympto/mucus-temp.spec.js b/test/sympto/mucus-temp.spec.js index c0f850a..e81ba31 100644 --- a/test/sympto/mucus-temp.spec.js +++ b/test/sympto/mucus-temp.spec.js @@ -23,603 +23,598 @@ import { const expect = chai.expect describe('sympto', () => { - describe('with no previous higher measurement', () => { - it('with no shifts detects only peri-ovulatory', function () { - const status = getSensiplanStatus({ - cycle: cycleWithoutAnyShifts, - previousCycle: cycleWithoutFhm - }) + describe('combining temperature and mucus tracking', () => { + describe('with no previous higher temp measurement', () => { - expect(status).to.eql({ - - phases: { - periOvulatory: { - start: { date: '2018-06-01' }, - cycleDays: cycleWithoutAnyShifts - } - }, - }) - }) - - it('with shifts detects only peri-ovulatory and post-ovulatory', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-21') - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - describe('with previous higher measurement', () => { - describe('with no shifts detects pre-ovulatory phase', function () { - it('according to 5-day-rule', function () { + it('with no shifts detects only peri-ovulatory', function () { const status = getSensiplanStatus({ - cycle: fiveDayCycle, + cycle: cycleWithoutAnyShifts, + previousCycle: cycleWithoutFhm + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + cycleDays: cycleWithoutAnyShifts + }) + }) + + it('with temp and mucus shifts detects only peri-ovulatory and post-ovulatory', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm + }) + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-21') + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + + }) + }) + + describe('with previous higher measurement', () => { + describe('with no shifts detects pre-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: fiveDayCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(1) + expect(status.phases.preOvulatory).to.eql({ + cycleDays: fiveDayCycle, + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + }) + }) + describe('with no shifts detects pre- and peri-ovulatory phase', () => { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: cycleWithTempAndNoMucusShift, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithTempAndNoMucusShift + .filter(({date}) => date > '2018-06-05'), + start: { date: '2018-06-06' } + }) + }) + it('according to 5-day-rule with shortened pre-phase', function () { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(2) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: [cycleWithEarlyMucus[0]], + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithEarlyMucus.slice(1), + start: { date: '2018-06-02' } + }) + }) + }) + describe('with shifts detects pre- and peri-ovulatory phase', function () { + it('according to 5-day-rule', function () { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithFhm + }) + + expect(Object.keys(status.phases).length).to.eql(3) + + expect(status.phases.preOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05'), + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00'} + }) + expect(status.phases.postOvulatory).to.eql({ + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21'), + start: { date: '2018-06-21', time: '18:00'} + }) + }) + + }) + }) + + describe('combining first higher measurment and mucus peak', () => { + it('with fhM + mucus peak on same day finds start of postovu phase', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakAndFhmOnSameDay, previousCycle: cycleWithFhm }) + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: mucusPeakAndFhmOnSameDay + .filter(({date}) => date >= '2018-06-21') + }) + }) + + it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { + const status = getSensiplanStatus({ + cycle: fhmTwoDaysBeforeMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-26', time: '18:00' }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-26' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-26', + time: '18:00' + }, + cycleDays: fhmTwoDaysBeforeMucusPeak + .filter(({date}) => date >= '2018-06-26') + }) + }) + + it('another example for mucus peak before temp shift', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakSlightlyBeforeTempShift, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-17', time: '18:00' }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-17' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-17', + time: '18:00' + }, + cycleDays: mucusPeakSlightlyBeforeTempShift + .filter(({date}) => date >= '2018-06-17') + }) + }) + + it('with another mucus peak 5 days after fHM ignores it', () => { + const status = getSensiplanStatus({ + cycle: mucusPeak5DaysAfterFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + end: { date: '2018-06-22', time: '18:00' }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => { + return date > '2018-06-01' && date <= '2018-06-22' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-22', + time: '18:00' + }, + cycleDays: mucusPeak5DaysAfterFhm + .filter(({date}) => date >= '2018-06-22') + }) + }) + + it('with mucus peak 2 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: mucusPeakTwoDaysBeforeFhm, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-07-03', time: '18:00' }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-07-03' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-07-03', + time: '18:00' + }, + cycleDays: mucusPeakTwoDaysBeforeFhm + .filter(({date}) => date >= '2018-07-03') + }) + }) + + it('with mucus peak 5 days before fhM waits for end of temp eval', () => { + const status = getSensiplanStatus({ + cycle: fhm5DaysAfterMucusPeak, + previousCycle: cycleWithFhm + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: fhm5DaysAfterMucusPeak + .filter(({date}) => date >= '2018-06-21') + }) + }) + }) + + describe('applying the minus-8 rule', () => { + it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + it('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + expect(status.temperatureShift).to.be.an('object') + expect(status.mucusShift).to.be.an('object') + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-04' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-04') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-05' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-04' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) + }) + it('shortens the pre-ovu phase if mucus occurs', () => { + const status = getSensiplanStatus({ + cycle: cycleWithEarlyMucus, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-01' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => date <= '2018-06-01') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-02' }, + cycleDays: cycleWithEarlyMucus + .filter(({date}) => { + return date > '2018-06-01' + }) + }) + }) + + it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { + const status = getSensiplanStatus({ + cycle: cycleWithMucusOnFirstDay, + previousCycle: fhmOnDay12, + earlierCycles: Array(10).fill(fhmOnDay12) + }) + + expect(Object.keys(status.phases).length).to.eql(1) - expect(status.phases.preOvulatory).to.eql({ - cycleDays: fiveDayCycle, - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - }) - - }) - describe('with no shifts detects pre- and peri-ovulatory phase', () => { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: cycleWithTempAndNoMucusShift, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date <= '2018-06-05'), - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date > '2018-06-05'), - start: { date: '2018-06-06' } - }) - }) - it('according to 5-day-rule with shortened pre-phase', function () { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: [cycleWithEarlyMucus[0]], start: { date: '2018-06-01' }, - end: { date: '2018-06-01' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithEarlyMucus.slice(1), - start: { date: '2018-06-02' } + cycleDays: cycleWithMucusOnFirstDay }) }) - }) - describe('with shifts detects pre- and peri-ovulatory phase', function () { - it('according to 5-day-rule', function () { + + it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { const status = getSensiplanStatus({ cycle: longAndComplicatedCycle, - previousCycle: cycleWithFhm + previousCycle: fhmOnDay15, + earlierCycles: Array(11).fill(fhmOnDay15) }) + expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05'), start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } + end: { date: '2018-06-07' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-07') }) expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-08' }, + end: { date: '2018-06-21', time: '18:00' }, cycleDays: longAndComplicatedCycle - .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00'} + .filter(({date}) => { + return date > '2018-06-07' && date <= '2018-06-21' + }) }) expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21'), - start: { date: '2018-06-21', time: '18:00'} + .filter(({date}) => date >= '2018-06-21') }) }) - }) - }) + it('does not lengthen the pre-ovu phase if < 12 cycles', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: fhmOnDay15, + earlierCycles: Array(10).fill(fhmOnDay15) + }) - describe('combining first higher measurment and mucus peak', () => { - it('with fhM + mucus peak on same day finds start of postovu phase', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakAndFhmOnSameDay, - previousCycle: cycleWithFhm + + expect(Object.keys(status.phases).length).to.eql(3) + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-05' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date <= '2018-06-05') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-06' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date > '2018-06-05' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) }) - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') + it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { + const status = getSensiplanStatus({ + cycle: longAndComplicatedCycle, + previousCycle: cycleWithoutFhm, + earlierCycles: [...Array(12).fill(fhmOnDay15)] + }) - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date >= '2018-06-21') + + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.periOvulatory).to.eql({ + start: { date: '2018-06-01' }, + end: { date: '2018-06-21', time: '18:00' }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => { + return date >= '2018-06-01' && date <= '2018-06-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { + date: '2018-06-21', + time: '18:00' + }, + cycleDays: longAndComplicatedCycle + .filter(({date}) => date >= '2018-06-21') + }) }) }) - it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { - const status = getSensiplanStatus({ - cycle: fhmTwoDaysBeforeMucusPeak, - previousCycle: cycleWithFhm + describe('when args are wrong', () => { + it('throws when arg object is not in right format', () => { + const wrongObject = { hello: 'world' } + expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date <= '2018-06-05') + it('throws if cycle array is empty', () => { + expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-26', time: '18:00' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-26' - }) + it('throws if cycle days are not in right format', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + hello: 'world', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2018-04-13', + temperature: {value: '35'}, + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) + expect(() => getSensiplanStatus({ + cycle: [{ + date: '09-14-2017', + bleeding: { value: 0 } + }], + earlierCycles: [[{ + date: '1992-09-09', + bleeding: { value: 0 } + }]] + })).to.throw(AssertionError) }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-26', - time: '18:00' - }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date >= '2018-06-26') + it('throws if first cycle day does not have bleeding value', () => { + expect(() => getSensiplanStatus({ + cycle: [{ + date: '2017-01-01', + bleeding: { + value: 'medium' + } + }], + earlierCycles: [[ + { + date: '2017-09-23', + } + ]] + })).to.throw(AssertionError) }) }) - - it('another example for mucus peak before temp shift', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakSlightlyBeforeTempShift, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-17', time: '18:00' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-17' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-17', - time: '18:00' - }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date >= '2018-06-17') - }) - }) - - it('with another mucus peak 5 days after fHM ignores it', () => { - const status = getSensiplanStatus({ - cycle: mucusPeak5DaysAfterFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - end: { date: '2018-06-22', time: '18:00' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => { - return date > '2018-06-01' && date <= '2018-06-22' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-22', - time: '18:00' - }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date >= '2018-06-22') - }) - }) - - it('with mucus peak 2 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakTwoDaysBeforeFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-07-03', time: '18:00' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-07-03' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-07-03', - time: '18:00' - }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date >= '2018-07-03') - }) - }) - - it('with mucus peak 5 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: fhm5DaysAfterMucusPeak, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - - describe('applying the minus-8 rule', () => { - it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - it('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - it('shortens the pre-ovu phase if mucus occurs', () => { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => { - return date > '2018-06-01' - }) - }) - }) - - it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { - const status = getSensiplanStatus({ - cycle: cycleWithMucusOnFirstDay, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(1) - - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - cycleDays: cycleWithMucusOnFirstDay - }) - }) - - it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(11).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-07' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-07') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-08' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-07' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not lengthen the pre-ovu phase if < 12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(10).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm, - earlierCycles: [...Array(12).fill(fhmOnDay15)] - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date >= '2018-06-01' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - - describe('when args are wrong', () => { - it('throws when arg object is not in right format', () => { - const wrongObject = { hello: 'world' } - expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) - }) - it('throws if cycle array is empty', () => { - expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) - }) - it('throws if cycle days are not in right format', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - hello: 'world', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2018-04-13', - temperature: {value: '35'}, - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '09-14-2017', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - }) - it('throws if first cycle day does not have bleeding value', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2017-01-01', - bleeding: { - value: 'medium' - } - }], - earlierCycles: [[ - { - date: '2017-09-23', - } - ]] - })).to.throw(AssertionError) - }) }) }) From 80cabee66b84e59c8669233c2153b8d27c13e0c6 Mon Sep 17 00:00:00 2001 From: tina Date: Mon, 3 Sep 2018 13:07:40 +0200 Subject: [PATCH 35/60] adds more meaningful messages to assertion errors --- lib/sympto/index.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/sympto/index.js b/lib/sympto/index.js index ccfbf32..9281d5d 100644 --- a/lib/sympto/index.js +++ b/lib/sympto/index.js @@ -100,20 +100,20 @@ export default function getSymptoThermalStatus(cycleInfo) { function throwIfArgsAreNotInRequiredFormat(cycles) { cycles.forEach(cycle => { - assert.ok(Array.isArray(cycle)) - assert.ok(cycle.length > 0) //what about 2 cycles of 1 day each?! - assert.ok(cycle[0].bleeding !== null) - assert.equal(typeof cycle[0].bleeding, 'object', "First cycle day must contain bleeding value") - assert.equal(typeof cycle[0].bleeding.value, 'number') + assert.ok(Array.isArray(cycle), "Cycles must be arrays.") + assert.ok(cycle.length > 0, "Cycle must not be empty.") //what about 2 cycles of 1 day each?! + assert.ok(cycle[0].bleeding !== null, "First cycle day should have bleeding.") + assert.equal(typeof cycle[0].bleeding, 'object', "First cycle day must contain bleeding value.") + assert.equal(typeof cycle[0].bleeding.value, 'number', "First cycle day bleeding value is a number.") cycle.forEach(day => { - assert.equal(typeof day.date, 'string') - assert.doesNotThrow(() => LocalDate.parse(day.date)) - if (day.temperature) assert.equal(typeof day.temperature.value, 'number') - if (day.mucus) assert.equal(typeof day.mucus.value, 'number') - if (day.mucus) assert.ok(day.mucus.value >= 0) - if (day.mucus) assert.ok(day.mucus.value < 5) - if (day.cervix) assert.equal(typeof day.cervix.isClosed, 'boolean') - if (day.cervix) assert.equal(typeof day.cervix.isHard, 'boolean') + assert.equal(typeof day.date, 'string', "Date is given as a string.") + assert.doesNotThrow(() => LocalDate.parse(day.date), "Date is given in right string format.") + if (day.temperature) assert.equal(typeof day.temperature.value, 'number', "Temperature value is a number.") + if (day.mucus) assert.equal(typeof day.mucus.value, 'number', "Mucus value is a number.") + if (day.mucus) assert.ok(day.mucus.value >= 0, "Mucus value is greater or equal to 0.") + if (day.mucus) assert.ok(day.mucus.value < 5, "Mucus value below 5.") + if (day.cervix) assert.equal(typeof day.cervix.isClosed, 'boolean', "Cervic.isClosed is a boolean.") + if (day.cervix) assert.equal(typeof day.cervix.isHard, 'boolean', "Cervic.isHard is a boolean.") }) }) } From ef75a377d0af29b7071124708d40ad1b167178bd Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Mon, 3 Sep 2018 13:54:52 +0200 Subject: [PATCH 36/60] Fix typo / bug --- components/cycle-day/symptoms/mucus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cycle-day/symptoms/mucus.js b/components/cycle-day/symptoms/mucus.js index ef730f7..6257c7c 100644 --- a/components/cycle-day/symptoms/mucus.js +++ b/components/cycle-day/symptoms/mucus.js @@ -34,7 +34,7 @@ export default class Mucus extends Component { render() { const mucusFeeling = [ - { label: labels.feeling.categories[0], stateKey: ''}, + { label: labels.feeling.categories[0], value: 0 }, { label: labels.feeling.categories[1], value: 1 }, { label: labels.feeling.categories[2], value: 2 }, { label: labels.feeling.categories[3], value: 3 } From d25de32cb4108dfc3f58a8aae4abdf6ffb973c8a Mon Sep 17 00:00:00 2001 From: tina Date: Mon, 3 Sep 2018 15:19:10 +0200 Subject: [PATCH 37/60] changes shades of red in calendar, slider in settings has same style as all the other sliders --- components/calendar.js | 2 +- components/settings.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/components/calendar.js b/components/calendar.js index d579c31..f91b039 100644 --- a/components/calendar.js +++ b/components/calendar.js @@ -53,7 +53,7 @@ export default class CalendarView extends Component { } function toCalFormat(bleedingDaysSortedByDate) { - const shadesOfRed = ['#ffbaba', '#ff7b7b', '#ff5252', '#ff0000'] + const shadesOfRed = ['#ffcbbf', '#ffb19f', '#ff977e', '#ff7e5f'] // light to dark return bleedingDaysSortedByDate.reduce((acc, day) => { acc[day.date] = { startingDay: true, diff --git a/components/settings.js b/components/settings.js index aac1a65..f7b718f 100644 --- a/components/settings.js +++ b/components/settings.js @@ -104,7 +104,6 @@ class TempReminderPicker extends Component { } if (!switchOn) saveTempReminder({ enabled: false }) }} - onTintColor={secondaryColor} /> Date: Tue, 4 Sep 2018 09:54:46 +0200 Subject: [PATCH 38/60] Remove unused dependencies --- package-lock.json | 218 ++++++---------------------------------------- package.json | 7 +- 2 files changed, 30 insertions(+), 195 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1eb8779..bb711bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1685,22 +1685,22 @@ }, "babel-plugin-syntax-class-properties": { "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=" }, "babel-plugin-syntax-flow": { "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=" }, "babel-plugin-syntax-jsx": { "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=" }, "babel-plugin-syntax-object-rest-spread": { "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=" }, "babel-plugin-syntax-trailing-function-commas": { @@ -2490,11 +2490,6 @@ "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, - "clamp": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/clamp/-/clamp-1.0.1.tgz", - "integrity": "sha1-ZqDmQBGBbjcZaCj9yMjBRzEshjQ=" - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -2730,15 +2725,6 @@ "object-assign": "^4.1.1" } }, - "create-react-context": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/create-react-context/-/create-react-context-0.2.2.tgz", - "integrity": "sha512-KkpaLARMhsTsgp0d2NA/R94F/eDLbhXERdIq3LvX2biCAXcDvHYoOqHfWCHf1+OLj+HKBotLG3KqaOOf+C1C+A==", - "requires": { - "fbjs": "^0.8.0", - "gud": "^1.0.0" - } - }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", @@ -3750,11 +3736,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3767,15 +3755,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -3878,7 +3869,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -3888,6 +3880,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3900,17 +3893,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -3927,6 +3923,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3999,7 +3996,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -4009,6 +4007,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4114,6 +4113,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4345,11 +4345,6 @@ "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=" }, - "gud": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", - "integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==" - }, "har-schema": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", @@ -4467,11 +4462,6 @@ "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" }, - "hoist-non-react-statics": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz", - "integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==" - }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -6067,7 +6057,7 @@ "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" }, "wordwrap": { @@ -6206,21 +6196,6 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" }, - "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - } - } - }, "path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", @@ -6392,15 +6367,6 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" }, - "query-string": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.1.0.tgz", - "integrity": "sha512-pNB/Gr8SA8ff8KpUFM36o/WFAlthgaThka5bV19AD9PNTH20Pwq5Zxodif2YyHwrctp6SkL4GqlOot0qR/wGaw==", - "requires": { - "decode-uri-component": "^0.2.0", - "strict-uri-encode": "^2.0.0" - } - }, "querystringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.0.0.tgz", @@ -6491,17 +6457,6 @@ } } }, - "react-is": { - "version": "16.4.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.4.2.tgz", - "integrity": "sha512-rI3cGFj/obHbBz156PvErrS5xc6f1eWyTwyV4mo0vF2lGgXgS+mm7EKD5buLJq6jNgIagQescGSVG2YzgXt8Yg==", - "dev": true - }, - "react-lifecycles-compat": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", - "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" - }, "react-native": { "version": "0.56.0", "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.56.0.tgz", @@ -6595,32 +6550,11 @@ "xdate": "^0.8.0" } }, - "react-native-dismiss-keyboard": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/react-native-dismiss-keyboard/-/react-native-dismiss-keyboard-1.0.0.tgz", - "integrity": "sha1-MohiQrPyMX4SHzrrmwpYXiuHm0k=" - }, "react-native-document-picker": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/react-native-document-picker/-/react-native-document-picker-2.1.0.tgz", "integrity": "sha512-BFCBXwz8xuLvHLVFVeQM+RhaY8yZ38PEWt9WSbq5VIoZ/VssP6uu51XxOfdwaMALOrAHIojK0SiYnd155upZAg==" }, - "react-native-drawer-layout": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/react-native-drawer-layout/-/react-native-drawer-layout-1.3.2.tgz", - "integrity": "sha512-fjO0scqbJUfNu2wuEpvywL7DYLXuCXJ2W/zYhWz986rdLytidbys1QGVvkaszHrb4Y7OqO96mTkgpOcP8KWevw==", - "requires": { - "react-native-dismiss-keyboard": "1.0.0" - } - }, - "react-native-drawer-layout-polyfill": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/react-native-drawer-layout-polyfill/-/react-native-drawer-layout-polyfill-1.3.2.tgz", - "integrity": "sha512-XzPhfLDJrYHru+e8+dFwhf0FtTeAp7JXPpFYezYV6P1nTeA1Tia/kDpFT+O2DWTrBKBEI8FGhZnThrroZmHIxg==", - "requires": { - "react-native-drawer-layout": "1.3.2" - } - }, "react-native-fs": { "version": "2.10.14", "resolved": "https://registry.npmjs.org/react-native-fs/-/react-native-fs-2.10.14.tgz", @@ -6676,27 +6610,11 @@ "resolved": "https://registry.npmjs.org/react-native-push-notification/-/react-native-push-notification-3.1.1.tgz", "integrity": "sha512-4+4yQXNPqh5IVvpSBmR4Cy/UeMjTcfE8KIJgEuT7pME97WK+aGPn6W3ybhOoXC1n+ZWKfrAlsHydLE4xfBZDJg==" }, - "react-native-safe-area-view": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.8.0.tgz", - "integrity": "sha512-uAUzpBxXPVmfupz71GYcPjUBnZFtDuThKO/Q4FWEUykSuML78lItYR6JRsE006CY6gw6mUwpk4MJjhDE4uZ+Ww==", - "requires": { - "hoist-non-react-statics": "^2.3.1" - } - }, "react-native-share": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/react-native-share/-/react-native-share-1.1.0.tgz", "integrity": "sha512-uQXo+HzZGUo9VlfgfWwGa9vLrY9OBQOFAsxhH/e3GWAlCxrGGjXNu/La+aJzMJdhoHzzn1+NRWDp1LWvlxJHew==" }, - "react-native-tab-view": { - "version": "0.0.77", - "resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-0.0.77.tgz", - "integrity": "sha512-9vjD4Ly1Zlum1Y4g23ODpi/F3gYIUIsKWrsZO/Oh5cuX1eiB1DRVn11nY1z+j/hsQfhfyW6nDlmySyDvYQvYCA==", - "requires": { - "prop-types": "^15.6.0" - } - }, "react-native-vector-icons": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-5.0.0.tgz", @@ -6729,69 +6647,6 @@ } } }, - "react-navigation": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-2.10.0.tgz", - "integrity": "sha512-+Jt2PrJ3H+mYfexBySgvrEfXxJ0AAMZVYJNh8wXInHXGqrZKaSSd73z4yGcOkQQfsNE9sHjZk5yvE101KZJ+Ew==", - "requires": { - "clamp": "^1.0.1", - "create-react-context": "^0.2.1", - "hoist-non-react-statics": "^2.2.0", - "path-to-regexp": "^1.7.0", - "query-string": "^6.1.0", - "react-lifecycles-compat": "^3", - "react-native-safe-area-view": "^0.8.0", - "react-navigation-deprecated-tab-navigator": "1.3.0", - "react-navigation-drawer": "0.5.0", - "react-navigation-tabs": "0.6.0" - } - }, - "react-navigation-deprecated-tab-navigator": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/react-navigation-deprecated-tab-navigator/-/react-navigation-deprecated-tab-navigator-1.3.0.tgz", - "integrity": "sha512-Cm+qYOPFWbvvcuv0YYX0ioYwLGgw7XAqdhAfpo3sIr3trxRW8871ePmfFOPezjQtz4v6ItjZt6LPgtBAVZoroQ==", - "requires": { - "react-native-tab-view": "^0.0.77" - } - }, - "react-navigation-drawer": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-0.5.0.tgz", - "integrity": "sha512-F1y593uC6pqBMGH+Omz75oNODEbxB/s0EGO8QtYwu1NmOOEUuuLA+c14zm+pgMsI4HlDabiHxPkWqsgGz25xVQ==", - "requires": { - "react-native-drawer-layout-polyfill": "^1.3.2" - } - }, - "react-navigation-tabs": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/react-navigation-tabs/-/react-navigation-tabs-0.6.0.tgz", - "integrity": "sha512-Ax1rujJ51R1Jrz7b5bHUAIgsYC1VrFws+d3hxlPy5dXG84iJdV5dnDFRvdQMDDfDZc+NDx2a223lAYsc3p2+XA==", - "requires": { - "hoist-non-react-statics": "^2.5.0", - "prop-types": "^15.6.1", - "react-lifecycles-compat": "^3.0.4", - "react-native-safe-area-view": "^0.7.0", - "react-native-tab-view": "^1.0.0" - }, - "dependencies": { - "react-native-safe-area-view": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/react-native-safe-area-view/-/react-native-safe-area-view-0.7.0.tgz", - "integrity": "sha512-SjLdW/Th0WVMhyngH4O6yC21S+O4U4AAG3QxBr7fZ2ftgjXSpKbDHAhEpxBdFwei6HsnsC2h9oYMtPpaW9nfGg==", - "requires": { - "hoist-non-react-statics": "^2.3.1" - } - }, - "react-native-tab-view": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/react-native-tab-view/-/react-native-tab-view-1.0.2.tgz", - "integrity": "sha512-x8I43V1X7/AyMnIwnqJGMU54LqQRlV6vJ9irbls9asA/axdHIdxagPIV6Jx1ttFe/bPKhFwXL+lRYdYxGyUlWg==", - "requires": { - "prop-types": "^15.6.1" - } - } - } - }, "react-proxy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/react-proxy/-/react-proxy-1.1.8.tgz", @@ -6801,18 +6656,6 @@ "react-deep-force-update": "^1.0.0" } }, - "react-test-renderer": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.3.1.tgz", - "integrity": "sha512-emEcIPUowMjT5EQ+rrb0FAwVCzuJ+LKDweoYDh073v2/jHxrBDPUk8nzI5dofG3R+140+Bb9TMcT2Ez5OP6pQw==", - "dev": true, - "requires": { - "fbjs": "^0.8.16", - "object-assign": "^4.1.1", - "prop-types": "^15.6.0", - "react-is": "^16.3.1" - } - }, "react-timer-mixin": { "version": "0.13.4", "resolved": "https://registry.npmjs.org/react-timer-mixin/-/react-timer-mixin-0.13.4.tgz", @@ -7528,7 +7371,7 @@ }, "sax": { "version": "1.1.6", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.6.tgz", + "resolved": "http://registry.npmjs.org/sax/-/sax-1.1.6.tgz", "integrity": "sha1-XWFr6KXmB9VOEUr65Vt+ry/MMkA=" }, "seek-bzip": { @@ -7991,11 +7834,6 @@ "resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-1.0.0.tgz", "integrity": "sha1-kc8lac5NxQYf6816yyY5SloRR1E=" }, - "strict-uri-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=" - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -8186,7 +8024,7 @@ "dependencies": { "rimraf": { "version": "2.2.8", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "resolved": "http://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=" } } diff --git a/package.json b/package.json index 10449e5..a58e129 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,7 @@ "react-native-push-notification": "^3.1.1", "react-native-share": "^1.1.0", "react-native-vector-icons": "^5.0.0", - "react-navigation": "^2.0.4", - "realm": "^2.7.1", - "uuid": "^3.2.1" + "realm": "^2.7.1" }, "devDependencies": { "@babel/register": "^7.0.0-beta.55", @@ -46,8 +44,7 @@ "dirty-chai": "^2.0.1", "eslint": "^4.19.1", "eslint-plugin-react": "^7.8.2", - "mocha": "^5.2.0", - "react-test-renderer": "16.3.1" + "mocha": "^5.2.0" }, "description": "A menstrual cycle tracking app that's open-source and leaves your data on your phone. Use it to track your menstrual cycle or for fertility awareness!", "main": "index.js", From d0f90ff8c089bd26af302869870d30593320141c Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Tue, 4 Sep 2018 17:14:41 +0200 Subject: [PATCH 39/60] Delete drawable assets because release won't build otherwise --- .../main/res/drawable-hdpi/ic_notification.png | Bin 430 -> 0 bytes ...eactnativecalendars_src_calendar_img_next.png | Bin 216 -> 0 bytes ...nativecalendars_src_calendar_img_previous.png | Bin 214 -> 0 bytes ...reactnavigation_src_views_assets_backicon.png | Bin 134 -> 0 bytes .../main/res/drawable-mdpi/ic_notification.png | Bin 327 -> 0 bytes ...reactnavigation_src_views_assets_backicon.png | Bin 100 -> 0 bytes ...tnavigation_src_views_assets_backiconmask.png | Bin 659 -> 0 bytes .../main/res/drawable-xhdpi/ic_notification.png | Bin 642 -> 0 bytes ...eactnativecalendars_src_calendar_img_next.png | Bin 232 -> 0 bytes ...nativecalendars_src_calendar_img_previous.png | Bin 239 -> 0 bytes ...reactnavigation_src_views_assets_backicon.png | Bin 134 -> 0 bytes .../main/res/drawable-xxhdpi/ic_notification.png | Bin 879 -> 0 bytes ...eactnativecalendars_src_calendar_img_next.png | Bin 328 -> 0 bytes ...nativecalendars_src_calendar_img_previous.png | Bin 332 -> 0 bytes ...reactnavigation_src_views_assets_backicon.png | Bin 167 -> 0 bytes .../res/drawable-xxxhdpi/ic_notification.png | Bin 1255 -> 0 bytes ...eactnativecalendars_src_calendar_img_next.png | Bin 388 -> 0 bytes ...nativecalendars_src_calendar_img_previous.png | Bin 394 -> 0 bytes ...reactnavigation_src_views_assets_backicon.png | Bin 207 -> 0 bytes 19 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 android/app/src/main/res/drawable-hdpi/ic_notification.png delete mode 100644 android/app/src/main/res/drawable-hdpi/node_modules_reactnativecalendars_src_calendar_img_next.png delete mode 100644 android/app/src/main/res/drawable-hdpi/node_modules_reactnativecalendars_src_calendar_img_previous.png delete mode 100644 android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png delete mode 100644 android/app/src/main/res/drawable-mdpi/ic_notification.png delete mode 100644 android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backicon.png delete mode 100644 android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backiconmask.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/ic_notification.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecalendars_src_calendar_img_next.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecalendars_src_calendar_img_previous.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png delete mode 100644 android/app/src/main/res/drawable-xxhdpi/ic_notification.png delete mode 100644 android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecalendars_src_calendar_img_next.png delete mode 100644 android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecalendars_src_calendar_img_previous.png delete mode 100644 android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png delete mode 100644 android/app/src/main/res/drawable-xxxhdpi/ic_notification.png delete mode 100644 android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnativecalendars_src_calendar_img_next.png delete mode 100644 android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnativecalendars_src_calendar_img_previous.png delete mode 100644 android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png diff --git a/android/app/src/main/res/drawable-hdpi/ic_notification.png b/android/app/src/main/res/drawable-hdpi/ic_notification.png deleted file mode 100644 index 58405822bf648ee118a2416345c123b3fcd13c61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 430 zcmV;f0a5;mP) zze`nN9Kd0QIU zRw7U#tbM^QMlgsiv|$K8@CM(oj{PumATOp65U-=PK75KmZQ*(*+B1aDC}J2VIKXhU z=Ox~woCnm84>i`GSAq7?n*n-NV@?GR@_+_VsjST257OyoOc+_11e%I9)@0Q z)&bf>f3#;l{6igo4GK4Q;}pl(2nTc(XBZ3TY^Mq|i0vxSGJb{`NBEWdP)83a;VG6d z9T4*Y+k#mXqWxtTpNTsWsO;kNu!LvmtP6A9B2XcF_brq_StU?bXb*2ybE7S(R4SFH YbBQ93l&n;v-2eap07*qoM6N<$f}>fsKmY&$ diff --git a/android/app/src/main/res/drawable-hdpi/node_modules_reactnativecalendars_src_calendar_img_next.png b/android/app/src/main/res/drawable-hdpi/node_modules_reactnativecalendars_src_calendar_img_next.png deleted file mode 100644 index 8762679b0ada5163299de7455f7020a80a82f71a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBI14-?iy0UMW`i(eN#`7IpkSA$ zi(^Q{;kVb%ayA(7us#s)_q!Z9$HBaaIrcza`udk_a$!U{- zhe9LEFP#%v+Bf4ew%@vzqicOb;}}n1;F^WY7S4!vbKH2{uBYlTUu(er9am=Sf1b%I za%h8NB9E}k!3_>3Jj^af85r)=Y82j0-SSP-*FL|k1|%Oc%$NbBI14-?iy0UMW`i(eN#`7IpkRlm zi(^Q{;kVZ>ayA(7uw3Y#?{_(Jj)Qp-bL@e<<@=xa3*XRgDQc_}liRCuL7~&fR54OA zWr8CcFK5@UDJBb6oaajLXZ&U0-gQDmLeiskV#AafX%nO_v%G4Q%r-2V>CX_oO8ix0 zR-aGrq%RYMRI{^0y{uA&L_B{UESx4}fdKcH`33L;Kr>mdK II;Vst0Gx?RRR910 diff --git a/android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png b/android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png deleted file mode 100644 index ad03a63bf3caba175695f5acca85a690dda2d02c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 134 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;ucwP+NCjiE#Ight69&c5o}c_J zydef`Jl72k0*^~vo0xKDg<-rzRAUa4z0iNhpCkVkqZYUZGIf&AR;#xR|hF4PW}OZ;LGKsmc#tW zRwgPL3?bDlKpu-2Y!;v&6^yhLfE6Tv8rp?9Y{pqZ0b?j5 zferLv0Fzk70=hp7Plfpgd$_|Dig?6H0G=?6T|A(Mb8I2g2r!PLXqSwD3zV>rT=-t& zMm3y8v2@JEMt}m2>*nofR*H714}dC8>-<%e8UfN+$89ve$0eq*_P$uWU=#;<#v!hw zQ1&Z(n8yyLA}EImbcSaceX;a%EPV;R4a2`9WFvg`*Fswj$iz1?(=0$D-a@`9fVTdQ Z-Ti2oqCN-+Qc002ovPDHLkV1my{ibenc diff --git a/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backicon.png b/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backicon.png deleted file mode 100644 index 083db295f474b9903408258c71818c2c49151d35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1ZBG}+kP60RiDL^GIXr{@&3`D~ x%$9kI*}bEvWP)6o;9anc+?EEZbfD3wanfO{T9 z4xm!0Ob_A@Jb)ZPyy+RGZkNM3&E2`810JZ|{s6q#zR4UEWGamr}`}`MK0KZ%&fOH7;{v>Yo zLL^;A(~V63Q6ef?maPvJJ-rZ3kJIUeCK>};6~9uZm-;~-Rw>6F^#`_uhZb{L0PVru zr~nJ&;q^4Zk*1jRC;56m%^Jj>N5W~MJEa=*BAs$Zoa~X(ZBoKh?^Dk1NCL!3e<9E< zNq{)*61WiuPKmE6^;kanyZ37cF31ANFMx=bpa7?1LunCET87m-h$FH9@=FmTh*7eO tL1Tz4%XR>tB>{dG;OlIFj(mg90{|ERezlm^CdmK*002ovPDHLkV1n#N8`J;* diff --git a/android/app/src/main/res/drawable-xhdpi/ic_notification.png b/android/app/src/main/res/drawable-xhdpi/ic_notification.png deleted file mode 100644 index 1bdb4bd53e9e6b94bf8daf92b194331d50f6c9d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 642 zcmV-|0)737P)Nkl z$G0qjnfQtaSdNJp9CN2|31eftNQRd~Ka zV{!!6;&B{ZGCST=bYgf(;j=D20JCB#UBDrkt+X2ZF(>NkW%lo%{@`FSR*1blOQ1IH zerNPPD)X~rU|GWF2~w7?`z(Q)taE+K)&Gx^PvEa22~?USP-*@JfeAQ_zLn0BNF)-8 cMB=~YJMbs>%jRKWYybcN07*qoM6N<$f_2U(J^%m! diff --git a/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecalendars_src_calendar_img_next.png b/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecalendars_src_calendar_img_next.png deleted file mode 100644 index 2df4a544b309669314d2cc1277fc2a9261d6530b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?2=RS;(M3{v?36rAPh z;uw-~@9oXgoDBvdE*Hh8PfKTxnq`(ynU~D#^v>gfA8YZ6=d72i-kTOrn`Ohq!XcpG z(7?dR#J2SAdCT8iZ!%dnwl3m$#dAd9iDI9^i)apam34t46K63?C|RBmaH$gFcmFZv z$BfnauMM>mDt@XkXwGL!cq+`W#fJC5>B$Wqm0SYa{tSzru3k0E-UMNM-D&QFJ5A^D TJ$wHP=t>4pS3j3^P6FVdQ&MBb@04K9hS^xk5 diff --git a/android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png b/android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png deleted file mode 100644 index 6de0a1cbb365dfd5d9274890d243ca2321f32235..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 134 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tUr!gukP61P(+)Bo5D;KluXOkB z|6f;`Uoa>nrTyP5;4+Jm;dJDxe#>oP@r$y*#>rHDd13s5eN)8##R;WH*ZD4M;?i1i i;i&z7`QNqd4J-@3aX4v+{p181%;4$j=d#Wzp$P!F!7nZV diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_notification.png b/android/app/src/main/res/drawable-xxhdpi/ic_notification.png deleted file mode 100644 index 9af70b030606f70a4d6666dd5434aa2d998ea239..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 879 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@Zgyv2U^eq~aSW-L^Y*59hpeke!^1Os zD}7~}rQ#oWUC5o#F)<^o>7ct<(+`J(twKj6LXeBlg|+Ij3a7;t$;CV&2sFSp@~Oii9Y#hI%-P!k7^&6xJNIv*|f!P!tp5*RbHV zL7%x_rsGGijUspVeY=)#SfV_AqS>+4s+*b06U@IokhSUVe)MBbQ-R^UgVTQO<>F5g z5Bv5dx_x=!cbQ~+5yNRm-<#fO+^#(R?hgLdZTXMxpDazP{~>4mgS-8M^|Hme*2ma5 zZb`g-|4{0W;B%RylD2=}9l39KbK*W3yMBr157t@KTP4XJnSZg&;8^snWea8-GI zuYSQ5Bd`7N_KY{LMIGZGIdt4@tFBVN6mX$i@oBhC)9gaayo16PJ<2<_+aKHTq$DZm z@{U@E`FR|3QYS398M-COVUAkUkt|7BfyZ7xtw%nK8GU!t`2JI5TllZFhy6tzA4k;B zk?>{t+vYnpCNFqf9^4?mGUyFnmcP=<@5Y}ld^|wFCck<42 z+%XcKd)FUKmd+1ldAoMbeU}UDe~&-wxP0{V#s8b4?tNb7eqrCO(C&ZB=PtOoWBUG} zn;)hm<@$3s*@dnwowD|!aO!)Rd%9xHwvyjJUGv(%^~X9^$M%9;)pKd7@9$hq>El*f zcdSw3!!gF%T|c5Uue9lAu-U&@dEoc2wc+!oOIhhX17gj}wD_#S0yG|DY9D@W%Va(u;B0X66r6Z3<)@ zlRy4uvbj3>bo;6DC07s6_+78$qI3QG&g2uxa>^@~?-kxTXV?9HKbB?|RY$H>6PmP^ zEa1{y;e^6$c)sy^!+DwIwh_IX#jX31Q|*)gNA1h1|EoUW-aHMMkr+H({an^LB{Ts5 D8bYHC diff --git a/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecalendars_src_calendar_img_next.png b/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecalendars_src_calendar_img_next.png deleted file mode 100644 index f79bfd7cba6129e9818ebf9f4470323b8b8e3a69..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 328 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!oCO|{#S9FJ<{->y95KHNDEQ0M z#WAGf*4x_~d6^6aTrL_aa!zsL3}>DiaPz7I=M<)sOP4iue_#J~d5ikZdyyxT&q)@~ z>tqrax8$Qo zOE^!jOXahT9!o4aI$fki3O$Z^O0~MIm6A{?5_eX(csk26sNF2S>q_d~z_urL8G;Mq zC*|6$mv3~ikZtfPeBtoaB1M6PPn4tCnZ@bhg@ytP6$KSOR*r6G2B*g%%nu8-8lxVB zFxKvVpmOqqciMk5eTXv!!7c<5Mo_13ar?L9cwF&nQST05C@^@s`njxgN@xNAg_Ci+ diff --git a/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecalendars_src_calendar_img_previous.png b/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecalendars_src_calendar_img_previous.png deleted file mode 100644 index 23e08801349509a62d769ce8b5626b6138009843..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!oCO|{#S9FJ<{->y95KHNDEQCQ z#WAGf*4x{=1(^&5SS|{x@wGT{9C1)_apP%m(0DLMJI3H#YIXlSmXNPr^JSfr&q;2c zH9)Oh52HkSEJQ~DU78DH5p&ETwZqezvzWMZ{$7CdB!p2 zGOT>lQR=9*x7kWzYW$@Vl_T12Zij3>hp1eUadA1s+hwBiM8((XP#7DO<$f$_t-m`#N(R0!@qfL6}is!BA-aP5mqcux*S)AYDzOuXc@WF!zU-mWw z!RNIrdq3B7GJgpV3USMNx+#Bt3lxOZSlm}!I$z&?|8f=2ODy@*gQAaCs?P@6%;4$j K=d#Wzp$P!X&_+4{ diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_notification.png b/android/app/src/main/res/drawable-xxxhdpi/ic_notification.png deleted file mode 100644 index 45e66248aff96311c3ea623827fd3a1dd88669be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1255 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>U|Hws;uumf=k0Cpj<8aRKmO-0p7m_5WqMV7f8TlWIJR>??ax=9`~3U7^RA|T zPYcP@AKCw%sp~FDw%>R3PTBK9j|4x(i+3$I$|p$5O%pp-+dBPrV`VeP29^82IoChE zcjI%9-=7!zl@sC?-gWk6sZdd$wI%g#z=vvv*&DdNKhk}p#laW8-Fp7i17Ge`R|#!i z<+)ok=)L`n+wTrM6k>XFzVqd&q%(2~(^fInOizA!O36R_(f56S-pC1xg`5qJo=_$$ z@40uMusQ#wx+x~-#oP}kFqsq`3VYP!_$OR+L8J4fn_n94^X%}55|{ejV--%mY7=poUMK9 z+!1qCR*R0Ks(-^o6Xf;QO8joG6v+vCevV`L6NLvSyS62NsPtqkd$ep)-D<82ot~n} z`;BkE(=gV$-L~aN-Q4D#*&N@by}35h_m-aK1^BlBe z`Cmi|=q{7~{mQzB;zPIC?l!1;C6b`g z{o(f|r9Z64!Z+qx?qJ>jTs$i1(lX|L&(zLctS^pf|EdY(fAC-H<>3w7r%&D3BD!+g zC(pWxb0bVVeg{@C?AQFSc+HPds#3%zZ^CBgm>KT5%J#`wGiTiDE8*B=&i>7Knt7&q z=&xCK*G6eBn#=S>rDT1`+PU|Rytlnn?p?lZb^gb<-6ee1`!6i!^AtT}8Wi|ib7joN z*!-=9(t6Xx4qCC!==A>@mR*0)Y9-4)p?t5<3x9WRHYw=svRL>zdufMX58*OQXSEq{`-ey zZ}#WCSH1Wu&rDi1E4whd-gfJHhM!UF=O((n`Q~(|`h%g^${n$5WnWt4d%a6_Kl`wv zp6Sa@`>6MhXDyCjn)qbnfdnR&Ts4*zGX)l;IW^4UWX!_Lk<>Xl{gQo>Otk60hYck~ n=I&Of`=aUvSRApU(?8ie+>?XmB;0QT7GMmXu6{1-oD!MEaktaqI0}N6|wD3@!(!D1S0wxYWh?q>xvu;%weC?;Di?vt%ru&2he7YRt&Mz{KFd zz`z02$e_T$z{1eLz#xDuxPX_T@BDX`g52}60%8BTR=Imru!Sfuv1!Q`oK(jesK3Ac=7QvK38c=a)y qeT95|k0IZG#mB<EaktaqI2f-Moh!7+eloySP-EG(TP*-+rv1Kz7M z%I*XNJ!(VLzdH4Ge@o8ai4)e^3vK%P+bZq#{MQci z?P`C0d3kxcKa^1~`zt>B;jiLd|K_aKfAEz>edFmDy)D6SUw`+o@R*?B*u=sqq~bB* zgRIJrKN^lr3+tD}bFTI}~XjubmVU5CWQ(LZ;AgeuH{an^LB{Ts5E|^v% From 7f66081e7218e978d9bd9049a29fee4163e59141 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Tue, 4 Sep 2018 17:15:00 +0200 Subject: [PATCH 40/60] Add config to be able to build (see pull request description as well) --- .gitignore | 7 +++++++ android/app/build.gradle | 11 +++++++++++ android/gradle.properties | 1 + 3 files changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index 5d64756..b34f55a 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,10 @@ buck-out/ # Bundle artifact *.jsbundle + +# RN android release +android/app/bin/ +android/app/release/ +android/app/src/main/assets/index.android.bundle +android/.project +android/app/.project diff --git a/android/app/build.gradle b/android/app/build.gradle index 6348b76..f33fb0e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -108,6 +108,16 @@ android { abiFilters "armeabi-v7a", "x86" } } + signingConfigs { + release { + if (project.hasProperty('DRIP_RELEASE_STORE_FILE')) { + storeFile file(DRIP_RELEASE_STORE_FILE) + storePassword DRIP_RELEASE_STORE_PASSWORD + keyAlias DRIP_RELEASE_KEY_ALIAS + keyPassword DRIP_RELEASE_KEY_PASSWORD + } + } + } splits { abi { reset() @@ -120,6 +130,7 @@ android { release { minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + signingConfig signingConfigs.release } } // applicationVariants are e.g. debug, release diff --git a/android/gradle.properties b/android/gradle.properties index 1fd964e..913bbb4 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -18,3 +18,4 @@ # org.gradle.parallel=true android.useDeprecatedNdk=true +android.enableAapt2=false \ No newline at end of file From 1c2c45f8c67a224ec5f886f26fdc8bb45ce11e92 Mon Sep 17 00:00:00 2001 From: emelko Date: Wed, 5 Sep 2018 15:27:04 +0200 Subject: [PATCH 41/60] Changes cervix value to check for opening and firmness value --- lib/sympto/cervix.js | 4 +- lib/sympto/index.js | 7 +- test/sympto/cervix-temp-fixtures.js | 275 ++++++++++++++-------------- 3 files changed, 148 insertions(+), 138 deletions(-) diff --git a/lib/sympto/cervix.js b/lib/sympto/cervix.js index 01abe36..2e0dff4 100644 --- a/lib/sympto/cervix.js +++ b/lib/sympto/cervix.js @@ -36,6 +36,6 @@ export default function (cycleDays, tempEvalEndIndex) { return { detected: false } } -function isClosedAndHard (cervixValue) { - return cervixValue.isClosed && cervixValue.isHard +function isClosedAndHard (cervix) { + return cervix.value.opening === 0 && cervix.value.firmness === 0 } diff --git a/lib/sympto/index.js b/lib/sympto/index.js index ccfbf32..c50fcbb 100644 --- a/lib/sympto/index.js +++ b/lib/sympto/index.js @@ -112,8 +112,11 @@ function throwIfArgsAreNotInRequiredFormat(cycles) { if (day.mucus) assert.equal(typeof day.mucus.value, 'number') if (day.mucus) assert.ok(day.mucus.value >= 0) if (day.mucus) assert.ok(day.mucus.value < 5) - if (day.cervix) assert.equal(typeof day.cervix.isClosed, 'boolean') - if (day.cervix) assert.equal(typeof day.cervix.isHard, 'boolean') + if (day.cervix) assert.equal(typeof day.cervix.value, 'object') + if (day.cervix) assert.ok(day.cervix.value.opening >= 0, "cervix opening value must be 0 or bigger") + if (day.cervix) assert.ok(day.cervix.value.opening <= 2, "cervix opening value must be 2 or smaller") + if (day.cervix) assert.ok(day.cervix.value.firmness >= 0, "cervix firmness value must be 0 or bigger") + if (day.cervix) assert.ok(day.cervix.value.firmness <= 1, "cervix firmness value must be 1 or smaller") }) }) } diff --git a/test/sympto/cervix-temp-fixtures.js b/test/sympto/cervix-temp-fixtures.js index 66239e5..d5b85a5 100644 --- a/test/sympto/cervix-temp-fixtures.js +++ b/test/sympto/cervix-temp-fixtures.js @@ -17,72 +17,79 @@ function convertToSymptoFormat(val) { } export const idealCycle = [ - { date: '2018-08-01', bleeding: 1, cervix: { isClosed: false, isHard: false } }, - { date: '2018-08-02', bleeding: 2, cervix: { isClosed: false, isHard: false } }, - { date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { isClosed: false, isHard: false } }, - { date: '2018-08-04', temperature: 36.55, bleeding: 1, cervix: { isClosed: false, isHard: true } }, - { date: '2018-08-05', temperature: 36.6, bleeding: null, cervix: { isClosed: true, isHard: false } }, - { date: '2018-08-06', temperature: 36.65, bleeding: null, cervix: { isClosed: true, isHard: false } }, - { date: '2018-08-07', temperature: 36.7, bleeding: null, cervix: { isClosed: false, isHard: true } }, - { date: '2018-08-08', temperature: 36.6, bleeding: null, cervix: { isClosed: true, isHard: false } }, - { date: '2018-08-09', temperature: 36.8, bleeding: null, cervix: { isClosed: true, isHard: true } }, - { date: '2018-08-10', temperature: 36.75, bleeding: null, cervix: { isClosed: true, isHard: true } }, - { date: '2018-08-11', temperature: 36.9, bleeding: null, cervix: { isClosed: true, isHard: true } }, - { date: '2018-08-12', temperature: 36.95, bleeding: null, cervix: { isClosed: true, isHard: true } }, - { date: '2018-08-13', temperature: 36.95, bleeding: null, cervix: { isClosed: true, isHard: true } } + { date: '2018-08-01', bleeding: 1, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-08-02', bleeding: 2, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-08-04', temperature: 36.55, bleeding: 1, cervix: { opening: 2, firmness: 0 } }, + { date: '2018-08-05', temperature: 36.6, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-08-06', temperature: 36.65, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-08-07', temperature: 36.71, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-08-08', temperature: 36.69, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-08-09', temperature: 36.64, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-08-10', temperature: 36.66, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-08-11', temperature: 36.61, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-08-12', temperature: 36.6, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-08-13', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-14', temperature: 36.85, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-15', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-16', temperature: 36.95, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-17', temperature: 36.95, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) export const cycleWithFhmNoCervixShift = [ - { date: '2018-06-01', temperature: 36.6, bleeding: 2 }, - { date: '2018-06-02', temperature: 36.65 }, - { date: '2018-06-04', temperature: 36.6 }, - { date: '2018-06-05', temperature: 36.55 }, - { date: '2018-06-06', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-13', temperature: 36.8, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-15', temperature: 36.9, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-17', temperature: 36.9, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-17', temperature: 36.9, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-18', temperature: 36.9, cervix: { isClosed: false, isHard: false } } + { date: '2018-08-01', bleeding: 1, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-08-02', bleeding: 2, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-08-04', temperature: 36.55, bleeding: 1, cervix: { opening: 2, firmness: 0 } }, + { date: '2018-08-05', temperature: 36.6, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-08-06', temperature: 36.65, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-08-07', temperature: 36.7, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-08-08', temperature: 36.6, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-08-09', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-10', temperature: 36.85, cervix: { opening: 2, firmness: 0 } }, + { date: '2018-08-11', temperature: 36.9, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-08-12', temperature: 36.95, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-08-13', temperature: 36.95, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) -export const cycleWithoutFhm = [ +export const cycleWithoutFhmNoCervixShift = [ { date: '2018-06-02', temperature: 36.6, bleeding: 2 }, { date: '2018-06-03', temperature: 36.65 }, { date: '2018-06-04', temperature: 36.6 }, { date: '2018-06-05', temperature: 36.55 }, - { date: '2018-06-06', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-09', temperature: 36.8, cervix: { isClosed: true, isHard: false } }, - { date: '2018-06-10', temperature: 36.9, cervix: { isClosed: false, isHard: true } }, - { date: '2018-06-13', temperature: 36.9, cervix: { isClosed: false, isHard: false } } + { date: '2018-06-06', temperature: 36.7, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-09', temperature: 36.8 }, + { date: '2018-06-10', temperature: 36.9, cervix: { opening: 2, firmness: 0 } }, + { date: '2018-06-13', temperature: 36.9, cervix: { opening: 1, firmness: 1 } } ].map(convertToSymptoFormat) export const cycleWithoutAnyShifts = [ - { date: '2018-07-01', temperature: 36.65, bleeding: 2, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-02', temperature: 36.45, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-03', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-04', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-05', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-06', temperature: 36.85, cervix: { isClosed: true, isHard: false } }, - { date: '2018-07-07', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-08', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-09', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-10', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-11', temperature: 36.35, cervix: { isClosed: true, isHard: true } }, - { date: '2018-07-12', temperature: 36.65, cervix: { isClosed: true, isHard: true } }, - { date: '2018-07-13', temperature: 36.25, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-14', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-15', temperature: 36.65, cervix: { isClosed: false, isHard: true } }, - { date: '2018-07-16', temperature: 36.15, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-17', temperature: 36.65, cervix: { isClosed: true, isHard: false } }, - { date: '2018-07-18', temperature: 36.25, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-19', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-20', temperature: 36.45, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-21', temperature: 36.5, cervix: { isClosed: true, isHard: true } }, - { date: '2018-07-22', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-23', temperature: 36.75, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-24', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-07-25', temperature: 36.65, cervix: { isClosed: true, isHard: false } }, - { date: '2018-07-26', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, + { date: '2018-07-01', temperature: 36.65, bleeding: -1, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-02', temperature: 36.45, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-03', temperature: 36.65, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-07-04', temperature: 36.65, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-07-05', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-06', temperature: 36.85, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-07-07', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-08', temperature: 36.65, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-07-09', temperature: 36.65, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-07-10', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-11', temperature: 36.35, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-07-12', temperature: 36.65, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-07-13', temperature: 36.25, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-14', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-15', temperature: 36.65, cervix: { opening: 2, firmness: 0 } }, + { date: '2018-07-16', temperature: 36.15, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-07-17', temperature: 36.65, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-07-18', temperature: 36.25, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-07-19', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-20', temperature: 36.45, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-21', temperature: 36.5, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-07-22', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-23', temperature: 36.75, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-24', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-25', temperature: 36.65, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-07-26', temperature: 36.65, cervix: { opening: 2, firmness: 1 } }, ].map(convertToSymptoFormat) export const longAndComplicatedCycle = [ @@ -90,22 +97,22 @@ export const longAndComplicatedCycle = [ { date: '2018-06-02', temperature: 36.65 }, { date: '2018-06-04', temperature: 36.6 }, { date: '2018-06-05', temperature: 36.55 }, - { date: '2018-06-06', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-09', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-10', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-13', temperature: 36.45, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-14', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-15', temperature: 36.55, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-16', temperature: 36.7, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-17', temperature: 36.65, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-18', temperature: 36.75, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-19', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-20', temperature: 36.85, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-21', temperature: 36.8, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-22', temperature: 36.9, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-25', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-26', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-27', temperature: 36.9, cervix: { isClosed: true, isHard: true } } + { date: '2018-06-06', temperature: 36.7, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-09', temperature: 36.5, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-06-10', temperature: 36.4, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-06-13', temperature: 36.45, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-14', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-15', temperature: 36.55, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-16', temperature: 36.7, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-06-17', temperature: 36.65, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-06-18', temperature: 36.75, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-19', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-20', temperature: 36.85, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-21', temperature: 36.8, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-22', temperature: 36.9, cervix: { opening: 2, firmness: 1 } }, + { date: '2018-06-25', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-26', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-27', temperature: 36.9, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) export const tempAndCervixEvalEndOnSameDay = [ @@ -115,25 +122,25 @@ export const tempAndCervixEvalEndOnSameDay = [ { date: '2018-06-04', bleeding: 2 }, { date: '2018-06-05', bleeding: 1 }, { date: '2018-06-06', bleeding: 1 }, - { date: '2018-06-07', cervix: { isClosed: false, isHard: true } }, - { date: '2018-06-08', temperature: 36.45, cervix: { isClosed: true, isHard: false } }, - { date: '2018-06-09', temperature: 36.5, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-10', temperature: 36.30, cervix: { isClosed: true, isHard: false } }, - { date: '2018-06-11', temperature: 36.30, cervix: { isClosed: false, isHard: true } }, - { date: '2018-06-12', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-13', temperature: 36.3, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-14', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, - { date: '2018-06-15', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-16', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-17', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-18', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-19', temperature: 36.95, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-20', temperature: 37.0, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-21', temperature: 37.0, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-22', temperature: 37.0, cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-23', cervix: { isClosed: true, isHard: true } }, - { date: '2018-06-24', cervix: { isClosed: true, isHard: true }}, - { date: '2018-06-25', cervix: { isClosed: false, isHard: false } } + { date: '2018-06-07', cervix: { opening: 2, firmness: 0 } }, + { date: '2018-06-08', temperature: 36.45, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-06-09', temperature: 36.5, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-10', temperature: 36.30, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-06-11', temperature: 36.30, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-06-12', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-13', temperature: 36.3, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-14', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-15', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-16', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-17', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-18', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-19', temperature: 36.95, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-20', temperature: 37.0, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-21', temperature: 37.0, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-22', temperature: 37.0, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-23', cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-24', cervix: { opening: 0, firmness: 0 }}, + { date: '2018-06-25', cervix: { opening: 1, firmness: 1 } } ].map(convertToSymptoFormat) export const cervixShiftWaitsForTempShift = [ @@ -141,23 +148,23 @@ export const cervixShiftWaitsForTempShift = [ { date: '2018-05-09', bleeding: 2 }, { date: '2018-05-10', bleeding: 2 }, { date: '2018-05-11', bleeding: 1 }, - { date: '2018-05-12', temperature: 36.3, cervix: { isClosed: false, isHard: false } }, - { date: '2018-05-13', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, - { date: '2018-05-14', temperature: 36.3, cervix: { isClosed: false, isHard: false } }, - { date: '2018-05-15', temperature: 36.2, cervix: { isClosed: false, isHard: false } }, - { date: '2018-05-16', temperature: 36.3, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-17', temperature: 36.3, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-18', temperature: 36.55, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-19', temperature: 36.65, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-20', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-21', temperature: 36.6, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-22', temperature: 36.85, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-23', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-24', temperature: 36.85, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-25', temperature: 36.95, cervix: { isClosed: true, isHard: true } }, - { date: '2018-05-26', temperature: 36.85, cervix: { isClosed: true, isHard: false } }, - { date: '2018-05-27', temperature: 36.8, cervix: { isClosed: false, isHard: true } }, - { date: '2018-05-28', temperature: 36.6, cervix: { isClosed: false, isHard: true } }, + { date: '2018-05-12', temperature: 36.3, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-05-13', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-05-14', temperature: 36.3, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-05-15', temperature: 36.2, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-05-16', temperature: 36.3, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-17', temperature: 36.3, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-18', temperature: 36.55, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-19', temperature: 36.65, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-20', temperature: 36.7, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-21', temperature: 36.6, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-22', temperature: 36.85, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-23', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-24', temperature: 36.85, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-25', temperature: 36.95, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-26', temperature: 36.85, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-05-27', temperature: 36.8, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-05-28', temperature: 36.6, cervix: { opening: 1, firmness: 0 } }, { date: '2018-05-29', bleeding: 2 } ].map(convertToSymptoFormat) @@ -166,22 +173,22 @@ export const tempShiftWaitsForCervixShift = [ { date: '2018-04-06', bleeding: 2 }, { date: '2018-04-07', bleeding: 2 }, { date: '2018-04-08', bleeding: 1 }, - { date: '2018-04-09', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, - { date: '2018-04-10', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, - { date: '2018-04-11', temperature: 36.55, cervix: { isClosed: false, isHard: false } }, - { date: '2018-04-12', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, - { date: '2018-04-13', temperature: 36.35, cervix: { isClosed: false, isHard: false } }, - { date: '2018-04-14', temperature: 36.35, cervix: { isClosed: false, isHard: false } }, - { date: '2018-04-15', temperature: 36.6, cervix: { isClosed: false, isHard: false } }, - { date: '2018-04-16', temperature: 36.8, cervix: { isClosed: false, isHard: false } }, - { date: '2018-04-17', cervix: { isClosed: false, isHard: false } }, - { date: '2018-04-18', temperature: 36.8, cervix: { isClosed: false, isHard: true } }, - { date: '2018-04-19', temperature: 36.85, cervix: { isClosed: true, isHard: true } }, - { date: '2018-04-20', temperature: 37.0, cervix: { isClosed: true, isHard: true } }, - { date: '2018-04-21', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, - { date: '2018-04-22', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, - { date: '2018-04-23', temperature: 37.1, cervix: { isClosed: true, isHard: true } }, - { date: '2018-04-24', temperature: 36.75, cervix: { isClosed: false, isHard: false } } + { date: '2018-04-09', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-10', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-11', temperature: 36.55, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-12', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-13', temperature: 36.35, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-14', temperature: 36.35, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-15', temperature: 36.6, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-16', temperature: 36.8, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-17', cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-18', temperature: 36.8, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-04-19', temperature: 36.85, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-04-20', temperature: 37.0, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-04-21', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-04-22', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-04-23', temperature: 37.1, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-04-24', temperature: 36.75, cervix: { opening: 1, firmness: 1 } } ].map(convertToSymptoFormat) export const noInfertilePhaseDetected = [ @@ -189,18 +196,18 @@ export const noInfertilePhaseDetected = [ { date: '2018-03-09', bleeding: 3 }, { date: '2018-03-10', bleeding: 3 }, { date: '2018-03-11', bleeding: 3 }, - { date: '2018-03-12', temperature: 36.3, cervix: { isClosed: true, isHard: false } }, - { date: '2018-03-13', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, - { date: '2018-03-14', temperature: 36.45, cervix: { isClosed: false, isHard: false } }, - { date: '2018-03-15', temperature: 36.4, cervix: { isClosed: false, isHard: false } }, - { date: '2018-03-16', temperature: 36.2, cervix: { isClosed: false, isHard: false } }, - { date: '2018-03-17', temperature: 36.5, cervix: { isClosed: false, isHard: false } }, - { date: '2018-03-18', temperature: 36.6, cervix: { isClosed: false, isHard: false } }, - { date: '2018-03-19', temperature: 36.35, cervix: { isClosed: false, isHard: true } }, - { date: '2018-03-20', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, - { date: '2018-03-21', temperature: 36.7, cervix: { isClosed: true, isHard: true } }, - { date: '2018-03-22', temperature: 36.7, cervix: { isClosed: true, isHard: false } }, - { date: '2018-03-23', temperature: 36.7, cervix: { isClosed: true, isHard: true } } + { date: '2018-03-12', temperature: 36.3, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-03-13', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-03-14', temperature: 36.45, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-03-15', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-03-16', temperature: 36.2, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-03-17', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-03-18', temperature: 36.6, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-03-19', temperature: 36.35, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-03-20', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-03-21', temperature: 36.7, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-03-22', temperature: 36.7, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-03-23', temperature: 36.7, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) export const fiveDayCycle = [ From 20dc238ea419c2f568ebf12c9c06aee5c492fdef Mon Sep 17 00:00:00 2001 From: emelko Date: Wed, 5 Sep 2018 15:29:32 +0200 Subject: [PATCH 42/60] Replacing mucus default with secondarySymptom --- lib/sympto/index.js | 5 ++++- lib/sympto/pre-ovulatory.js | 16 ++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/sympto/index.js b/lib/sympto/index.js index c50fcbb..f93ecac 100644 --- a/lib/sympto/index.js +++ b/lib/sympto/index.js @@ -16,7 +16,10 @@ export default function getSymptoThermalStatus(cycleInfo) { // if there was no first higher measurement in the previous cycle, // no infertile pre-ovulatory phase may be assumed if (previousCycle) { - const statusForLast = getSymptoThermalStatus({ cycle: previousCycle }) + const statusForLast = getSymptoThermalStatus({ + cycle: previousCycle, + secondarySymptom: secondarySymptom + }) if (statusForLast.temperatureShift) { const preOvuPhase = getPreOvulatoryPhase( cycle, diff --git a/lib/sympto/pre-ovulatory.js b/lib/sympto/pre-ovulatory.js index b1e7698..c250142 100644 --- a/lib/sympto/pre-ovulatory.js +++ b/lib/sympto/pre-ovulatory.js @@ -12,7 +12,7 @@ export default function(cycle, previousCycles) { const maybePreOvuDays = cycle.slice(0, preOvuPhaseLength).filter(d => { return d.date <= preOvuEndDate }) - const preOvulatoryDays = getDaysUntilFertileMucus(maybePreOvuDays) + const preOvulatoryDays = getDaysUntilFertileSecondarySymptom(maybePreOvuDays) // if mucus occurs on the 1st cycle day, there is no pre-ovu phase if (!preOvulatoryDays.length) return null @@ -34,13 +34,17 @@ export default function(cycle, previousCycles) { } } -function getDaysUntilFertileMucus(days) { - const firstFertileMucusDayIndex = days.findIndex(day => { - return day.mucus && day.mucus.value > 1 +function getDaysUntilFertileSecondarySymptom(days, secondarySymptom) { + const firstFertileSecondarySymptomDayIndex = days.findIndex(day => { + if (secondarySymptom === 'mucus') { + return day.mucus && day.mucus.value > 1 + } else if (secondarySymptom === 'cervix') { + return day.cervix && !day.cervix.isClosedAndHard + } }) - if (firstFertileMucusDayIndex > -1) { - return days.slice(0, firstFertileMucusDayIndex) + if (firstFertileSecondarySymptomDayIndex > -1) { + return days.slice(0, firstFertileSecondarySymptomDayIndex) } return days } \ No newline at end of file From abee426337294d046d23a949899cc5cf6d39162b Mon Sep 17 00:00:00 2001 From: emelko Date: Wed, 5 Sep 2018 15:30:38 +0200 Subject: [PATCH 43/60] Renaming nextDays in nextDaysAfterFhm when calculating temperatureShift --- lib/sympto/temperature.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/sympto/temperature.js b/lib/sympto/temperature.js index 387cd63..418757b 100644 --- a/lib/sympto/temperature.js +++ b/lib/sympto/temperature.js @@ -39,18 +39,18 @@ function checkIfFirstHighMeasurement(temp, i, temperatureDays, ltl) { if (i > temperatureDays.length - 3) { return { detected: false } } - const nextDays = temperatureDays.slice(i + 1, i + 4) + const nextDaysAfterFhm = temperatureDays.slice(i + 1, i + 4) return ( - getResultForRegularRule(nextDays, ltl)) || - getResultForFirstExceptionRule(nextDays, ltl) || - getResultForSecondExceptionRule(nextDays, ltl) || + getResultForRegularRule(nextDaysAfterFhm, ltl)) || + getResultForFirstExceptionRule(nextDaysAfterFhm, ltl) || + getResultForSecondExceptionRule(nextDaysAfterFhm, ltl) || { detected: false } } -function getResultForRegularRule(nextDays, ltl) { - if (!nextDays.every(day => day.temp > ltl)) return false - const thirdDay = nextDays[1] +function getResultForRegularRule(nextDaysAfterFhm, ltl) { + if (!nextDaysAfterFhm.every(day => day.temp > ltl)) return false + const thirdDay = nextDaysAfterFhm[1] if (rounded(thirdDay.temp - ltl, 0.1) < 0.2) return false return { detected: true, @@ -60,10 +60,10 @@ function getResultForRegularRule(nextDays, ltl) { } } -function getResultForFirstExceptionRule(nextDays, ltl) { - if (nextDays.length < 3) return false - if (!nextDays.every(day => day.temp > ltl)) return false - const fourthDay = nextDays[2] +function getResultForFirstExceptionRule(nextDaysAfterFhm, ltl) { + if (nextDaysAfterFhm.length < 3) return false + if (!nextDaysAfterFhm.every(day => day.temp > ltl)) return false + const fourthDay = nextDaysAfterFhm[2] if (fourthDay.temp <= ltl) return false return { detected: true, @@ -73,10 +73,10 @@ function getResultForFirstExceptionRule(nextDays, ltl) { } } -function getResultForSecondExceptionRule(nextDays, ltl) { - if (nextDays.length < 3) return false - if (secondOrThirdTempIsAtOrBelowLtl(nextDays, ltl)) { - const fourthDay = nextDays[2] +function getResultForSecondExceptionRule(nextDaysAfterFhm, ltl) { + if (nextDaysAfterFhm.length < 3) return false + if (secondOrThirdTempIsAtOrBelowLtl(nextDaysAfterFhm, ltl)) { + const fourthDay = nextDaysAfterFhm[2] if (rounded(fourthDay.temp - ltl, 0.1) >= 0.2) { return { detected: true, @@ -89,9 +89,9 @@ function getResultForSecondExceptionRule(nextDays, ltl) { return false } -function secondOrThirdTempIsAtOrBelowLtl(nextDays, ltl) { - const secondIsLow = nextDays[0].temp <= ltl - const thirdIsLow = nextDays[1].temp <= ltl +function secondOrThirdTempIsAtOrBelowLtl(nextDaysAfterFhm, ltl) { + const secondIsLow = nextDaysAfterFhm[0].temp <= ltl + const thirdIsLow = nextDaysAfterFhm[1].temp <= ltl if ((secondIsLow || thirdIsLow) && !(secondIsLow && thirdIsLow)) { return true } else { From 809b0f438f740e991dbaef0663e55ecb7a93af5b Mon Sep 17 00:00:00 2001 From: emelko Date: Wed, 5 Sep 2018 15:31:03 +0200 Subject: [PATCH 44/60] Adding more error messages for better understanding of failing tests when arguments are wrong <3 --- lib/sympto/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/sympto/index.js b/lib/sympto/index.js index f93ecac..48e1980 100644 --- a/lib/sympto/index.js +++ b/lib/sympto/index.js @@ -107,14 +107,14 @@ function throwIfArgsAreNotInRequiredFormat(cycles) { assert.ok(cycle.length > 0) //what about 2 cycles of 1 day each?! assert.ok(cycle[0].bleeding !== null) assert.equal(typeof cycle[0].bleeding, 'object', "First cycle day must contain bleeding value") - assert.equal(typeof cycle[0].bleeding.value, 'number') + assert.equal(typeof cycle[0].bleeding.value, 'number', "Bleeding value must be a number") cycle.forEach(day => { assert.equal(typeof day.date, 'string') assert.doesNotThrow(() => LocalDate.parse(day.date)) - if (day.temperature) assert.equal(typeof day.temperature.value, 'number') - if (day.mucus) assert.equal(typeof day.mucus.value, 'number') - if (day.mucus) assert.ok(day.mucus.value >= 0) - if (day.mucus) assert.ok(day.mucus.value < 5) + if (day.temperature) assert.equal(typeof day.temperature.value, 'number', "temperature value must be number") + if (day.mucus) assert.equal(typeof day.mucus.value, 'number', "mucus value must be number") + if (day.mucus) assert.ok(day.mucus.value >= 0, "mucus value must be 0 or bigger") + if (day.mucus) assert.ok(day.mucus.value <= 4, "mucus value must be 4 or smaller") if (day.cervix) assert.equal(typeof day.cervix.value, 'object') if (day.cervix) assert.ok(day.cervix.value.opening >= 0, "cervix opening value must be 0 or bigger") if (day.cervix) assert.ok(day.cervix.value.opening <= 2, "cervix opening value must be 2 or smaller") From d16feb6d58fbe4fdc6b93411026ae76b2a6b7149 Mon Sep 17 00:00:00 2001 From: emelko Date: Wed, 5 Sep 2018 16:03:27 +0200 Subject: [PATCH 45/60] Renaming cervixPeak in cervixPeakBeforeShift bc it mustn't be the highest cervix value --- lib/sympto/cervix.js | 2 +- test/sympto/cervix-temp.spec.js | 2 +- test/sympto/cervix.spec.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/sympto/cervix.js b/lib/sympto/cervix.js index 2e0dff4..9a59645 100644 --- a/lib/sympto/cervix.js +++ b/lib/sympto/cervix.js @@ -27,7 +27,7 @@ export default function (cycleDays, tempEvalEndIndex) { if (onlyClosedAndHardUntilEndOfTempEval) { return { detected: true, - cervixPeak: day, + cervixPeakBeforeShift: day, evaluationCompleteDay: threeFollowingDays[threeFollowingDays.length - 1] } } diff --git a/test/sympto/cervix-temp.spec.js b/test/sympto/cervix-temp.spec.js index a610d65..17e2089 100644 --- a/test/sympto/cervix-temp.spec.js +++ b/test/sympto/cervix-temp.spec.js @@ -142,9 +142,9 @@ describe('sympto', () => { start: { date: '2018-06-17', time: '18:00' }, cycleDays: tempAndCervixEvalEndOnSameDay .filter(({date}) => date >= '2018-06-17') + expect(status.cervixShift.cervixPeakBeforeShift.date).to.eql('2018-06-14') }) expect(status.cervixShift.detected).to.be.true() - expect(status.cervixShift.cervixPeak.date).to.eql('2018-06-14') expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-06-17') }) diff --git a/test/sympto/cervix.spec.js b/test/sympto/cervix.spec.js index 9bcc2a2..6c43cb9 100644 --- a/test/sympto/cervix.spec.js +++ b/test/sympto/cervix.spec.js @@ -35,7 +35,7 @@ describe('sympto', () => { const status = getCervixStatus(values) expect(status).to.eql({ detected: true, - cervixPeak: { + cervixPeakBeforeShift: { date: 13, cervix: { isHard: true, @@ -58,7 +58,7 @@ describe('sympto', () => { const status = getCervixStatus(values) expect(status).to.eql({ detected: true, - cervixPeak: { + cervixPeakBeforeShift: { date: 0, cervix: { isHard: false, From e2c8292d7f8badf281d6b13d85fa7fb7229b9d4a Mon Sep 17 00:00:00 2001 From: emelko Date: Fri, 7 Sep 2018 19:45:55 +0200 Subject: [PATCH 46/60] secondarySymptom as default; be more explicit for periOvuEnd calculation --- lib/sympto/index.js | 2 +- lib/sympto/pre-ovulatory.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/sympto/index.js b/lib/sympto/index.js index 48e1980..979efc6 100644 --- a/lib/sympto/index.js +++ b/lib/sympto/index.js @@ -72,7 +72,7 @@ export default function getSymptoThermalStatus(cycleInfo) { if (tempOver > secondarySymptomOver) { periOvulatoryEnd = temperatureShift.evaluationCompleteDay - } else { + } else if (secondarySymptom > tempOver) { periOvulatoryEnd = secondaryShift.evaluationCompleteDay } diff --git a/lib/sympto/pre-ovulatory.js b/lib/sympto/pre-ovulatory.js index c250142..874e2bc 100644 --- a/lib/sympto/pre-ovulatory.js +++ b/lib/sympto/pre-ovulatory.js @@ -13,7 +13,7 @@ export default function(cycle, previousCycles) { return d.date <= preOvuEndDate }) const preOvulatoryDays = getDaysUntilFertileSecondarySymptom(maybePreOvuDays) - // if mucus occurs on the 1st cycle day, there is no pre-ovu phase + // if fertile mucus or cervix occurs on the 1st cycle day, there is no pre-ovu phase if (!preOvulatoryDays.length) return null let endDate @@ -34,7 +34,7 @@ export default function(cycle, previousCycles) { } } -function getDaysUntilFertileSecondarySymptom(days, secondarySymptom) { +function getDaysUntilFertileSecondarySymptom(days, secondarySymptom = 'mucus') { const firstFertileSecondarySymptomDayIndex = days.findIndex(day => { if (secondarySymptom === 'mucus') { return day.mucus && day.mucus.value > 1 @@ -47,4 +47,4 @@ function getDaysUntilFertileSecondarySymptom(days, secondarySymptom) { return days.slice(0, firstFertileSecondarySymptomDayIndex) } return days -} \ No newline at end of file +} From 0b856e298ad756a19912ed4acb20d58e188966ab Mon Sep 17 00:00:00 2001 From: emelko Date: Fri, 7 Sep 2018 19:49:03 +0200 Subject: [PATCH 47/60] Symptom values must have exclude: false for tests; consistency for defining functions --- test/sympto/mucus-temp-fixtures.js | 16 +- test/sympto/mucus-temp.spec.js | 42 +- test/sympto/mucus-temp.spec.js~HEAD | 661 ---------------------------- 3 files changed, 20 insertions(+), 699 deletions(-) delete mode 100644 test/sympto/mucus-temp.spec.js~HEAD diff --git a/test/sympto/mucus-temp-fixtures.js b/test/sympto/mucus-temp-fixtures.js index c313629..d6463c0 100644 --- a/test/sympto/mucus-temp-fixtures.js +++ b/test/sympto/mucus-temp-fixtures.js @@ -1,9 +1,17 @@ - function convertToSymptoFormat(val) { const sympto = { date: val.date } - if (val.temperature) sympto.temperature = { value: val.temperature } - if (val.mucus) sympto.mucus = { value: val.mucus } - if (val.bleeding) sympto.bleeding = { value: val.bleeding } + if (val.temperature) sympto.temperature = { + value: val.temperature, + exclude: false + } + if (val.mucus) sympto.mucus = { + value: val.mucus, + exclude: false + } + if (val.bleeding) sympto.bleeding = { + value: val.bleeding, + exclude: false + } return sympto } diff --git a/test/sympto/mucus-temp.spec.js b/test/sympto/mucus-temp.spec.js index e81ba31..dbb925b 100644 --- a/test/sympto/mucus-temp.spec.js +++ b/test/sympto/mucus-temp.spec.js @@ -22,11 +22,10 @@ import { const expect = chai.expect -describe('sympto', () => { +describe.only('sympto', () => { describe('combining temperature and mucus tracking', () => { describe('with no previous higher temp measurement', () => { - - it('with no shifts detects only peri-ovulatory', function () { + it('with no shifts detects only peri-ovulatory', () => { const status = getSensiplanStatus({ cycle: cycleWithoutAnyShifts, previousCycle: cycleWithoutFhm @@ -36,7 +35,6 @@ describe('sympto', () => { cycleDays: cycleWithoutAnyShifts }) }) - it('with temp and mucus shifts detects only peri-ovulatory and post-ovulatory', () => { const status = getSensiplanStatus({ cycle: longAndComplicatedCycle, @@ -62,15 +60,13 @@ describe('sympto', () => { }) }) - describe('with previous higher measurement', () => { - describe('with no shifts detects pre-ovulatory phase', function () { - it('according to 5-day-rule', function () { + describe('with no shifts detects pre-ovulatory phase', () => { + it('according to 5-day-rule', () => { const status = getSensiplanStatus({ cycle: fiveDayCycle, previousCycle: cycleWithFhm }) - expect(Object.keys(status.phases).length).to.eql(1) expect(status.phases.preOvulatory).to.eql({ cycleDays: fiveDayCycle, @@ -80,14 +76,12 @@ describe('sympto', () => { }) }) describe('with no shifts detects pre- and peri-ovulatory phase', () => { - it('according to 5-day-rule', function () { + it('according to 5-day-rule', () => { const status = getSensiplanStatus({ cycle: cycleWithTempAndNoMucusShift, previousCycle: cycleWithFhm }) - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.preOvulatory).to.eql({ cycleDays: cycleWithTempAndNoMucusShift .filter(({date}) => date <= '2018-06-05'), @@ -100,14 +94,12 @@ describe('sympto', () => { start: { date: '2018-06-06' } }) }) - it('according to 5-day-rule with shortened pre-phase', function () { + it('according to 5-day-rule with shortened pre-phase', () => { const status = getSensiplanStatus({ cycle: cycleWithEarlyMucus, previousCycle: cycleWithFhm }) - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.preOvulatory).to.eql({ cycleDays: [cycleWithEarlyMucus[0]], start: { date: '2018-06-01' }, @@ -119,15 +111,13 @@ describe('sympto', () => { }) }) }) - describe('with shifts detects pre- and peri-ovulatory phase', function () { - it('according to 5-day-rule', function () { + describe('with shifts detects pre- and peri-ovulatory phase', () => { + it('according to 5-day-rule', () => { const status = getSensiplanStatus({ cycle: longAndComplicatedCycle, previousCycle: cycleWithFhm }) - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ cycleDays: longAndComplicatedCycle .filter(({date}) => date <= '2018-06-05'), @@ -146,10 +136,8 @@ describe('sympto', () => { start: { date: '2018-06-21', time: '18:00'} }) }) - }) }) - describe('combining first higher measurment and mucus peak', () => { it('with fhM + mucus peak on same day finds start of postovu phase', () => { const status = getSensiplanStatus({ @@ -184,7 +172,6 @@ describe('sympto', () => { .filter(({date}) => date >= '2018-06-21') }) }) - it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { const status = getSensiplanStatus({ cycle: fhmTwoDaysBeforeMucusPeak, @@ -218,7 +205,6 @@ describe('sympto', () => { .filter(({date}) => date >= '2018-06-26') }) }) - it('another example for mucus peak before temp shift', () => { const status = getSensiplanStatus({ cycle: mucusPeakSlightlyBeforeTempShift, @@ -252,16 +238,13 @@ describe('sympto', () => { .filter(({date}) => date >= '2018-06-17') }) }) - it('with another mucus peak 5 days after fHM ignores it', () => { const status = getSensiplanStatus({ cycle: mucusPeak5DaysAfterFhm, previousCycle: cycleWithFhm }) - expect(status.temperatureShift).to.be.an('object') expect(status.mucusShift).to.be.an('object') - expect(Object.keys(status.phases).length).to.eql(3) expect(status.phases.preOvulatory).to.eql({ start: { date: '2018-06-01' }, @@ -286,13 +269,11 @@ describe('sympto', () => { .filter(({date}) => date >= '2018-06-22') }) }) - it('with mucus peak 2 days before fhM waits for end of temp eval', () => { const status = getSensiplanStatus({ cycle: mucusPeakTwoDaysBeforeFhm, previousCycle: cycleWithFhm }) - expect(status.temperatureShift).to.be.an('object') expect(status.mucusShift).to.be.an('object') @@ -320,7 +301,6 @@ describe('sympto', () => { .filter(({date}) => date >= '2018-07-03') }) }) - it('with mucus peak 5 days before fhM waits for end of temp eval', () => { const status = getSensiplanStatus({ cycle: fhm5DaysAfterMucusPeak, @@ -355,7 +335,6 @@ describe('sympto', () => { }) }) }) - describe('applying the minus-8 rule', () => { it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { const status = getSensiplanStatus({ @@ -448,7 +427,6 @@ describe('sympto', () => { }) }) }) - it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { const status = getSensiplanStatus({ cycle: cycleWithMucusOnFirstDay, @@ -464,7 +442,6 @@ describe('sympto', () => { cycleDays: cycleWithMucusOnFirstDay }) }) - it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { const status = getSensiplanStatus({ cycle: longAndComplicatedCycle, @@ -497,7 +474,6 @@ describe('sympto', () => { .filter(({date}) => date >= '2018-06-21') }) }) - it('does not lengthen the pre-ovu phase if < 12 cycles', () => { const status = getSensiplanStatus({ cycle: longAndComplicatedCycle, @@ -530,7 +506,6 @@ describe('sympto', () => { .filter(({date}) => date >= '2018-06-21') }) }) - it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { const status = getSensiplanStatus({ cycle: longAndComplicatedCycle, @@ -558,7 +533,6 @@ describe('sympto', () => { }) }) }) - describe('when args are wrong', () => { it('throws when arg object is not in right format', () => { const wrongObject = { hello: 'world' } diff --git a/test/sympto/mucus-temp.spec.js~HEAD b/test/sympto/mucus-temp.spec.js~HEAD deleted file mode 100644 index 92f346d..0000000 --- a/test/sympto/mucus-temp.spec.js~HEAD +++ /dev/null @@ -1,661 +0,0 @@ -import chai from 'chai' -import getSensiplanStatus from '../../lib/sympto' -import { AssertionError } from 'assert' -import { - cycleWithoutFhm, - longAndComplicatedCycle, - cycleWithTempAndNoMucusShift, - cycleWithFhm, - cycleWithoutAnyShifts, - fiveDayCycle, - cycleWithEarlyMucus, - cycleWithMucusOnFirstDay, - mucusPeakAndFhmOnSameDay, - fhmTwoDaysBeforeMucusPeak, - fhm5DaysAfterMucusPeak, - mucusPeak5DaysAfterFhm, - mucusPeakTwoDaysBeforeFhm, - fhmOnDay12, - fhmOnDay15, - mucusPeakSlightlyBeforeTempShift, - highestMucusQualityAfterEndOfEval -} from './mucus-temp-fixtures' - -const expect = chai.expect - -describe('sympto', () => { - describe('combining temperature and mucus tracking', () => { - describe('with no previous higher temp measurement', () => { - - it('with no shifts detects only peri-ovulatory', function () { - const status = getSensiplanStatus({ - cycle: cycleWithoutAnyShifts, - previousCycle: cycleWithoutFhm - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - cycleDays: cycleWithoutAnyShifts - }) - }) - - it('with temp and mucus shifts detects only peri-ovulatory and post-ovulatory', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm - }) - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-21') - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - - }) - }) - - describe('with previous higher measurement', () => { - describe('with no shifts detects pre-ovulatory phase', function () { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: fiveDayCycle, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(1) - expect(status.phases.preOvulatory).to.eql({ - cycleDays: fiveDayCycle, - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - }) - }) - describe('with no shifts detects pre- and peri-ovulatory phase', () => { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: cycleWithTempAndNoMucusShift, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date <= '2018-06-05'), - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithTempAndNoMucusShift - .filter(({date}) => date > '2018-06-05'), - start: { date: '2018-06-06' } - }) - }) - it('according to 5-day-rule with shortened pre-phase', function () { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(2) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: [cycleWithEarlyMucus[0]], - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithEarlyMucus.slice(1), - start: { date: '2018-06-02' } - }) - }) - }) - describe('with shifts detects pre- and peri-ovulatory phase', function () { - it('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithFhm - }) - - expect(Object.keys(status.phases).length).to.eql(3) - - expect(status.phases.preOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05'), - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date > '2018-06-05' && date <= '2018-06-21'), - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00'} - }) - expect(status.phases.postOvulatory).to.eql({ - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21'), - start: { date: '2018-06-21', time: '18:00'} - }) - }) - - }) - }) - - describe('combining first higher measurment and mucus peak', () => { - it('with fhM + mucus peak on same day finds start of postovu phase', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakAndFhmOnSameDay, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: mucusPeakAndFhmOnSameDay - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('with fhM 2 days before mucus peak waits for end of mucus eval', () => { - const status = getSensiplanStatus({ - cycle: fhmTwoDaysBeforeMucusPeak, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-26', time: '18:00' }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-26' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-26', - time: '18:00' - }, - cycleDays: fhmTwoDaysBeforeMucusPeak - .filter(({date}) => date >= '2018-06-26') - }) - }) - - it('another example for mucus peak before temp shift', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakSlightlyBeforeTempShift, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-17', time: '18:00' }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-17' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-17', - time: '18:00' - }, - cycleDays: mucusPeakSlightlyBeforeTempShift - .filter(({date}) => date >= '2018-06-17') - }) - }) - - it('with another mucus peak 5 days after fHM ignores it', () => { - const status = getSensiplanStatus({ - cycle: mucusPeak5DaysAfterFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - end: { date: '2018-06-22', time: '18:00' }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => { - return date > '2018-06-01' && date <= '2018-06-22' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-22', - time: '18:00' - }, - cycleDays: mucusPeak5DaysAfterFhm - .filter(({date}) => date >= '2018-06-22') - }) - }) - - it('with mucus peak 2 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: mucusPeakTwoDaysBeforeFhm, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-07-03', time: '18:00' }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-07-03' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-07-03', - time: '18:00' - }, - cycleDays: mucusPeakTwoDaysBeforeFhm - .filter(({date}) => date >= '2018-07-03') - }) - }) - - it('with mucus peak 5 days before fhM waits for end of temp eval', () => { - const status = getSensiplanStatus({ - cycle: fhm5DaysAfterMucusPeak, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - - describe('applying the minus-8 rule', () => { - it('shortens the pre-ovu phase if there is a previous <13 fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: [fhmOnDay12, ...Array(10).fill(fhmOnDay15)] - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-04' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-04') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-05' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-04' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - // #TODO - it.only('shortens pre-ovu phase with prev <13 fhm even with <12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: fhm5DaysAfterMucusPeak - .filter(({date}) => date >= '2018-06-21') - }) - }) - - // #TODO - it('with highest quality after end of eval', () => { - const status = getSensiplanStatus({ - cycle: highestMucusQualityAfterEndOfEval, - previousCycle: cycleWithFhm - }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.mucusShift).to.be.an('object') - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: highestMucusQualityAfterEndOfEval - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-26', time: '18:00' }, - cycleDays: highestMucusQualityAfterEndOfEval - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-26' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-26', - time: '18:00' - }, - cycleDays: highestMucusQualityAfterEndOfEval - .filter(({date}) => date >= '2018-06-26') - }) - }) - }) - - describe('something', () => { - - it('shortens the pre-ovu phase if mucus occurs', () => { - const status = getSensiplanStatus({ - cycle: cycleWithEarlyMucus, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-01' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => date <= '2018-06-01') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-02' }, - cycleDays: cycleWithEarlyMucus - .filter(({date}) => { - return date > '2018-06-01' - }) - }) - }) - - it('shortens the pre-ovu phase if mucus occurs even on the first day', () => { - const status = getSensiplanStatus({ - cycle: cycleWithMucusOnFirstDay, - previousCycle: fhmOnDay12, - earlierCycles: Array(10).fill(fhmOnDay12) - }) - - - expect(Object.keys(status.phases).length).to.eql(1) - - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - cycleDays: cycleWithMucusOnFirstDay - }) - }) - - it('lengthens the pre-ovu phase if >= 12 cycles with fhm > 13', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(11).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-07' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-07') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-08' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-07' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not lengthen the pre-ovu phase if < 12 cycles', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: fhmOnDay15, - earlierCycles: Array(10).fill(fhmOnDay15) - }) - - - expect(Object.keys(status.phases).length).to.eql(3) - expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date <= '2018-06-05') - }) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - - it('does not detect any pre-ovu phase if prev cycle had no fhm', () => { - const status = getSensiplanStatus({ - cycle: longAndComplicatedCycle, - previousCycle: cycleWithoutFhm, - earlierCycles: [...Array(12).fill(fhmOnDay15)] - }) - - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-21', time: '18:00' }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => { - return date >= '2018-06-01' && date <= '2018-06-21' - }) - }) - expect(status.phases.postOvulatory).to.eql({ - start: { - date: '2018-06-21', - time: '18:00' - }, - cycleDays: longAndComplicatedCycle - .filter(({date}) => date >= '2018-06-21') - }) - }) - }) - - describe('when args are wrong', () => { - it('throws when arg object is not in right format', () => { - const wrongObject = { hello: 'world' } - expect(() => getSensiplanStatus(wrongObject)).to.throw(AssertionError) - }) - it('throws if cycle array is empty', () => { - expect(() => getSensiplanStatus({cycle: []})).to.throw(AssertionError) - }) - it('throws if cycle days are not in right format', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - hello: 'world', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2018-04-13', - temperature: {value: '35'}, - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - expect(() => getSensiplanStatus({ - cycle: [{ - date: '09-14-2017', - bleeding: { value: 0 } - }], - earlierCycles: [[{ - date: '1992-09-09', - bleeding: { value: 0 } - }]] - })).to.throw(AssertionError) - }) - it('throws if first cycle day does not have bleeding value', () => { - expect(() => getSensiplanStatus({ - cycle: [{ - date: '2017-01-01', - bleeding: { - value: 'medium' - } - }], - earlierCycles: [[ - { - date: '2017-09-23', - } - ]] - })).to.throw(AssertionError) - }) - }) - }) -}) From 5cb4c01cecb1d5a3dde61c5533b16d0eecacb4a5 Mon Sep 17 00:00:00 2001 From: emelko Date: Fri, 7 Sep 2018 19:49:52 +0200 Subject: [PATCH 48/60] First 9 tests for cervix temp combination --- test/sympto/cervix-temp-fixtures.js | 47 ++++--- test/sympto/cervix-temp.spec.js | 196 ++++++++++++++++------------ 2 files changed, 132 insertions(+), 111 deletions(-) diff --git a/test/sympto/cervix-temp-fixtures.js b/test/sympto/cervix-temp-fixtures.js index d5b85a5..0c8ae85 100644 --- a/test/sympto/cervix-temp-fixtures.js +++ b/test/sympto/cervix-temp-fixtures.js @@ -1,4 +1,3 @@ - function convertToSymptoFormat(val) { const sympto = { date: val.date } if (val.temperature) sympto.temperature = { @@ -37,11 +36,11 @@ export const idealCycle = [ ].map(convertToSymptoFormat) export const cycleWithFhmNoCervixShift = [ - { date: '2018-08-01', bleeding: 1, cervix: { opening: 1, firmness: 1 } }, - { date: '2018-08-02', bleeding: 2, cervix: { opening: 1, firmness: 1 } }, - { date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { opening: 2, firmness: 1 } }, - { date: '2018-08-04', temperature: 36.55, bleeding: 1, cervix: { opening: 2, firmness: 0 } }, - { date: '2018-08-05', temperature: 36.6, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-08-01', bleeding: 1 }, + { date: '2018-08-02', bleeding: 2 }, + { date: '2018-08-03', temperature: 36.6, bleeding: 2 }, + { date: '2018-08-04', temperature: 36.55, bleeding: 1 }, + { date: '2018-08-05', temperature: 36.6 }, { date: '2018-08-06', temperature: 36.65, cervix: { opening: 0, firmness: 1 } }, { date: '2018-08-07', temperature: 36.7, cervix: { opening: 1, firmness: 0 } }, { date: '2018-08-08', temperature: 36.6, cervix: { opening: 0, firmness: 1 } }, @@ -64,11 +63,11 @@ export const cycleWithoutFhmNoCervixShift = [ ].map(convertToSymptoFormat) export const cycleWithoutAnyShifts = [ - { date: '2018-07-01', temperature: 36.65, bleeding: -1, cervix: { opening: 1, firmness: 1 } }, - { date: '2018-07-02', temperature: 36.45, cervix: { opening: 1, firmness: 1 } }, - { date: '2018-07-03', temperature: 36.65, cervix: { opening: 2, firmness: 1 } }, - { date: '2018-07-04', temperature: 36.65, cervix: { opening: 2, firmness: 1 } }, - { date: '2018-07-05', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-01', temperature: 36.65, bleeding: 1 }, + { date: '2018-07-02', temperature: 36.45 }, + { date: '2018-07-03', temperature: 36.65 }, + { date: '2018-07-04', temperature: 36.65 }, + { date: '2018-07-05', temperature: 36.65, cervix: { opening: 0, firmness: 0 } }, { date: '2018-07-06', temperature: 36.85, cervix: { opening: 0, firmness: 1 } }, { date: '2018-07-07', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, { date: '2018-07-08', temperature: 36.65, cervix: { opening: 2, firmness: 1 } }, @@ -84,7 +83,7 @@ export const cycleWithoutAnyShifts = [ { date: '2018-07-18', temperature: 36.25, cervix: { opening: 2, firmness: 1 } }, { date: '2018-07-19', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, { date: '2018-07-20', temperature: 36.45, cervix: { opening: 1, firmness: 1 } }, - { date: '2018-07-21', temperature: 36.5, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-07-21', temperature: 36.52, cervix: { opening: 0, firmness: 0 } }, { date: '2018-07-22', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, { date: '2018-07-23', temperature: 36.75, cervix: { opening: 1, firmness: 1 } }, { date: '2018-07-24', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, @@ -127,7 +126,7 @@ export const tempAndCervixEvalEndOnSameDay = [ { date: '2018-06-09', temperature: 36.5, cervix: { opening: 0, firmness: 0 } }, { date: '2018-06-10', temperature: 36.30, cervix: { opening: 0, firmness: 1 } }, { date: '2018-06-11', temperature: 36.30, cervix: { opening: 1, firmness: 0 } }, - { date: '2018-06-12', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-12', temperature: 36.4, cervix: { opening: 2, firmness: 1 } }, { date: '2018-06-13', temperature: 36.3, cervix: { opening: 1, firmness: 1 } }, { date: '2018-06-14', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, { date: '2018-06-15', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, @@ -143,18 +142,18 @@ export const tempAndCervixEvalEndOnSameDay = [ { date: '2018-06-25', cervix: { opening: 1, firmness: 1 } } ].map(convertToSymptoFormat) -export const cervixShiftWaitsForTempShift = [ +export const tempShift3DaysAfterCervixShift = [ { date: '2018-05-08', bleeding: 3 }, { date: '2018-05-09', bleeding: 2 }, { date: '2018-05-10', bleeding: 2 }, { date: '2018-05-11', bleeding: 1 }, - { date: '2018-05-12', temperature: 36.3, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-05-12', temperature: 36.3 }, { date: '2018-05-13', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, { date: '2018-05-14', temperature: 36.3, cervix: { opening: 1, firmness: 1 } }, { date: '2018-05-15', temperature: 36.2, cervix: { opening: 1, firmness: 1 } }, { date: '2018-05-16', temperature: 36.3, cervix: { opening: 0, firmness: 0 } }, { date: '2018-05-17', temperature: 36.3, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-05-18', temperature: 36.55, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-18', temperature: 36.35, cervix: { opening: 0, firmness: 0 } }, { date: '2018-05-19', temperature: 36.65, cervix: { opening: 0, firmness: 0 } }, { date: '2018-05-20', temperature: 36.7, cervix: { opening: 0, firmness: 0 } }, { date: '2018-05-21', temperature: 36.6, cervix: { opening: 0, firmness: 0 } }, @@ -168,12 +167,12 @@ export const cervixShiftWaitsForTempShift = [ { date: '2018-05-29', bleeding: 2 } ].map(convertToSymptoFormat) -export const tempShiftWaitsForCervixShift = [ +export const cervixShift2DaysAfterTempShift = [ { date: '2018-04-05', bleeding: 3 }, { date: '2018-04-06', bleeding: 2 }, { date: '2018-04-07', bleeding: 2 }, { date: '2018-04-08', bleeding: 1 }, - { date: '2018-04-09', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-04-09', temperature: 36.5 }, { date: '2018-04-10', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, { date: '2018-04-11', temperature: 36.55, cervix: { opening: 1, firmness: 1 } }, { date: '2018-04-12', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, @@ -181,14 +180,13 @@ export const tempShiftWaitsForCervixShift = [ { date: '2018-04-14', temperature: 36.35, cervix: { opening: 1, firmness: 1 } }, { date: '2018-04-15', temperature: 36.6, cervix: { opening: 1, firmness: 1 } }, { date: '2018-04-16', temperature: 36.8, cervix: { opening: 1, firmness: 1 } }, - { date: '2018-04-17', cervix: { opening: 1, firmness: 1 } }, - { date: '2018-04-18', temperature: 36.8, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-04-17', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-04-18', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, { date: '2018-04-19', temperature: 36.85, cervix: { opening: 0, firmness: 0 } }, { date: '2018-04-20', temperature: 37.0, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-04-21', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, { date: '2018-04-22', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, { date: '2018-04-23', temperature: 37.1, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-04-24', temperature: 36.75, cervix: { opening: 1, firmness: 1 } } + { date: '2018-04-24', temperature: 36.75, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) export const noInfertilePhaseDetected = [ @@ -196,7 +194,7 @@ export const noInfertilePhaseDetected = [ { date: '2018-03-09', bleeding: 3 }, { date: '2018-03-10', bleeding: 3 }, { date: '2018-03-11', bleeding: 3 }, - { date: '2018-03-12', temperature: 36.3, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-03-12', temperature: 36.3, cervix: { opening: 0, firmness: 0 } }, { date: '2018-03-13', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, { date: '2018-03-14', temperature: 36.45, cervix: { opening: 1, firmness: 1 } }, { date: '2018-03-15', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, @@ -212,6 +210,5 @@ export const noInfertilePhaseDetected = [ export const fiveDayCycle = [ { date: '2018-08-01', bleeding: 2 }, - { date: '2018-08-03', bleeding: 3 }, - { date: '2018-08-05', bleeding: 0 } + { date: '2018-08-03', bleeding: 3 } ].map(convertToSymptoFormat) diff --git a/test/sympto/cervix-temp.spec.js b/test/sympto/cervix-temp.spec.js index 17e2089..6b06ddd 100644 --- a/test/sympto/cervix-temp.spec.js +++ b/test/sympto/cervix-temp.spec.js @@ -6,8 +6,8 @@ import { cycleWithoutFhm, cycleWithoutAnyShifts, tempAndCervixEvalEndOnSameDay, - cervixShiftWaitsForTempShift, - tempShiftWaitsForCervixShift, + tempShift3DaysAfterCervixShift, + cervixShift2DaysAfterTempShift, noInfertilePhaseDetected, fiveDayCycle } from './cervix-temp-fixtures' @@ -17,8 +17,7 @@ const expect = chai.expect describe('sympto', () => { describe('combining temperature and cervix tracking', () => { describe('with no previous higher temp measurement', () => { - - it('with no temp or cervix shifts detects only peri-ovulatory', function () { + it('with no temp or cervix shifts detects only peri-ovulatory', () => { const status = getSensiplanStatus({ cycle: cycleWithoutAnyShifts, previousCycle: cycleWithoutFhm, @@ -34,8 +33,7 @@ describe('sympto', () => { } }) }) - - it('with temp but no cervix shift detects only peri-ovulatory', function () { + it('with temp but no cervix shift detects only peri-ovulatory', () => { const status = getSensiplanStatus({ cycle: cycleWithFhmNoCervixShift, previousCycle: cycleWithoutFhm, @@ -45,85 +43,79 @@ describe('sympto', () => { expect(status).to.eql({ phases: { periOvulatory: { - start: { date: '2018-06-01' }, + start: { date: '2018-08-01' }, cycleDays: cycleWithFhmNoCervixShift } } }) }) - - it('with temp and cervix shifts detects only peri- and post-ovulatory phases', function () { + it('with temp and cervix shifts detects only peri- and post-ovulatory phases', () => { const status = getSensiplanStatus({ cycle: idealCycle, previousCycle: cycleWithoutFhm, secondarySymptom: 'cervix' }) - - expect(status.temperatureShift).to.be.an('object') - expect(status.cervixShift).to.be.an('object') - expect(Object.keys(status.phases).length).to.eql(2) + expect(status.temperatureShift.evaluationCompleteDay.date).to.eql('2018-08-15') + expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-08-15') + expect(status.temperatureShift.rule).to.eql(0) expect(status.phases.periOvulatory).to.eql({ start: { date: '2018-08-01' }, - end: { date: '2018-08-11', time: '18:00' }, + end: { date: '2018-08-15', time: '18:00' }, cycleDays: idealCycle - .filter(({date}) => date <= '2018-08-11') + .filter(({date}) => date <= '2018-08-15') }) expect(status.phases.postOvulatory).to.eql({ - start: { date: '2018-08-11', time: '18:00' }, + start: { date: '2018-08-15', time: '18:00' }, cycleDays: idealCycle - .filter(({date}) => date >= '2018-08-11') + .filter(({date}) => date >= '2018-08-15') }) }) - }) describe('with previous higher temp measurement', () => { - - describe('with no shifts detects only peri-ovulatory', function () { - it.skip('according to 5-day rule', function () { - const status = getSensiplanStatus({ - cycle: fiveDayCycle, - previousCycle: cycleWithFhmNoCervixShift - }) - - expect(Object.keys(status.phases).length).to.eql(1) - expect(status.phases.preOvulatory).to.eql({ - cycleDays: fiveDayCycle, - start: { date: '2018-08-01' }, - end: { date: '2018-08-05' } - }) + it('with no shifts detects only peri-ovulatory in 3-day long cycle according to 5-day rule', () => { + const status = getSensiplanStatus({ + cycle: fiveDayCycle, + previousCycle: idealCycle, + secondarySymptom: 'cervix' + }) + expect(Object.keys(status.phases).length).to.eql(1) + expect(status.phases.preOvulatory).to.eql({ + cycleDays: fiveDayCycle, + start: { date: '2018-08-01' }, + end: { date: '2018-08-05' } }) }) + it('with no shifts detects pre- and peri-ovulatory phase according to 5-day-rule', () => { + const status = getSensiplanStatus({ + cycle: cycleWithoutAnyShifts, + previousCycle: idealCycle, + secondarySymptom: 'cervix' + }) - describe('with no shifts detects pre- and peri-ovulatory phase', () => { - it.skip('according to 5-day-rule', function () { - const status = getSensiplanStatus({ - cycle: cycleWithoutAnyShifts, - previousCycle: cycleWithFhmNoCervixShift - }) - - expect(Object.keys(status.phases).length).to.eql(2) - expect(status.phases.preOvulatory).to.eql({ - cycleDays: cycleWithoutAnyShifts - .filter(({date}) => date <= '2018-07-05'), - start: { date: '2018-07-01' }, - end: { date: '2018-07-05' } - }) - expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithoutAnyShifts - .filter(({date}) => date > '2018-07-05'), - start: { date: '2018-07-06' } - }) + expect(Object.keys(status.phases).length).to.eql(2) + expect(status.phases.preOvulatory).to.eql({ + cycleDays: cycleWithoutAnyShifts + .filter(({date}) => date <= '2018-07-05'), + start: { date: '2018-07-01' }, + end: { date: '2018-07-05' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cycleWithoutAnyShifts + .filter(({date}) => date >= '2018-07-06'), + start: { date: '2018-07-06' } }) }) - it('with evaluation of temperature and cervix end on same day', () => { const status = getSensiplanStatus({ cycle: tempAndCervixEvalEndOnSameDay, - previousCycle: cycleWithFhmNoCervixShift, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) + expect(status.temperatureShift.evaluationCompleteDay.date).to.eql('2018-06-17') + expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-06-17') + expect(status.phases.preOvulatory).to.eql({ start: { date: '2018-06-01' }, end: { date: '2018-06-05' }, @@ -142,58 +134,90 @@ describe('sympto', () => { start: { date: '2018-06-17', time: '18:00' }, cycleDays: tempAndCervixEvalEndOnSameDay .filter(({date}) => date >= '2018-06-17') - expect(status.cervixShift.cervixPeakBeforeShift.date).to.eql('2018-06-14') }) - expect(status.cervixShift.detected).to.be.true() - expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-06-17') }) - - - it('when cervix shift waits for temperature shift', () => { + it('when temperature shift happens 3 days after cervix shift', () => { const status = getSensiplanStatus({ - cycle: cervixShiftWaitsForTempShift, - previousCycle: cycleWithFhmNoCervixShift, + cycle: tempShift3DaysAfterCervixShift, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) - expect(status.cervixShift.detected).to.be.true() - }) + expect(status.cervixShift).to.be.an('object') + expect(status.temperatureShift).to.be.an('object') + expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-05-18') + expect(status.temperatureShift.evaluationCompleteDay.date).to.eql('2018-05-21') - it('when temperature shift waits for cervix shift', () => { + expect(status.phases.preOvulatory).to.eql({ + start: { date: '2018-05-08' }, + end: { date: '2018-05-12' }, + cycleDays: tempShift3DaysAfterCervixShift + .filter(({date}) => date <= '2018-05-12') + }) + expect(status.phases.periOvulatory).to.eql({ + start: { date:'2018-05-13'}, + end: { date: '2018-05-21', time: '18:00' }, + cycleDays: tempShift3DaysAfterCervixShift + .filter(({date}) => { + return date >= '2018-05-13' && date <= '2018-05-21' + }) + }) + expect(status.phases.postOvulatory).to.eql({ + start: { date: '2018-05-21', time: '18:00' }, + cycleDays: tempShift3DaysAfterCervixShift + .filter(({date}) => date >= '2018-05-21') + }) + }) + it('when cervix shift happens 2 days after temperature shift', () => { const status = getSensiplanStatus({ - cycle: tempShiftWaitsForCervixShift, - previousCycle: cycleWithFhmNoCervixShift, + cycle: cervixShift2DaysAfterTempShift, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) - expect(status.cervixShift.detected).to.be.true() - }) + expect(status.temperatureShift.rule).to.eql(0) + expect(status.temperatureShift.evaluationCompleteDay.date).to.eql('2018-04-17') + expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-04-19') + expect(status.phases.preOvulatory).to.eql({ + cycleDays: cervixShift2DaysAfterTempShift + .filter(({date}) => date <= '2018-04-09'), + start: { date: '2018-04-05' }, + end: { date: '2018-04-09' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: cervixShift2DaysAfterTempShift + .filter(({date}) => { + return date >= '2018-04-10' && date <= '2018-04-19' + }), + start: { date: '2018-04-10' }, + end: { date: '2018-04-19', time: '18:00' } + }) + expect(status.phases.postOvulatory).to.eql({ + cycleDays: cervixShift2DaysAfterTempShift + .filter(({date}) => date >= '2018-04-19'), + start: { date: '2018-04-19', time: '18:00' } + }) + }) it('when no infertile phase can be detected', () => { const status = getSensiplanStatus({ cycle: noInfertilePhaseDetected, - previousCycle: cycleWithFhmNoCervixShift, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(2) - }) - - }) - - it('', function () { - const status = getSensiplanStatus({ - cycle: idealCycle, - previousCycle: idealCycle, - secondarySymptom: 'cervix' - }) - - expect(Object.keys(status.phases).length).to.eql() - expect(status).to.eql({ - phases: { - - } + expect(status.phases.preOvulatory).to.eql({ + cycleDays: noInfertilePhaseDetected + .filter(({date}) => date <= '2018-03-12'), + start: { date: '2018-03-08' }, + end: { date: '2018-03-12' } + }) + expect(status.phases.periOvulatory).to.eql({ + cycleDays: noInfertilePhaseDetected + .filter(({date}) => date > '2018-03-12'), + start: { date: '2018-03-13' } + }) }) }) - }) }) From d644c880d5df86f5a989ac55511fbafbfcde0b3b Mon Sep 17 00:00:00 2001 From: emelko Date: Fri, 7 Sep 2018 20:10:32 +0200 Subject: [PATCH 49/60] Deletes cervix out of chart --- components/chart/day-column.js | 1 - 1 file changed, 1 deletion(-) diff --git a/components/chart/day-column.js b/components/chart/day-column.js index 20fbcf8..630abc8 100644 --- a/components/chart/day-column.js +++ b/components/chart/day-column.js @@ -29,7 +29,6 @@ export default class DayColumn extends Component { temperatureExclude, bleeding, mucus, - cervix, drawFhmLine, drawLtlAt, rightY, From ef45fd909801521f9c989641bbff4df2baeda708 Mon Sep 17 00:00:00 2001 From: emelko Date: Sat, 8 Sep 2018 12:45:58 +0200 Subject: [PATCH 50/60] Deleting unused code --- components/chart/styles.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/components/chart/styles.js b/components/chart/styles.js index 0b8a49c..d7ab484 100644 --- a/components/chart/styles.js +++ b/components/chart/styles.js @@ -61,11 +61,6 @@ const styles = { '#a64ca6', '#993299' ], - cervixIcon: { - width: 12, - height: 12, - borderRadius: 50 - }, yAxis: { width: config.columnWidth, borderRightWidth: 0.5, From 9f5eb7c32efa98f00635580fadb3ca6c4b6b1559 Mon Sep 17 00:00:00 2001 From: emelko Date: Sat, 8 Sep 2018 12:53:37 +0200 Subject: [PATCH 51/60] Adding when temp and secSymptom evaluation is over at the same day --- lib/sympto/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sympto/index.js b/lib/sympto/index.js index d51fda7..3c8207f 100644 --- a/lib/sympto/index.js +++ b/lib/sympto/index.js @@ -70,7 +70,7 @@ export default function getSymptoThermalStatus(cycleInfo) { const tempOver = temperatureShift.evaluationCompleteDay.date const secondarySymptomOver = secondaryShift.evaluationCompleteDay.date - if (tempOver > secondarySymptomOver) { + if (tempOver >= secondarySymptomOver) { periOvulatoryEnd = temperatureShift.evaluationCompleteDay } else if (secondarySymptom > tempOver) { periOvulatoryEnd = secondaryShift.evaluationCompleteDay From e1d6345434cbda512e1dbc9485208fd8ba2de3cf Mon Sep 17 00:00:00 2001 From: emelko Date: Sat, 8 Sep 2018 12:57:38 +0200 Subject: [PATCH 52/60] Removing comment & making error comments even more helpful --- lib/sympto/index.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/sympto/index.js b/lib/sympto/index.js index 3c8207f..d73d635 100644 --- a/lib/sympto/index.js +++ b/lib/sympto/index.js @@ -104,21 +104,21 @@ export default function getSymptoThermalStatus(cycleInfo) { function throwIfArgsAreNotInRequiredFormat(cycles) { cycles.forEach(cycle => { assert.ok(Array.isArray(cycle), "Cycles must be arrays.") - assert.ok(cycle.length > 0, "Cycle must not be empty.") //what about 2 cycles of 1 day each?! + assert.ok(cycle.length > 0, "Cycle must not be empty.") assert.ok(cycle[0].bleeding !== null, "First cycle day should have bleeding.") assert.equal(typeof cycle[0].bleeding, 'object', "First cycle day must contain bleeding value.") - assert.equal(typeof cycle[0].bleeding.value, 'number', "First cycle day bleeding value is a number.") + assert.equal(typeof cycle[0].bleeding.value, 'number', "First cycle day bleeding value must be a number.") cycle.forEach(day => { - assert.equal(typeof day.date, 'string', "Date is given as a string.") - assert.doesNotThrow(() => LocalDate.parse(day.date), "Date is given in right string format.") - if (day.temperature) assert.equal(typeof day.temperature.value, 'number', "Temperature value is a number.") - if (day.mucus) assert.equal(typeof day.mucus.value, 'number', "Mucus value is a number.") - if (day.mucus) assert.ok(day.mucus.value >= 0, "Mucus value is greater or equal to 0.") - if (day.mucus) assert.ok(day.mucus.value <= 4, "Mucus value below 5.") - if (day.cervix) assert.ok(day.cervix.value.opening >= 0, "cervix opening value must be 0 or bigger") - if (day.cervix) assert.ok(day.cervix.value.opening <= 2, "cervix opening value must be 2 or smaller") - if (day.cervix) assert.ok(day.cervix.value.firmness >= 0, "cervix firmness value must be 0 or bigger") - if (day.cervix) assert.ok(day.cervix.value.firmness <= 1, "cervix firmness value must be 1 or smaller") + assert.equal(typeof day.date, 'string', "Date must be given as a string.") + assert.doesNotThrow(() => LocalDate.parse(day.date), "Date must be given in right string format.") + if (day.temperature) assert.equal(typeof day.temperature.value, 'number', "Temperature value must be a number.") + if (day.mucus) assert.equal(typeof day.mucus.value, 'number', "Mucus value must be a number.") + if (day.mucus) assert.ok(day.mucus.value >= 0, "Mucus value must greater or equal to 0.") + if (day.mucus) assert.ok(day.mucus.value <= 4, "Mucus value must be below 5.") + if (day.cervix) assert.ok(day.cervix.value.opening >= 0, "Cervix opening value must be 0 or bigger") + if (day.cervix) assert.ok(day.cervix.value.opening <= 2, "Cervix opening value must be 2 or smaller") + if (day.cervix) assert.ok(day.cervix.value.firmness >= 0, "Cervix firmness value must be 0 or bigger") + if (day.cervix) assert.ok(day.cervix.value.firmness <= 1, "Cervix firmness value must be 1 or smaller") assert.equal(typeof cycle[0].bleeding.value, 'number', "Bleeding value must be a number") }) }) From 969da1d16346edae005459c07003826c84cda190 Mon Sep 17 00:00:00 2001 From: emelko Date: Sat, 8 Sep 2018 13:22:17 +0200 Subject: [PATCH 53/60] Renaming test cycles to be more explicit abt what they do --- test/sympto/cervix-temp-fixtures.js | 4 ++-- test/sympto/cervix-temp.spec.js | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/sympto/cervix-temp-fixtures.js b/test/sympto/cervix-temp-fixtures.js index 0c8ae85..c7e7df3 100644 --- a/test/sympto/cervix-temp-fixtures.js +++ b/test/sympto/cervix-temp-fixtures.js @@ -15,7 +15,7 @@ function convertToSymptoFormat(val) { return sympto } -export const idealCycle = [ +export const cervixShiftAndFhmOnSameDay = [ { date: '2018-08-01', bleeding: 1, cervix: { opening: 1, firmness: 1 } }, { date: '2018-08-02', bleeding: 2, cervix: { opening: 1, firmness: 1 } }, { date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { opening: 2, firmness: 1 } }, @@ -189,7 +189,7 @@ export const cervixShift2DaysAfterTempShift = [ { date: '2018-04-24', temperature: 36.75, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) -export const noInfertilePhaseDetected = [ +export const noOvulationDetected = [ { date: '2018-03-08', bleeding: 3 }, { date: '2018-03-09', bleeding: 3 }, { date: '2018-03-10', bleeding: 3 }, diff --git a/test/sympto/cervix-temp.spec.js b/test/sympto/cervix-temp.spec.js index 6b06ddd..3f20a5e 100644 --- a/test/sympto/cervix-temp.spec.js +++ b/test/sympto/cervix-temp.spec.js @@ -1,14 +1,14 @@ import chai from 'chai' import getSensiplanStatus from '../../lib/sympto' import { - idealCycle, + cervixShiftAndFhmOnSameDay, cycleWithFhmNoCervixShift, cycleWithoutFhm, cycleWithoutAnyShifts, tempAndCervixEvalEndOnSameDay, tempShift3DaysAfterCervixShift, cervixShift2DaysAfterTempShift, - noInfertilePhaseDetected, + noOvulationDetected, fiveDayCycle } from './cervix-temp-fixtures' @@ -51,7 +51,7 @@ describe('sympto', () => { }) it('with temp and cervix shifts detects only peri- and post-ovulatory phases', () => { const status = getSensiplanStatus({ - cycle: idealCycle, + cycle: cervixShiftAndFhmOnSameDay, previousCycle: cycleWithoutFhm, secondarySymptom: 'cervix' }) @@ -62,12 +62,12 @@ describe('sympto', () => { expect(status.phases.periOvulatory).to.eql({ start: { date: '2018-08-01' }, end: { date: '2018-08-15', time: '18:00' }, - cycleDays: idealCycle + cycleDays: cervixShiftAndFhmOnSameDay .filter(({date}) => date <= '2018-08-15') }) expect(status.phases.postOvulatory).to.eql({ start: { date: '2018-08-15', time: '18:00' }, - cycleDays: idealCycle + cycleDays: cervixShiftAndFhmOnSameDay .filter(({date}) => date >= '2018-08-15') }) }) @@ -76,7 +76,7 @@ describe('sympto', () => { it('with no shifts detects only peri-ovulatory in 3-day long cycle according to 5-day rule', () => { const status = getSensiplanStatus({ cycle: fiveDayCycle, - previousCycle: idealCycle, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(1) @@ -89,7 +89,7 @@ describe('sympto', () => { it('with no shifts detects pre- and peri-ovulatory phase according to 5-day-rule', () => { const status = getSensiplanStatus({ cycle: cycleWithoutAnyShifts, - previousCycle: idealCycle, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) @@ -109,7 +109,7 @@ describe('sympto', () => { it('with evaluation of temperature and cervix end on same day', () => { const status = getSensiplanStatus({ cycle: tempAndCervixEvalEndOnSameDay, - previousCycle: idealCycle, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -139,7 +139,7 @@ describe('sympto', () => { it('when temperature shift happens 3 days after cervix shift', () => { const status = getSensiplanStatus({ cycle: tempShift3DaysAfterCervixShift, - previousCycle: idealCycle, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -171,7 +171,7 @@ describe('sympto', () => { it('when cervix shift happens 2 days after temperature shift', () => { const status = getSensiplanStatus({ cycle: cervixShift2DaysAfterTempShift, - previousCycle: idealCycle, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -201,19 +201,19 @@ describe('sympto', () => { }) it('when no infertile phase can be detected', () => { const status = getSensiplanStatus({ - cycle: noInfertilePhaseDetected, - previousCycle: idealCycle, + cycle: noOvulationDetected, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(2) expect(status.phases.preOvulatory).to.eql({ - cycleDays: noInfertilePhaseDetected + cycleDays: noOvulationDetected .filter(({date}) => date <= '2018-03-12'), start: { date: '2018-03-08' }, end: { date: '2018-03-12' } }) expect(status.phases.periOvulatory).to.eql({ - cycleDays: noInfertilePhaseDetected + cycleDays: noOvulationDetected .filter(({date}) => date > '2018-03-12'), start: { date: '2018-03-13' } }) From ab2dd76bf41a86aea3fe3f56ebd7c1a523ec24d8 Mon Sep 17 00:00:00 2001 From: emelko Date: Sat, 8 Sep 2018 13:27:38 +0200 Subject: [PATCH 54/60] Liberating a forgotten .only from tests --- test/sympto/mucus-temp.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sympto/mucus-temp.spec.js b/test/sympto/mucus-temp.spec.js index dbb925b..c2a2563 100644 --- a/test/sympto/mucus-temp.spec.js +++ b/test/sympto/mucus-temp.spec.js @@ -22,7 +22,7 @@ import { const expect = chai.expect -describe.only('sympto', () => { +describe('sympto', () => { describe('combining temperature and mucus tracking', () => { describe('with no previous higher temp measurement', () => { it('with no shifts detects only peri-ovulatory', () => { From 1b0d04dfc06426e926e413cd9f90f5d075c68d5d Mon Sep 17 00:00:00 2001 From: emelko Date: Sat, 8 Sep 2018 14:47:31 +0200 Subject: [PATCH 55/60] Fixing cervix unit tests --- test/sympto/cervix.spec.js | 56 ++++++++++++-------------------------- 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/test/sympto/cervix.spec.js b/test/sympto/cervix.spec.js index 6c43cb9..f935945 100644 --- a/test/sympto/cervix.spec.js +++ b/test/sympto/cervix.spec.js @@ -5,53 +5,45 @@ const expect = chai.expect function turnIntoCycleDayObject(value, fakeDate) { const hardAndClosed = { - isHard: true, - isClosed: true + value: { opening: 0, firmness: 0 } } const hardAndOpen = { - isHard: true, - isClosed: false + value: { opening: 1, firmness: 0 } } const softAndClosed = { - isHard: false, - isClosed: true + value: { opening: 0, firmness: 1 } } const softAndOpen = { - isHard: false, - isClosed: false + value: { opening: 1, firmness: 1 } } const cervixStates = [hardAndClosed, hardAndOpen, softAndClosed, softAndOpen] return { - cervix : cervixStates[value], - date: fakeDate + date: fakeDate, + cervix: cervixStates[value], + exclude: false } } describe('sympto', () => { describe('detects cervix shift', () => { - it('when an ideal cycle happens', function () { - const values = [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 0, 0, 0, 0] + it('when shift happens at day 15 with consistent following days', function () { + const values = [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 3, 1, 3, 1, 0, 0, 0, 0] .map(turnIntoCycleDayObject) const status = getCervixStatus(values) expect(status).to.eql({ detected: true, cervixPeakBeforeShift: { date: 13, - cervix: { - isHard: true, - isClosed: false - } + cervix: {value: { opening: 1, firmness: 0 }}, + exclude: false }, evaluationCompleteDay: { date: 16, - cervix: { - isHard: true, - isClosed: true - } + cervix: { value: { opening: 0, firmness: 0 }}, + exclude: false } }) }) - it('at the very first day of cycle days even if later shift happens again', function () { const values = [2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] .map(turnIntoCycleDayObject) @@ -60,17 +52,13 @@ describe('sympto', () => { detected: true, cervixPeakBeforeShift: { date: 0, - cervix: { - isHard: false, - isClosed: true - } + cervix: { value: { opening: 0, firmness: 1 } }, + exclude: false }, evaluationCompleteDay: { date: 3, - cervix: { - isHard: true, - isClosed: true - } + cervix: { value: { opening: 0, firmness: 0 } }, + exclude: false } }) }) @@ -83,32 +71,22 @@ describe('sympto', () => { const status = getCervixStatus(values) expect(status).to.eql({ detected: false }) }) - it('if there are no cervix values', function () { const values = [].map(turnIntoCycleDayObject) const status = getCervixStatus(values) expect(status).to.eql({ detected: false }) }) - it('when the cervix values are all the same', function () { const values = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] .map(turnIntoCycleDayObject) const status = getCervixStatus(values) expect(status).to.eql({ detected: false }) }) - it('if no days of hard and closed cervix are tracked', function () { const values = [1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1] .map(turnIntoCycleDayObject) const status = getCervixStatus(values) expect(status).to.eql({ detected: false }) }) - - it('if days of hard and closed cervix are fewer than 3', function () { - const values = [1, 3, 2, 1, 0, 2, 1, 3, 2, 0, 0, 2, 1, 3, 2, 1] - .map(turnIntoCycleDayObject) - const status = getCervixStatus(values) - expect(status).to.eql({ detected: false }) - }) }) }) From 21dba52753027a2c85e4832fc1091c293afe657b Mon Sep 17 00:00:00 2001 From: emelko Date: Sun, 9 Sep 2018 16:35:16 +0200 Subject: [PATCH 56/60] Renaming for more precision --- lib/sympto/temperature.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/sympto/temperature.js b/lib/sympto/temperature.js index 418757b..fb380b5 100644 --- a/lib/sympto/temperature.js +++ b/lib/sympto/temperature.js @@ -39,18 +39,18 @@ function checkIfFirstHighMeasurement(temp, i, temperatureDays, ltl) { if (i > temperatureDays.length - 3) { return { detected: false } } - const nextDaysAfterFhm = temperatureDays.slice(i + 1, i + 4) + const nextDaysAfterPotentialFhm = temperatureDays.slice(i + 1, i + 4) return ( - getResultForRegularRule(nextDaysAfterFhm, ltl)) || - getResultForFirstExceptionRule(nextDaysAfterFhm, ltl) || - getResultForSecondExceptionRule(nextDaysAfterFhm, ltl) || + getResultForRegularRule(nextDaysAfterPotentialFhm, ltl)) || + getResultForFirstExceptionRule(nextDaysAfterPotentialFhm, ltl) || + getResultForSecondExceptionRule(nextDaysAfterPotentialFhm, ltl) || { detected: false } } -function getResultForRegularRule(nextDaysAfterFhm, ltl) { - if (!nextDaysAfterFhm.every(day => day.temp > ltl)) return false - const thirdDay = nextDaysAfterFhm[1] +function getResultForRegularRule(nextDaysAfterPotentialFhm, ltl) { + if (!nextDaysAfterPotentialFhm.every(day => day.temp > ltl)) return false + const thirdDay = nextDaysAfterPotentialFhm[1] if (rounded(thirdDay.temp - ltl, 0.1) < 0.2) return false return { detected: true, @@ -60,10 +60,10 @@ function getResultForRegularRule(nextDaysAfterFhm, ltl) { } } -function getResultForFirstExceptionRule(nextDaysAfterFhm, ltl) { - if (nextDaysAfterFhm.length < 3) return false - if (!nextDaysAfterFhm.every(day => day.temp > ltl)) return false - const fourthDay = nextDaysAfterFhm[2] +function getResultForFirstExceptionRule(nextDaysAfterPotentialFhm, ltl) { + if (nextDaysAfterPotentialFhm.length < 3) return false + if (!nextDaysAfterPotentialFhm.every(day => day.temp > ltl)) return false + const fourthDay = nextDaysAfterPotentialFhm[2] if (fourthDay.temp <= ltl) return false return { detected: true, @@ -73,10 +73,10 @@ function getResultForFirstExceptionRule(nextDaysAfterFhm, ltl) { } } -function getResultForSecondExceptionRule(nextDaysAfterFhm, ltl) { - if (nextDaysAfterFhm.length < 3) return false - if (secondOrThirdTempIsAtOrBelowLtl(nextDaysAfterFhm, ltl)) { - const fourthDay = nextDaysAfterFhm[2] +function getResultForSecondExceptionRule(nextDaysAfterPotentialFhm, ltl) { + if (nextDaysAfterPotentialFhm.length < 3) return false + if (secondOrThirdTempIsAtOrBelowLtl(nextDaysAfterPotentialFhm, ltl)) { + const fourthDay = nextDaysAfterPotentialFhm[2] if (rounded(fourthDay.temp - ltl, 0.1) >= 0.2) { return { detected: true, @@ -89,9 +89,9 @@ function getResultForSecondExceptionRule(nextDaysAfterFhm, ltl) { return false } -function secondOrThirdTempIsAtOrBelowLtl(nextDaysAfterFhm, ltl) { - const secondIsLow = nextDaysAfterFhm[0].temp <= ltl - const thirdIsLow = nextDaysAfterFhm[1].temp <= ltl +function secondOrThirdTempIsAtOrBelowLtl(nextDaysAfterPotentialFhm, ltl) { + const secondIsLow = nextDaysAfterPotentialFhm[0].temp <= ltl + const thirdIsLow = nextDaysAfterPotentialFhm[1].temp <= ltl if ((secondIsLow || thirdIsLow) && !(secondIsLow && thirdIsLow)) { return true } else { From 2f42840faab33a66410d8a4e2927b02e15de98b1 Mon Sep 17 00:00:00 2001 From: emelko Date: Mon, 10 Sep 2018 12:09:37 +0200 Subject: [PATCH 57/60] Revert "Renaming test cycles to be more explicit abt what they do" This reverts commit 969da1d16346edae005459c07003826c84cda190. --- test/sympto/cervix-temp-fixtures.js | 4 ++-- test/sympto/cervix-temp.spec.js | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/sympto/cervix-temp-fixtures.js b/test/sympto/cervix-temp-fixtures.js index c7e7df3..0c8ae85 100644 --- a/test/sympto/cervix-temp-fixtures.js +++ b/test/sympto/cervix-temp-fixtures.js @@ -15,7 +15,7 @@ function convertToSymptoFormat(val) { return sympto } -export const cervixShiftAndFhmOnSameDay = [ +export const idealCycle = [ { date: '2018-08-01', bleeding: 1, cervix: { opening: 1, firmness: 1 } }, { date: '2018-08-02', bleeding: 2, cervix: { opening: 1, firmness: 1 } }, { date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { opening: 2, firmness: 1 } }, @@ -189,7 +189,7 @@ export const cervixShift2DaysAfterTempShift = [ { date: '2018-04-24', temperature: 36.75, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) -export const noOvulationDetected = [ +export const noInfertilePhaseDetected = [ { date: '2018-03-08', bleeding: 3 }, { date: '2018-03-09', bleeding: 3 }, { date: '2018-03-10', bleeding: 3 }, diff --git a/test/sympto/cervix-temp.spec.js b/test/sympto/cervix-temp.spec.js index 3f20a5e..6b06ddd 100644 --- a/test/sympto/cervix-temp.spec.js +++ b/test/sympto/cervix-temp.spec.js @@ -1,14 +1,14 @@ import chai from 'chai' import getSensiplanStatus from '../../lib/sympto' import { - cervixShiftAndFhmOnSameDay, + idealCycle, cycleWithFhmNoCervixShift, cycleWithoutFhm, cycleWithoutAnyShifts, tempAndCervixEvalEndOnSameDay, tempShift3DaysAfterCervixShift, cervixShift2DaysAfterTempShift, - noOvulationDetected, + noInfertilePhaseDetected, fiveDayCycle } from './cervix-temp-fixtures' @@ -51,7 +51,7 @@ describe('sympto', () => { }) it('with temp and cervix shifts detects only peri- and post-ovulatory phases', () => { const status = getSensiplanStatus({ - cycle: cervixShiftAndFhmOnSameDay, + cycle: idealCycle, previousCycle: cycleWithoutFhm, secondarySymptom: 'cervix' }) @@ -62,12 +62,12 @@ describe('sympto', () => { expect(status.phases.periOvulatory).to.eql({ start: { date: '2018-08-01' }, end: { date: '2018-08-15', time: '18:00' }, - cycleDays: cervixShiftAndFhmOnSameDay + cycleDays: idealCycle .filter(({date}) => date <= '2018-08-15') }) expect(status.phases.postOvulatory).to.eql({ start: { date: '2018-08-15', time: '18:00' }, - cycleDays: cervixShiftAndFhmOnSameDay + cycleDays: idealCycle .filter(({date}) => date >= '2018-08-15') }) }) @@ -76,7 +76,7 @@ describe('sympto', () => { it('with no shifts detects only peri-ovulatory in 3-day long cycle according to 5-day rule', () => { const status = getSensiplanStatus({ cycle: fiveDayCycle, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(1) @@ -89,7 +89,7 @@ describe('sympto', () => { it('with no shifts detects pre- and peri-ovulatory phase according to 5-day-rule', () => { const status = getSensiplanStatus({ cycle: cycleWithoutAnyShifts, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) @@ -109,7 +109,7 @@ describe('sympto', () => { it('with evaluation of temperature and cervix end on same day', () => { const status = getSensiplanStatus({ cycle: tempAndCervixEvalEndOnSameDay, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -139,7 +139,7 @@ describe('sympto', () => { it('when temperature shift happens 3 days after cervix shift', () => { const status = getSensiplanStatus({ cycle: tempShift3DaysAfterCervixShift, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -171,7 +171,7 @@ describe('sympto', () => { it('when cervix shift happens 2 days after temperature shift', () => { const status = getSensiplanStatus({ cycle: cervixShift2DaysAfterTempShift, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -201,19 +201,19 @@ describe('sympto', () => { }) it('when no infertile phase can be detected', () => { const status = getSensiplanStatus({ - cycle: noOvulationDetected, - previousCycle: cervixShiftAndFhmOnSameDay, + cycle: noInfertilePhaseDetected, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(2) expect(status.phases.preOvulatory).to.eql({ - cycleDays: noOvulationDetected + cycleDays: noInfertilePhaseDetected .filter(({date}) => date <= '2018-03-12'), start: { date: '2018-03-08' }, end: { date: '2018-03-12' } }) expect(status.phases.periOvulatory).to.eql({ - cycleDays: noOvulationDetected + cycleDays: noInfertilePhaseDetected .filter(({date}) => date > '2018-03-12'), start: { date: '2018-03-13' } }) From 3f5c86086de237b8721ab65737878bb3ff0c8921 Mon Sep 17 00:00:00 2001 From: emelko Date: Mon, 10 Sep 2018 12:28:54 +0200 Subject: [PATCH 58/60] Renaming test cycles for cervix+temp to be more explicit abt what they do --- test/sympto/cervix-temp-fixtures.js | 34 ++------------ test/sympto/cervix-temp.spec.js | 71 ++++++++++++++--------------- 2 files changed, 38 insertions(+), 67 deletions(-) diff --git a/test/sympto/cervix-temp-fixtures.js b/test/sympto/cervix-temp-fixtures.js index 0c8ae85..0299524 100644 --- a/test/sympto/cervix-temp-fixtures.js +++ b/test/sympto/cervix-temp-fixtures.js @@ -15,7 +15,7 @@ function convertToSymptoFormat(val) { return sympto } -export const idealCycle = [ +export const cervixShiftAndFhmOnSameDay = [ { date: '2018-08-01', bleeding: 1, cervix: { opening: 1, firmness: 1 } }, { date: '2018-08-02', bleeding: 2, cervix: { opening: 1, firmness: 1 } }, { date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { opening: 2, firmness: 1 } }, @@ -62,7 +62,7 @@ export const cycleWithoutFhmNoCervixShift = [ { date: '2018-06-13', temperature: 36.9, cervix: { opening: 1, firmness: 1 } } ].map(convertToSymptoFormat) -export const cycleWithoutAnyShifts = [ +export const longCycleWithoutAnyShifts = [ { date: '2018-07-01', temperature: 36.65, bleeding: 1 }, { date: '2018-07-02', temperature: 36.45 }, { date: '2018-07-03', temperature: 36.65 }, @@ -114,34 +114,6 @@ export const longAndComplicatedCycle = [ { date: '2018-06-27', temperature: 36.9, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) -export const tempAndCervixEvalEndOnSameDay = [ - { date: '2018-06-01', bleeding: 2 }, - { date: '2018-06-02', bleeding: 1 }, - { date: '2018-06-03', bleeding: 1 }, - { date: '2018-06-04', bleeding: 2 }, - { date: '2018-06-05', bleeding: 1 }, - { date: '2018-06-06', bleeding: 1 }, - { date: '2018-06-07', cervix: { opening: 2, firmness: 0 } }, - { date: '2018-06-08', temperature: 36.45, cervix: { opening: 0, firmness: 1 } }, - { date: '2018-06-09', temperature: 36.5, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-10', temperature: 36.30, cervix: { opening: 0, firmness: 1 } }, - { date: '2018-06-11', temperature: 36.30, cervix: { opening: 1, firmness: 0 } }, - { date: '2018-06-12', temperature: 36.4, cervix: { opening: 2, firmness: 1 } }, - { date: '2018-06-13', temperature: 36.3, cervix: { opening: 1, firmness: 1 } }, - { date: '2018-06-14', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, - { date: '2018-06-15', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-16', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-17', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-18', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-19', temperature: 36.95, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-20', temperature: 37.0, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-21', temperature: 37.0, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-22', temperature: 37.0, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-23', cervix: { opening: 0, firmness: 0 } }, - { date: '2018-06-24', cervix: { opening: 0, firmness: 0 }}, - { date: '2018-06-25', cervix: { opening: 1, firmness: 1 } } -].map(convertToSymptoFormat) - export const tempShift3DaysAfterCervixShift = [ { date: '2018-05-08', bleeding: 3 }, { date: '2018-05-09', bleeding: 2 }, @@ -189,7 +161,7 @@ export const cervixShift2DaysAfterTempShift = [ { date: '2018-04-24', temperature: 36.75, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) -export const noInfertilePhaseDetected = [ +export const noOvulationDetected = [ { date: '2018-03-08', bleeding: 3 }, { date: '2018-03-09', bleeding: 3 }, { date: '2018-03-10', bleeding: 3 }, diff --git a/test/sympto/cervix-temp.spec.js b/test/sympto/cervix-temp.spec.js index 6b06ddd..5ccd940 100644 --- a/test/sympto/cervix-temp.spec.js +++ b/test/sympto/cervix-temp.spec.js @@ -1,14 +1,13 @@ import chai from 'chai' import getSensiplanStatus from '../../lib/sympto' import { - idealCycle, + cervixShiftAndFhmOnSameDay, cycleWithFhmNoCervixShift, cycleWithoutFhm, - cycleWithoutAnyShifts, - tempAndCervixEvalEndOnSameDay, + longCycleWithoutAnyShifts, tempShift3DaysAfterCervixShift, cervixShift2DaysAfterTempShift, - noInfertilePhaseDetected, + noOvulationDetected, fiveDayCycle } from './cervix-temp-fixtures' @@ -19,7 +18,7 @@ describe('sympto', () => { describe('with no previous higher temp measurement', () => { it('with no temp or cervix shifts detects only peri-ovulatory', () => { const status = getSensiplanStatus({ - cycle: cycleWithoutAnyShifts, + cycle: longCycleWithoutAnyShifts, previousCycle: cycleWithoutFhm, secondarySymptom: 'cervix' }) @@ -28,7 +27,7 @@ describe('sympto', () => { phases: { periOvulatory: { start: { date: '2018-07-01' }, - cycleDays: cycleWithoutAnyShifts + cycleDays: longCycleWithoutAnyShifts } } }) @@ -51,7 +50,7 @@ describe('sympto', () => { }) it('with temp and cervix shifts detects only peri- and post-ovulatory phases', () => { const status = getSensiplanStatus({ - cycle: idealCycle, + cycle: cervixShiftAndFhmOnSameDay, previousCycle: cycleWithoutFhm, secondarySymptom: 'cervix' }) @@ -62,21 +61,21 @@ describe('sympto', () => { expect(status.phases.periOvulatory).to.eql({ start: { date: '2018-08-01' }, end: { date: '2018-08-15', time: '18:00' }, - cycleDays: idealCycle + cycleDays: cervixShiftAndFhmOnSameDay .filter(({date}) => date <= '2018-08-15') }) expect(status.phases.postOvulatory).to.eql({ start: { date: '2018-08-15', time: '18:00' }, - cycleDays: idealCycle + cycleDays: cervixShiftAndFhmOnSameDay .filter(({date}) => date >= '2018-08-15') }) }) }) describe('with previous higher temp measurement', () => { - it('with no shifts detects only peri-ovulatory in 3-day long cycle according to 5-day rule', () => { + it('with no shifts detects only peri-ovulatory in 5-day long cycle according to 5-day rule', () => { const status = getSensiplanStatus({ cycle: fiveDayCycle, - previousCycle: idealCycle, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(1) @@ -88,58 +87,58 @@ describe('sympto', () => { }) it('with no shifts detects pre- and peri-ovulatory phase according to 5-day-rule', () => { const status = getSensiplanStatus({ - cycle: cycleWithoutAnyShifts, - previousCycle: idealCycle, + cycle: longCycleWithoutAnyShifts, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(2) expect(status.phases.preOvulatory).to.eql({ - cycleDays: cycleWithoutAnyShifts + cycleDays: longCycleWithoutAnyShifts .filter(({date}) => date <= '2018-07-05'), start: { date: '2018-07-01' }, end: { date: '2018-07-05' } }) expect(status.phases.periOvulatory).to.eql({ - cycleDays: cycleWithoutAnyShifts + cycleDays: longCycleWithoutAnyShifts .filter(({date}) => date >= '2018-07-06'), start: { date: '2018-07-06' } }) }) it('with evaluation of temperature and cervix end on same day', () => { const status = getSensiplanStatus({ - cycle: tempAndCervixEvalEndOnSameDay, - previousCycle: idealCycle, + cycle: cervixShiftAndFhmOnSameDay, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) - expect(status.temperatureShift.evaluationCompleteDay.date).to.eql('2018-06-17') - expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-06-17') + expect(status.temperatureShift.evaluationCompleteDay.date).to.eql('2018-08-15') + expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-08-15') expect(status.phases.preOvulatory).to.eql({ - start: { date: '2018-06-01' }, - end: { date: '2018-06-05' }, - cycleDays: tempAndCervixEvalEndOnSameDay - .filter(({date}) => date <= '2018-06-05') + start: { date: '2018-08-01' }, + end: { date: '2018-08-05' }, + cycleDays: cervixShiftAndFhmOnSameDay + .filter(({date}) => date <= '2018-08-05') }) expect(status.phases.periOvulatory).to.eql({ - start: { date: '2018-06-06' }, - end: { date: '2018-06-17', time: '18:00' }, - cycleDays: tempAndCervixEvalEndOnSameDay + start: { date: '2018-08-06' }, + end: { date: '2018-08-15', time: '18:00' }, + cycleDays: cervixShiftAndFhmOnSameDay .filter(({date}) => { - return date > '2018-06-05' && date <= '2018-06-17' + return date > '2018-08-05' && date <= '2018-08-15' }) }) expect(status.phases.postOvulatory).to.eql({ - start: { date: '2018-06-17', time: '18:00' }, - cycleDays: tempAndCervixEvalEndOnSameDay - .filter(({date}) => date >= '2018-06-17') + start: { date: '2018-08-15', time: '18:00' }, + cycleDays: cervixShiftAndFhmOnSameDay + .filter(({date}) => date >= '2018-08-15') }) }) it('when temperature shift happens 3 days after cervix shift', () => { const status = getSensiplanStatus({ cycle: tempShift3DaysAfterCervixShift, - previousCycle: idealCycle, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -171,7 +170,7 @@ describe('sympto', () => { it('when cervix shift happens 2 days after temperature shift', () => { const status = getSensiplanStatus({ cycle: cervixShift2DaysAfterTempShift, - previousCycle: idealCycle, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -201,19 +200,19 @@ describe('sympto', () => { }) it('when no infertile phase can be detected', () => { const status = getSensiplanStatus({ - cycle: noInfertilePhaseDetected, - previousCycle: idealCycle, + cycle: noOvulationDetected, + previousCycle: cervixShiftAndFhmOnSameDay, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(2) expect(status.phases.preOvulatory).to.eql({ - cycleDays: noInfertilePhaseDetected + cycleDays: noOvulationDetected .filter(({date}) => date <= '2018-03-12'), start: { date: '2018-03-08' }, end: { date: '2018-03-12' } }) expect(status.phases.periOvulatory).to.eql({ - cycleDays: noInfertilePhaseDetected + cycleDays: noOvulationDetected .filter(({date}) => date > '2018-03-12'), start: { date: '2018-03-13' } }) From 76056e1db022458241796a51054881cad86f3461 Mon Sep 17 00:00:00 2001 From: emelko Date: Thu, 13 Sep 2018 09:54:13 +0200 Subject: [PATCH 59/60] Improving cervix: * adding tempEvalEnd value to cervix tests * more comments in code for cervix sympto * better description in cervix temp tests * take out cervix.value --- lib/sympto/cervix.js | 25 +++-- lib/sympto/index.js | 8 +- test/sympto/cervix-temp-fixtures.js | 8 +- test/sympto/cervix-temp.spec.js | 15 ++- test/sympto/cervix.spec.js | 141 +++++++++++++++++++++------- 5 files changed, 141 insertions(+), 56 deletions(-) diff --git a/lib/sympto/cervix.js b/lib/sympto/cervix.js index 9a59645..2578381 100644 --- a/lib/sympto/cervix.js +++ b/lib/sympto/cervix.js @@ -1,15 +1,26 @@ export default function (cycleDays, tempEvalEndIndex) { - const cervixDays = cycleDays.filter(day => day.cervix && !day.cervix.exclude) + const notDetected = { detected: false } + const cervixDays = cycleDays + .filter(day => day.cervix && !day.cervix.exclude) + .filter(day => typeof day.cervix.opening === 'number' && typeof day.cervix.firmness === 'number') + + // we search for the day of cervix peak, which must: + // * have fertile cervix values + // * be followed by at least 3 days + // these 3 following days must all show infertile cervix values + // if everything applies we must check the days until the end of temperature evaluation + // during these relevantDays no fertile cervix must occur for (let i = 0; i < cervixDays.length; i++) { const day = cervixDays[i] if (isClosedAndHard(day.cervix)) continue - // the three following days must be with closed and hard cervix - // AND no other cervix value may occur until temperature evaluation has - // been completed + + // the three following days must be with closed and hard cervix (indicating an infertile cervix) const threeFollowingDays = cervixDays.slice(i + 1, i + 4) if (threeFollowingDays.length < 3) continue + // no other fertile cervix value may occur until temperature evaluation has + // been completed const fertileCervixOccursIn3FollowingDays = threeFollowingDays.some(day => { return !isClosedAndHard(day.cervix) }) @@ -33,9 +44,9 @@ export default function (cycleDays, tempEvalEndIndex) { } } - return { detected: false } + return notDetected } -function isClosedAndHard (cervix) { - return cervix.value.opening === 0 && cervix.value.firmness === 0 +function isClosedAndHard (cervixDay) { + return cervixDay.opening === 0 && cervixDay.firmness === 0 } diff --git a/lib/sympto/index.js b/lib/sympto/index.js index d73d635..575b608 100644 --- a/lib/sympto/index.js +++ b/lib/sympto/index.js @@ -115,10 +115,10 @@ function throwIfArgsAreNotInRequiredFormat(cycles) { if (day.mucus) assert.equal(typeof day.mucus.value, 'number', "Mucus value must be a number.") if (day.mucus) assert.ok(day.mucus.value >= 0, "Mucus value must greater or equal to 0.") if (day.mucus) assert.ok(day.mucus.value <= 4, "Mucus value must be below 5.") - if (day.cervix) assert.ok(day.cervix.value.opening >= 0, "Cervix opening value must be 0 or bigger") - if (day.cervix) assert.ok(day.cervix.value.opening <= 2, "Cervix opening value must be 2 or smaller") - if (day.cervix) assert.ok(day.cervix.value.firmness >= 0, "Cervix firmness value must be 0 or bigger") - if (day.cervix) assert.ok(day.cervix.value.firmness <= 1, "Cervix firmness value must be 1 or smaller") + if (day.cervix) assert.ok(day.cervix.opening >= 0, "Cervix opening value must be 0 or bigger") + if (day.cervix) assert.ok(day.cervix.opening <= 2, "Cervix opening value must be 2 or smaller") + if (day.cervix) assert.ok(day.cervix.firmness >= 0, "Cervix firmness value must be 0 or bigger") + if (day.cervix) assert.ok(day.cervix.firmness <= 1, "Cervix firmness value must be 1 or smaller") assert.equal(typeof cycle[0].bleeding.value, 'number', "Bleeding value must be a number") }) }) diff --git a/test/sympto/cervix-temp-fixtures.js b/test/sympto/cervix-temp-fixtures.js index 0299524..58ff695 100644 --- a/test/sympto/cervix-temp-fixtures.js +++ b/test/sympto/cervix-temp-fixtures.js @@ -4,8 +4,10 @@ function convertToSymptoFormat(val) { value: val.temperature, exclude: false } - if (val.cervix) sympto.cervix = { - value: val.cervix, + + if (val.cervix && typeof val.cervix.opening === 'number' && typeof val.cervix.firmness === 'number') sympto.cervix = { + opening: val.cervix.opening, + firmness: val.cervix.firmness, exclude: false } if (val.bleeding) sympto.bleeding = { @@ -130,7 +132,7 @@ export const tempShift3DaysAfterCervixShift = [ { date: '2018-05-20', temperature: 36.7, cervix: { opening: 0, firmness: 0 } }, { date: '2018-05-21', temperature: 36.6, cervix: { opening: 0, firmness: 0 } }, { date: '2018-05-22', temperature: 36.85, cervix: { opening: 0, firmness: 0 } }, - { date: '2018-05-23', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-05-23', temperature: 36.8, cervix: { opening: 1, firmness: 0 } }, { date: '2018-05-24', temperature: 36.85, cervix: { opening: 0, firmness: 0 } }, { date: '2018-05-25', temperature: 36.95, cervix: { opening: 0, firmness: 0 } }, { date: '2018-05-26', temperature: 36.85, cervix: { opening: 0, firmness: 1 } }, diff --git a/test/sympto/cervix-temp.spec.js b/test/sympto/cervix-temp.spec.js index 5ccd940..e2d8fa0 100644 --- a/test/sympto/cervix-temp.spec.js +++ b/test/sympto/cervix-temp.spec.js @@ -48,10 +48,9 @@ describe('sympto', () => { } }) }) - it('with temp and cervix shifts detects only peri- and post-ovulatory phases', () => { + it('with temp and cervix shifts at the same day an no previous cycle detects only peri- and post-ovulatory phases', () => { const status = getSensiplanStatus({ cycle: cervixShiftAndFhmOnSameDay, - previousCycle: cycleWithoutFhm, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(2) @@ -72,7 +71,7 @@ describe('sympto', () => { }) }) describe('with previous higher temp measurement', () => { - it('with no shifts detects only peri-ovulatory in 5-day long cycle according to 5-day rule', () => { + it('with no shifts in 5-day long cycle detects only peri-ovulatory according to 5-day rule', () => { const status = getSensiplanStatus({ cycle: fiveDayCycle, previousCycle: cervixShiftAndFhmOnSameDay, @@ -85,7 +84,7 @@ describe('sympto', () => { end: { date: '2018-08-05' } }) }) - it('with no shifts detects pre- and peri-ovulatory phase according to 5-day-rule', () => { + it('with no shifts in long cycle detects pre- and peri-ovulatory phase according to 5-day-rule', () => { const status = getSensiplanStatus({ cycle: longCycleWithoutAnyShifts, previousCycle: cervixShiftAndFhmOnSameDay, @@ -105,7 +104,7 @@ describe('sympto', () => { start: { date: '2018-07-06' } }) }) - it('with evaluation of temperature and cervix end on same day', () => { + it('with temperature and cervix evaluation end on same day detects all 3 phases', () => { const status = getSensiplanStatus({ cycle: cervixShiftAndFhmOnSameDay, previousCycle: cervixShiftAndFhmOnSameDay, @@ -135,7 +134,7 @@ describe('sympto', () => { .filter(({date}) => date >= '2018-08-15') }) }) - it('when temperature shift happens 3 days after cervix shift', () => { + it('with temperature shift 3 days after cervix shift detects all 3 phases', () => { const status = getSensiplanStatus({ cycle: tempShift3DaysAfterCervixShift, previousCycle: cervixShiftAndFhmOnSameDay, @@ -167,7 +166,7 @@ describe('sympto', () => { .filter(({date}) => date >= '2018-05-21') }) }) - it('when cervix shift happens 2 days after temperature shift', () => { + it('with cervix shift 2 days after temperature shift detects all 3 phases', () => { const status = getSensiplanStatus({ cycle: cervixShift2DaysAfterTempShift, previousCycle: cervixShiftAndFhmOnSameDay, @@ -198,7 +197,7 @@ describe('sympto', () => { start: { date: '2018-04-19', time: '18:00' } }) }) - it('when no infertile phase can be detected', () => { + it('with no shifts no ovulation is found detects only pre and peri-ovulatory phase', () => { const status = getSensiplanStatus({ cycle: noOvulationDetected, previousCycle: cervixShiftAndFhmOnSameDay, diff --git a/test/sympto/cervix.spec.js b/test/sympto/cervix.spec.js index f935945..f8bbc3e 100644 --- a/test/sympto/cervix.spec.js +++ b/test/sympto/cervix.spec.js @@ -5,87 +5,160 @@ const expect = chai.expect function turnIntoCycleDayObject(value, fakeDate) { const hardAndClosed = { - value: { opening: 0, firmness: 0 } + opening: 0, + firmness: 0 } const hardAndOpen = { - value: { opening: 1, firmness: 0 } + opening: 1, + firmness: 0 } const softAndClosed = { - value: { opening: 0, firmness: 1 } + opening: 0, + firmness: 1 } const softAndOpen = { - value: { opening: 1, firmness: 1 } + opening: 1, + firmness: 1 } const cervixStates = [hardAndClosed, hardAndOpen, softAndClosed, softAndOpen] return { date: fakeDate, - cervix: cervixStates[value], - exclude: false + cervix: { + opening: cervixStates[value].opening, + firmness: cervixStates[value].firmness, + exclude: false + } } } describe('sympto', () => { describe('detects cervix shift', () => { - it('when shift happens at day 15 with consistent following days', function () { - const values = [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 3, 1, 3, 1, 0, 0, 0, 0] + it('when shift happens at day 13 with consistent following days of infertile cervix until tempEvalEnd', () => { + const values = [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0] .map(turnIntoCycleDayObject) - const status = getCervixStatus(values) + const status = getCervixStatus(values, 16) expect(status).to.eql({ detected: true, cervixPeakBeforeShift: { - date: 13, - cervix: {value: { opening: 1, firmness: 0 }}, - exclude: false + date: 10, + cervix: { + opening: 1, + firmness: 1, + exclude: false + } }, evaluationCompleteDay: { - date: 16, - cervix: { value: { opening: 0, firmness: 0 }}, - exclude: false + date: 13, + cervix: { + opening: 0, + firmness: 0, + exclude: false + } } }) }) - it('at the very first day of cycle days even if later shift happens again', function () { + it('right at the start of cycle days even if later shift happens again because tempEvalEnd happened before second potential shift', () => { const values = [2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] .map(turnIntoCycleDayObject) - const status = getCervixStatus(values) + const status = getCervixStatus(values, 5) expect(status).to.eql({ detected: true, cervixPeakBeforeShift: { date: 0, - cervix: { value: { opening: 0, firmness: 1 } }, - exclude: false + cervix: { + opening: 0, + firmness: 1, + exclude: false + }, }, evaluationCompleteDay: { date: 3, - cervix: { value: { opening: 0, firmness: 0 } }, - exclude: false + cervix: { + opening: 0, + firmness: 0, + exclude: false + } + } + }) + }) + it('at day 6 although right at the start of cycle days a potential shift happened but because tempEvalEnd happens after second shift', () => { + const values = [2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + .map(turnIntoCycleDayObject) + const status = getCervixStatus(values, 10) + expect(status).to.eql({ + detected: true, + cervixPeakBeforeShift: { + date: 6, + cervix: { + opening: 1, + firmness: 0, + exclude: false + }, + }, + evaluationCompleteDay: { + date: 9, + cervix: { + opening: 0, + firmness: 0, + exclude: false + } + } + }) + }) + it('when the cervix shift is happening after tempEvalEnd', () => { + const values = [1,1,1,1,1,2,3,3,3,3,1,1,1,1,0,0,0,0,0,0,0] + .map(turnIntoCycleDayObject) + const status = getCervixStatus(values, 10) + expect(status).to.eql({ + detected: true, + cervixPeakBeforeShift: { + date: 13, + cervix: { + opening: 1, + firmness: 0, + exclude: false + } + }, + evaluationCompleteDay: { + date: 16, + cervix: { + opening: 0, + firmness: 0, + exclude: false + } } }) }) }) describe('detects no cervix shift', () => { - it('if there are less than 3 days closed and hard cervix', function () { - const values = [0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 0, 0, 2, 0] + it('if there are less than 3 days closed and hard cervix', () => { + const values = [0, 0, 0, 1, 1, 1, 2, 0, 3, 3, 3, 1, 1, 1, 0, 0, 2, 0] .map(turnIntoCycleDayObject) - const status = getCervixStatus(values) + const status = getCervixStatus(values, 15) expect(status).to.eql({ detected: false }) }) - it('if there are no cervix values', function () { - const values = [].map(turnIntoCycleDayObject) - const status = getCervixStatus(values) - expect(status).to.eql({ detected: false }) - }) - it('when the cervix values are all the same', function () { - const values = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + it('if cycleDays have not enough cervix values to detect valid cervix shift', () => { + const values = [2,0,0] .map(turnIntoCycleDayObject) - const status = getCervixStatus(values) + const status = getCervixStatus(values, 17) expect(status).to.eql({ detected: false }) }) - it('if no days of hard and closed cervix are tracked', function () { + it('if no days indicate fertile cervix which could be cervix peak', () => { const values = [1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1] .map(turnIntoCycleDayObject) - const status = getCervixStatus(values) + const status = getCervixStatus(values, 12) + expect(status).to.eql({ detected: false }) + }) + it('if all days indicate infertile cervix values', () => { + const values = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + .map(turnIntoCycleDayObject) + const status = getCervixStatus(values, 9) + expect(status).to.eql({ detected: false }) + }) + it('if there are no cervix values', () => { + const values = [].map(turnIntoCycleDayObject) + const status = getCervixStatus(values, 15) expect(status).to.eql({ detected: false }) }) }) From 14989d81d5dbe1e46ab657641d4ca9a8100ef04e Mon Sep 17 00:00:00 2001 From: emelko Date: Thu, 13 Sep 2018 10:49:42 +0200 Subject: [PATCH 60/60] Add better test as dummy cervix data --- db/fixtures.js | 92 +++++++++++++++++++++++++++++++++++++------------- db/index.js | 12 ++++--- 2 files changed, 77 insertions(+), 27 deletions(-) diff --git a/db/fixtures.js b/db/fixtures.js index 321c6df..fd4a949 100644 --- a/db/fixtures.js +++ b/db/fixtures.js @@ -29,28 +29,7 @@ export const cycleWithFhmMucus = [ { date: '2018-07-18', temperature: 36.9, mucus: 2 } ].map(convertToSymptoFormat).reverse() -export const cycleWithFhmCervix = [ - { date: '2018-08-01', bleeding: 2 }, - { date: '2018-08-02', bleeding: 1 }, - { date: '2018-08-03', bleeding: 0 }, - { date: '2018-08-04', bleeding: 0 }, - { date: '2018-08-05', temperature: 36.07 }, - { date: '2018-08-06', temperature: 36.2 }, - { date: '2018-08-07', temperature: 36.35 }, - { date: '2018-08-08', temperature: 36.4 }, - { date: '2018-08-09', temperature: 36.3 }, - { date: '2018-08-10', temperature: 36.45 }, - { date: '2018-08-11', temperature: 36.45 }, - { date: '2018-08-12', temperature: 36.7, cervix: { isClosed: false, isHard: false } }, - { date: '2018-08-13', temperature: 36.8, cervix: { isClosed: true, isHard: true } }, - { date: '2018-08-14', temperature: 36.75, cervix: { isClosed: true, isHard: true } }, - { date: '2018-08-15', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, - { date: '2018-08-16', temperature: 36.95, cervix: { isClosed: true, isHard: true } }, - { date: '2018-08-17', temperature: 36.9, cervix: { isClosed: true, isHard: true } }, - { date: '2018-08-18', temperature: 36.9, cervix: { isClosed: false, isHard: true } } -].map(convertToSymptoFormat).reverse() - -export const longAndComplicatedCycle = [ +export const longAndComplicatedCycleWithMucus = [ { date: '2018-06-01', temperature: 36.6, bleeding: 2 }, { date: '2018-06-02', temperature: 36.65 }, { date: '2018-06-04', temperature: 36.6 }, @@ -94,4 +73,71 @@ export const cycleWithTempAndNoMucusShift = [ { date: '2018-05-24', temperature: 36.85, mucus: 4 }, { date: '2018-05-26', temperature: 36.8, mucus: 4 }, { date: '2018-05-27', temperature: 36.9, mucus: 4 } -].map(convertToSymptoFormat).reverse() \ No newline at end of file +].map(convertToSymptoFormat).reverse() + +export const cycleWithFhmCervix = [ + { date: '2018-08-01', bleeding: 2 }, + { date: '2018-08-02', bleeding: 1 }, + { date: '2018-08-03', bleeding: 0 }, + { date: '2018-08-04', bleeding: 0 }, + { date: '2018-08-05', temperature: 36.07 }, + { date: '2018-08-06', temperature: 36.2 }, + { date: '2018-08-07', temperature: 36.35 }, + { date: '2018-08-08', temperature: 36.4 }, + { date: '2018-08-09', temperature: 36.3 }, + { date: '2018-08-10', temperature: 36.45 }, + { date: '2018-08-11', temperature: 36.45 }, + { date: '2018-08-12', temperature: 36.7, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-08-13', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-14', temperature: 36.75, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-15', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-16', temperature: 36.95, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-17', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-08-18', temperature: 36.9, cervix: { opening: 1, firmness: 0 } } +].map(convertToSymptoFormat).reverse() + +export const longAndComplicatedCycleWithCervix = [ + { date: '2018-06-01', temperature: 36.6, bleeding: 2 }, + { date: '2018-06-02', temperature: 36.65 }, + { date: '2018-06-04', temperature: 36.6 }, + { date: '2018-06-05', temperature: 36.55 }, + { date: '2018-06-06', temperature: 36.7, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-09', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-10', temperature: 36.4, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-13', temperature: 36.45, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-14', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-15', temperature: 36.55, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-16', temperature: 36.7, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-17', temperature: 36.65, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-18', temperature: 36.75, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-19', temperature: 36.8, cervix: { opening: 1, firmness: 0 } }, + { date: '2018-06-20', temperature: 36.85, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-21', temperature: 36.8, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-22', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-25', temperature: 36.9, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-06-26', temperature: 36.8, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-06-27', temperature: 36.9, cervix: { opening: 1, firmness: 1 } } +].map(convertToSymptoFormat).reverse() + +export const cycleWithTempAndNoCervixShift = [ + { date: '2018-07-01', temperature: 36.6, bleeding: 2 }, + { date: '2018-07-02', temperature: 36.65 }, + { date: '2018-07-05', temperature: 36.55 }, + { date: '2018-07-06', temperature: 36.7, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-07-08', temperature: 36.45, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-07-09', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-10', temperature: 36.4, cervix: { opening: 0, firmness: 0 } }, + { date: '2018-07-11', temperature: 36.5, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-07-13', temperature: 36.45, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-07-14', temperature: 36.5, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-15', temperature: 36.55, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-16', temperature: 36.7, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-07-17', temperature: 36.65, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-07-18', temperature: 36.75, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-19', temperature: 36.8, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-20', temperature: 36.85, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-23', temperature: 36.9, cervix: { opening: 0, firmness: 1 } }, + { date: '2018-07-24', temperature: 36.85, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-26', temperature: 36.8, cervix: { opening: 1, firmness: 1 } }, + { date: '2018-07-27', temperature: 36.9, cervix: { opening: 1, firmness: 1 } } +].map(convertToSymptoFormat).reverse() diff --git a/db/index.js b/db/index.js index 433d000..1b79d7b 100644 --- a/db/index.js +++ b/db/index.js @@ -1,10 +1,12 @@ import Realm from 'realm' import { LocalDate, ChronoUnit } from 'js-joda' import { - cycleWithTempAndNoMucusShift, cycleWithFhmMucus, + longAndComplicatedCycleWithMucus, + cycleWithTempAndNoMucusShift, cycleWithFhmCervix, - longAndComplicatedCycle + longAndComplicatedCycleWithCervix, + cycleWithTempAndNoCervixShift } from './fixtures' const TemperatureSchema = { @@ -183,7 +185,7 @@ function getCycleDay(localDate) { function fillWithMucusDummyData() { const dummyCycles = [ cycleWithFhmMucus, - longAndComplicatedCycle, + longAndComplicatedCycleWithMucus, cycleWithTempAndNoMucusShift ] @@ -207,7 +209,9 @@ function fillWithMucusDummyData() { function fillWithCervixDummyData() { const dummyCycles = [ - cycleWithFhmCervix + cycleWithFhmCervix, + longAndComplicatedCycleWithCervix, + cycleWithTempAndNoCervixShift ] db.write(() => {