countingup 0.2.1 → 0.2.3

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.
Files changed (2) hide show
  1. package/package.json +10 -2
  2. package/lib/Counter.js +0 -36
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "countingup",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Counter Class for JavaScrippt",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -15,5 +15,13 @@
15
15
  "utils",
16
16
  "problems",
17
17
  "calculations"
18
- ]
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/tj-commits/countingup.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/tj-commits/countingup/issues"
25
+ },
26
+ "homepage": "https://github.com/tj-commits/countingup#readme"
19
27
  }
package/lib/Counter.js DELETED
@@ -1,36 +0,0 @@
1
- function Counter(base) {
2
- if (base == null || !Number.isFinite(base)) base = 0
3
- var counter = base
4
- this.reset = function(base) {
5
- if (base == null || !Number.isFinite(base)) base = 0
6
- counter = base
7
- return this
8
- }
9
- this.getCurrentNumber = function() {
10
- return counter
11
- }
12
- this.count = function(increment, direction) {
13
- if (increment == null) increment = 1
14
- if (direction == null) direction = 'forwards'
15
- if (!Number.isFinite(increment) || !Number.isInteger(increment)) {
16
- return console.error('Invalid increment')
17
- }
18
- switch (direction) {
19
- case 'forwards': {
20
- counter += increment
21
- return
22
- }
23
-
24
- case 'backwards' || 'reverse': {
25
- counter -= increment
26
- return
27
- }
28
-
29
- default: {
30
- return console.error('Invalid direction')
31
- }
32
- }
33
- }
34
- }
35
-
36
- module.exports = Counter