-
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.
* [x] resolved #2 refactored package to typescript PR comments thanks Katryn simpler type
- Loading branch information
Showing
10 changed files
with
947 additions
and
768 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
# compiled output | ||
<<<<<<< HEAD | ||
/dist/ | ||
======= | ||
dist/ | ||
lib/ | ||
>>>>>>> 93a6802... refactored to TypeScript |
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 |
---|---|---|
|
@@ -15,3 +15,4 @@ yarn-error.log | |
|
||
# built assets | ||
/dist | ||
|
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 was deleted.
Oops, something went wrong.
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,16 @@ | ||
type NamedCharRange = 'emoticons' | 'food' | 'animals' | 'expressions'; | ||
|
||
const CHAR_RANGE = { | ||
emoticons: [0x1f600, 0x1f64f], | ||
food: [0x1f32d, 0x1f37f], | ||
animals: [0x1f400, 0x1f4d3], | ||
expressions: [0x1f910, 0x1f92f] | ||
}; | ||
|
||
const random = function(range: NamedCharRange = 'emoticons'): string { | ||
const [max, min] = CHAR_RANGE[range]; | ||
const codePoint = Math.floor(Math.random() * (max - min) + min); | ||
return String.fromCodePoint(codePoint); | ||
}; | ||
|
||
export = random; |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"outDir": "dist", | ||
"strict": true | ||
}, | ||
"exclude": ["node_modules", "test.js"] | ||
} |
Oops, something went wrong.