The bb26Increment function returns a string representing the plus one increment of a bijective base-26 number input string
import { bb26Increment } from 'bb26-spreadsheet';
let bb26PlusOne = bb26Increment("AA");
console.log(bb26PlusOne);
//returns "AB"
The bb26Decrement function returns a string representing the minus one decrement of a bijective base-26 number input string
import { bb26Decrement } from 'bb26-spreadsheet';
let bb26MinusOne = bb26Decrement("AAZ");
console.log(bb26MinusOne);
//returns "AAX"
The bb26Range function returns an inclusive increasing order array of upper case letter bijective base-26 number strings representing the range from ["A" to A] with one input or [A to B] with two inputs. Where A and B are upper case letter string function inputs
import { bb26Range } from 'bb26-spreadsheet';
let bb26RangeTwoInputs = bb26Range("E","G");
let bb26RangeOneInput = bb26Range("F");
console.log(bb26RangeOneInput);
//returns ["E", "F", "G"]
console.log(bb26RangeTwoInputs);
//returns ["A", "B", "C", "D", "E", "F"]
The bb26ToDecimal function returns a decimal number equivalent to the bijective base-26 number upper case letter string input
import { bb26ToDecimal } from 'bb26-spreadsheet';
let bb26ToDecimalResult = bb26ToDecimal("Z");
console.log(bb26ToDecimalResult);
//returns 26
The decimalTobb26 function returns a bijective base-26 number upper case letter string equivalent to the decimal number input
import { decimalTobb26 } from 'bb26-spreadsheet';
let decimalTobb26Result = decimalTobb26(497);
console.log(decimalTobb26Result);
//returns "SC"
The bb26Compare function takes in two bijective base-26 numbers and returns the number: 0 if a === b, 1 if a > b, and 2 if a < b
import { bb26Compare } from 'bb26-spreadsheet';
switch(bb26Compare("A", "B")){
case 0:
console.log("A==B");
break;
case 1:
console.log("A>B");
break;
case 2:
console.log("A<B");
break;
}
//returns "A<B"
The bb26Random function takes in two bijective base-26 numbers and returns a random base-26 number string inclusively between the two inputs
import { bb26Random } from 'bb26-spreadsheet';
console.log(bb26Random("A", "CE"));
//returns a value inclusively between "A" and "CE" e.g. "AA"
The numberbb26Random function takes in one or two integers greater or equal to 1 and returns a random base-26 number string inclusively between 1 and one input or the two inputs
import { numberbb26Random as bb26Random } from 'bb26-spreadsheet';
console.log(bb26Random(3, 1000));
//returns a value inclusively between 3 and 1000 e.g. "ABA"
The isValidbb26 function takes in a string and checks to see if it is a valid BB26 type string. If the string does not consist of only uppercase numbers the function throws a TypeError error. If the second argument is specified true the function does not throw an error but returns true or false values
import { isValidbb26 } from 'bb26-spreadsheet';
console.log(isValidbb26("AB")); //returns true
console.log(isValidbb26("ABb")); //throws throws TypeError
console.log(isValidbb26("AB", true)); //returns true
console.log(isValidbb26("ABb", true)); //returns false