chinese-year-e 1.0.1 → 1.0.2
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/README.md +3 -0
- package/index.js +2 -2
- package/lib/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const yearse=['🐀', '🐂','🐅','🐇','🐉','
|
|
|
4
4
|
exports.years = years
|
|
5
5
|
|
|
6
6
|
exports.getAnimal = num => {
|
|
7
|
-
const ind = num % 12;
|
|
7
|
+
const ind = (num+8) % 12;
|
|
8
8
|
let name =years[ind];
|
|
9
9
|
name+= ' '+yearse[ind];
|
|
10
10
|
if (!name) throw new Error(`Opps, error`)
|
|
@@ -12,7 +12,7 @@ exports.getAnimal = num => {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
exports.getAnimale = num => {
|
|
15
|
-
const ind = num % 12;
|
|
15
|
+
const ind = (num+8) % 12;
|
|
16
16
|
let name =yearse[ind];
|
|
17
17
|
if (!name) throw new Error(`Opps, error`)
|
|
18
18
|
return name
|
package/lib/index.js
CHANGED
|
@@ -5,14 +5,14 @@ var yearse=['🐀', '🐂','🐅','🐇','🐉','Ǵ
|
|
|
5
5
|
exports.years = years;
|
|
6
6
|
|
|
7
7
|
exports.getAnimal = function (num) {
|
|
8
|
-
var ind = num % 12;
|
|
8
|
+
var ind = (num+8) % 12;
|
|
9
9
|
var name = years[ind];
|
|
10
10
|
if (!name) throw new Error('Opps, error');
|
|
11
11
|
return name;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.getAnimale = function (num) {
|
|
15
|
-
var ind = num % 12;
|
|
15
|
+
var ind = (num+8) % 12;
|
|
16
16
|
var name = yearse[ind];
|
|
17
17
|
if (!name) throw new Error('Opps, error');
|
|
18
18
|
return name;
|