From e493e676761ba2fde81128fb0180c84b3529921b Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Wed, 18 Dec 2019 09:36:18 -0500 Subject: added comb.js --- comb.js | 12 ++++++++++++ space.js | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 comb.js diff --git a/comb.js b/comb.js new file mode 100644 index 0000000..f607790 --- /dev/null +++ b/comb.js @@ -0,0 +1,12 @@ +// A set of combine utilities for use with Space.comb() +// Note: char1 is this and char2 is other. char1 will go "over" char2 + +function add(char1, char2){ + if (char1 == '') return char2; + else return char1; +} + +function sub(char1, char2){ + if (char1 == char2) return ''; + else return char1; +} diff --git a/space.js b/space.js index 8710507..58023a9 100644 --- a/space.js +++ b/space.js @@ -104,5 +104,6 @@ function Space(){ // CLASS } } - -exports.Space = Space +const comb = require('comb'); // A small set of utilities for Space.comb +exports.Space = Space; +exports.comb = comb; -- cgit