Skip to content

Commit 0d4ea44

Browse files
Created a base Generator class which will be used by the web and node implementations (as an interface basically).
1 parent afd7f6e commit 0d4ea44

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
.idea

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.gitlab-ci.yml
2+
.gitignore
3+
.babelrc
4+
.eslintrc.json
5+
webpack.config.js
6+
.github
7+
tests

src/Generator.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export default class Generator {
2+
/**
3+
* Fetch a list of random char codes for alpha characters.
4+
*
5+
* @abstract
6+
* @param {number} len Amount of alpha characters to fetch.
7+
* @return {Array<number>} An array with char-codes (ascii) for the random alpha characters.
8+
*/
9+
alpha (len) {}
10+
11+
/**
12+
* Fetch a list of random char codes of numeric characters.
13+
*
14+
* @abstract
15+
* @param {number} len Amount of number characters to fetch.
16+
* @return {Array<number>} An array with char-codes (ascii) for the random numeric characters.
17+
*/
18+
numbers (len) {}
19+
20+
21+
/**
22+
* Fetch a list of random char codes of special characters.
23+
*
24+
* @abstract
25+
* @param {number} len Amount of special characters to fetch.
26+
* @return {Array<number>} An array with char-codes (ascii) for the random special characters.
27+
*/
28+
special (len) {}
29+
}

0 commit comments

Comments
 (0)