-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Front-end stuff as a first class citizen.
- Introducing test framework, assertion library. - Adding first batch of test. - Improving front-end directory structure. - Adding linting tool. Related to #28.
- Loading branch information
Showing
30 changed files
with
5,347 additions
and
5,212 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": [ "airbnb" ] | ||
} |
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,2 @@ | ||
build/*.js | ||
build/*.js.map |
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
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,45 @@ | ||
export default class Utils { | ||
static can_be_unescaped_atom(atom) { | ||
if (atom[0].search(/[a-z]/) === -1) { | ||
return false; | ||
} | ||
|
||
if (atom.search(/[^a-zA-Z@0-9_]/) !== -1) { | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
static formatMFA(MFA) { | ||
if (MFA.length !== 3) { | ||
throw new Error(`Unexpected argument passed to the formatter (MFA length: ${MFA.length}).`) | ||
} | ||
|
||
if (typeof(MFA[0]) !== "string") { | ||
throw new Error("Module name is not a string."); | ||
} | ||
|
||
if (MFA[0].length === 0) { | ||
throw new Error("Module name is an empty string."); | ||
} | ||
|
||
if (typeof(MFA[1]) !== "string") { | ||
throw new Error("Function name is not a string."); | ||
} | ||
|
||
if (MFA[1].length === 0) { | ||
throw new Error("Function name is an empty string."); | ||
} | ||
|
||
if (!Utils.can_be_unescaped_atom(MFA[0])) { | ||
MFA[0] = `'${MFA[0]}'`; | ||
} | ||
|
||
if (!Utils.can_be_unescaped_atom(MFA[1])) { | ||
MFA[1] = `'${MFA[1]}'`; | ||
} | ||
|
||
return `${MFA[0]}:${MFA[1]}/${MFA[2]}` | ||
} | ||
} |
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
Oops, something went wrong.