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 CHANGED
@@ -14,6 +14,9 @@ chineseYear.years
14
14
 
15
15
  chineseYear.getAnimal(2000)
16
16
  //=> 'Dragon'
17
+
18
+ chineseYear.getAnimal(2026)
19
+ //=> Horse🐎
17
20
  ```
18
21
 
19
22
  ## API
package/index.js CHANGED
@@ -4,7 +4,7 @@ const yearse=['🐀', '🐂','🐅','🐇','🐉','&#x1
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=['🐀', '🐂','🐅','🐇','🐉','&#x1F4
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chinese-year-e",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "get the zodiac animal name of a year with emoji",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {