react-clock
Advanced tools
Comparing version 2.1.0 to 2.2.0
{ | ||
"name": "react-clock", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "A component to display clock for your React application.", | ||
"main": "build/entry.js", | ||
"main": "dist/entry.js", | ||
"es6": "src/entry.js", | ||
"scripts": { | ||
"build": "npm run build-js && npm run build-styles && npm run copy-styles", | ||
"build-js": "babel src -d build --ignore **/__tests__", | ||
"build-js": "babel src -d dist --ignore **/__tests__", | ||
"build-styles": "lessc ./src/Clock.less ./src/Clock.css", | ||
@@ -19,2 +19,5 @@ "copy-styles": "node ./copy-styles.js", | ||
"jest": { | ||
"setupFiles": [ | ||
"<rootDir>/jest.setup.js" | ||
], | ||
"collectCoverageFrom": [ | ||
@@ -50,3 +53,3 @@ "**/src/**.{js,jsx}", | ||
"babel-plugin-transform-object-assign": "^6.22.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-react": "^6.24.1", | ||
@@ -62,3 +65,4 @@ "babel-preset-stage-2": "^6.24.1", | ||
"eslint-plugin-react": "^7.5.1", | ||
"jest": "^21.2.1", | ||
"jest": "^22.0.4", | ||
"jest-cli": "^22.0.4", | ||
"less": "^2.7.3", | ||
@@ -70,3 +74,3 @@ "react-test-renderer": "^16.2.0" | ||
"README.md", | ||
"build/", | ||
"dist/", | ||
"src/" | ||
@@ -73,0 +77,0 @@ ], |
@@ -59,3 +59,3 @@ ![downloads](https://img.shields.io/npm/dt/react-clock.svg) ![build](https://img.shields.io/travis/wojtekmaj/react-clock.svg) ![dependencies](https://img.shields.io/david/wojtekmaj/react-clock.svg | ||
If you don't want to use default React-Clock styling to build upon it, you can import React-Clock by using `import Clock from 'react-clock/build/entry.nostyle';` instead. | ||
If you don't want to use default React-Clock styling to build upon it, you can import React-Clock by using `import Clock from 'react-clock/dist/entry.nostyle';` instead. | ||
@@ -62,0 +62,0 @@ ## User guide |
@@ -10,4 +10,4 @@ const hourOptionalSecondsRegExp = /^(([0-1])?[0-9]|2[0-3]):[0-5][0-9](:([0-5][0-9]))?$/; | ||
if (typeof date === 'string' && hourOptionalSecondsRegExp.test(date)) { | ||
const minuteString = date.split(':')[0]; | ||
return parseInt(minuteString, 10); | ||
const [hourString] = date.split(':'); | ||
return parseInt(hourString, 10); | ||
} | ||
@@ -24,3 +24,3 @@ | ||
if (typeof date === 'string' && hourOptionalSecondsRegExp.test(date)) { | ||
const minuteString = date.split(':')[1]; | ||
const [, minuteString] = date.split(':'); | ||
return parseInt(minuteString, 10); | ||
@@ -39,4 +39,4 @@ } | ||
if (hourRegExp.test(date)) { | ||
const minuteString = date.split(':')[2]; | ||
return parseInt(minuteString, 10); | ||
const [, , secondString] = date.split(':'); | ||
return parseInt(secondString, 10); | ||
} else if (hourOptionalSecondsRegExp.test(date)) { | ||
@@ -43,0 +43,0 @@ return 0; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39419
20
965
21
1