-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Convert hour to chinese zodiac name | ||
* | ||
* @param {number|string} hour | ||
* @return {string} chinese zodiac name | ||
* | ||
* @example | ||
* hourToChineseZodiac(8); | ||
* //=> 'dragon' | ||
*/ | ||
function hourToChineseZodiac(hour) { | ||
if ((!hour && hour !== 0) || hour > 24) { | ||
return ''; | ||
} | ||
|
||
/* eslint-disable indent, no-multi-spaces, unicorn/no-nested-ternary */ | ||
return hour > 22 ? 'rat' : | ||
hour > 20 ? 'pig' : | ||
hour > 18 ? 'dog' : | ||
hour > 16 ? 'rooster' : | ||
hour > 14 ? 'monkey' : | ||
hour > 12 ? 'goat' : | ||
hour > 10 ? 'horse' : | ||
hour > 8 ? 'snake' : | ||
hour > 6 ? 'dragon' : | ||
hour > 4 ? 'rabbit' : | ||
hour > 2 ? 'tiger' : | ||
hour > 0 ? 'ox' : | ||
'rat'; | ||
/* eslint-enable indent, no-multi-spaces, unicorn/no-nested-ternary */ | ||
} | ||
|
||
module.exports = hourToChineseZodiac; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://www.robotstxt.org/robotstxt.html | ||
User-agent: * | ||
Disallow: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "Hour to Chinese zodiac", | ||
"short_name": "Hour to Chinese zodiac", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
}, | ||
{ | ||
"src": "logo192.png", | ||
"type": "image/png", | ||
"sizes": "192x192" | ||
}, | ||
{ | ||
"src": "logo512.png", | ||
"type": "image/png", | ||
"sizes": "512x512" | ||
} | ||
], | ||
"start_url": ".", | ||
"theme_color": "#ffffff", | ||
"background_color": "#ffffff", | ||
"display": "standalone" | ||
} |