Skip to content

Commit

Permalink
Extend docstrings, add doc generator
Browse files Browse the repository at this point in the history
  • Loading branch information
VerHde committed Nov 6, 2021
1 parent ad76344 commit 9e1053b
Show file tree
Hide file tree
Showing 4 changed files with 415 additions and 9 deletions.
9 changes: 6 additions & 3 deletions emojify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions generateEmojiArray.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/** @module generateEmojiArray */
import fs from 'fs'

/**
* Return an array with all numbers from `start` to `end`
*
* @param {Number} start The first number to be in the Array
* @param {Number} end The last number to be in the Array
* @returns An Array with all consecutive numbers as elements, ranging from `start` to `end`
* @param {number} start The first number to be in the Array
* @param {number} end The last number to be in the Array
* @returns {number[]} An Array with all consecutive numbers as elements, ranging from `start` to `end`
*/
Array.range = (start, end) => Array.from(
{ length: (end - start) },
Expand All @@ -15,8 +16,8 @@ Array.range = (start, end) => Array.from(
/**
* Synchronously generate an array of emojis from a given Unicode emoji-data input file.
*
* @param {String} filename The file to read the emoji definition from
* @returns An array of emojis
* @param {string} [filename=emoji-data.txt] filename The file to read the emoji definition from
* @returns {Array} An array of emojis
*/
export default function generateEmojiArray (filename = 'emoji-data.txt') {
const file = fs.readFileSync(
Expand Down
Loading

0 comments on commit 9e1053b

Please sign in to comment.