npm-pkg-hook 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  "rm": "rm -rf node_modules package-lock.json && npm i",
44
44
  "test": "echo \"Error: no test specified\" && exit 1"
45
45
  },
46
- "version": "1.6.0"
46
+ "version": "1.6.1"
47
47
  }
@@ -4,8 +4,10 @@
4
4
  * @returns {string} A string indicating the original number and the result of adding 10 minutes.
5
5
  */
6
6
  export const addTenMinutes = (num) => {
7
+ if (num > 60) return ''
7
8
  if (num >= 50) {
8
- return `${10 - num} - ${60} min`
9
+ const newNum = num - 10
10
+ return `${newNum} - ${60} min`
9
11
  } else {
10
12
  return `${num} - ${num + 10} min`
11
13
  }
@@ -4,11 +4,11 @@ import { useState } from 'react'
4
4
  * Custom hook to handle delivery time input validation and formatting.
5
5
  * @returns {Object} An object containing state and functions for handling delivery time.
6
6
  */
7
- export const useDeliveryTime = () => {
8
- const [deliveryTime, setDeliveryTime] = useState('')
7
+ export const useDeliveryTime = ({ initialTime = 0 }) => {
8
+ const [deliveryTime, setDeliveryTime] = useState(initialTime || 0)
9
9
  /**
10
10
  * Handles changes to the delivery time input.
11
- * @param {String} value - The input change value.
11
+ * @param {Number} value - The input change value.
12
12
  */
13
13
  const handleDeliveryTimeChange = (value) => {
14
14
  setDeliveryTime(value)