-
Notifications
You must be signed in to change notification settings - Fork 1
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
6 changed files
with
28 additions
and
17 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
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
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
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
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
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 |
---|---|---|
@@ -1,27 +1,36 @@ | ||
import { name as pkgName } from '../package.json'; | ||
import debugFactory from 'debug'; | ||
|
||
const debug = debugFactory(`${pkgName}:git-lib`); | ||
|
||
/** | ||
* Returns the sum of `a` and `b` | ||
*/ | ||
export function sum(a: number, b: number) { | ||
debug(`summed ${a} and ${b}`); | ||
return a + b; | ||
} | ||
|
||
/** | ||
* Returns the difference of `a` and `b` | ||
*/ | ||
export function diff(a: number, b: number) { | ||
debug(`subtracted ${b} from ${a}`); | ||
return a - b; | ||
} | ||
|
||
/** | ||
* Returns the product of `a` and `b` | ||
*/ | ||
export function mult(a: number, b: number) { | ||
debug(`multiplies ${a} and ${b}`); | ||
return a * b; | ||
} | ||
|
||
/** | ||
* Returns the quotient of `dividend` and `divisor` | ||
*/ | ||
export function div({ dividend, divisor }: { dividend: number; divisor: number }) { | ||
debug(`divides ${dividend} with ${divisor}`); | ||
return dividend / divisor; | ||
} |