--
zpe_type
function zpe_type(value) {
  if (value === null) return "NULL";
  if (typeof value === "boolean") return "BOOLEAN";
  if (typeof value === "number") return "NUMBER";
  if (typeof value === "string") return "STRING";
  if (Array.isArray(value)) return "LIST";
  if (typeof value === "function") return "FUNCTION";
  if (typeof value === "object") return "MAP";
  return "UNDEFINED";
}
--
zpe_length
function zpe_length(value) {
  if (value === null || value === undefined) return 0;
  if (typeof value === "string" || Array.isArray(value)) return value.length;
  return Object.keys(value).length;
}
--
zpe_print
function zpe_print(...values) {
  console.log(values.map(zpeStringify).join(""));
}
--
print
function print(...values) {
  console.log(values.map(zpeStringify).join(""));
}
--
time
function time() {
  return performance.now();
}
--
get_zpe_time
function get_zpe_time() {
  return performance.now();
}
--
random_number
function random_number(max, min = 0) {
  return Math.floor(Math.random() * (Number(max) - Number(min) + 1)) + Number(min);
}
--
factorial
function factorial(number) {
  number = Math.trunc(number);
  if (number < 0) throw new RangeError("factorial() requires a non-negative number");
  let result = 1;
  for (let i = 2; i <= number; i++) result *= i;
  return result;
}
--
floor
function floor(value) {
  return Math.floor(value);
}
--
square_root
function square_root(value) {
  return Math.sqrt(value);
}
--
absolute_value
function absolute_value(value) {
  return Math.abs(value);
}
--
list_add_element
function list_add_element(list, value) {
  list.push(value);
  return list;
}
--
list_remove_element
function list_remove_element(list, index) {
  list.splice(index, 1);
  return list;
}
--
list_set_at_index
function list_set_at_index(list, index, value) {
  while (list.length <= index) list.push(null);
  list[index] = value;
  return list;
}
--
list_swap_elements
function list_swap_elements(list, first, second) {
  [list[first], list[second]] = [list[second], list[first]];
  return list;
}
--
list_slice
function list_slice(list, start, end) {
  return list.slice(start, end);
}
--
map_create_ordered
function map_create_ordered(...pairs) {
  const result = {};
  for (const pair of pairs) result[pair[0]] = pair[1];
  return result;
}
--
map_contains
function map_contains(map, key) {
  return Object.prototype.hasOwnProperty.call(map, key);
}
--
map_get_keys
function map_get_keys(map) {
  return Object.keys(map).map(key => /^-?\d+(?:\.\d+)?$/.test(key) ? Number(key) : key);
}
--
string_contains
function string_contains(text, part) {
  return String(text).includes(String(part));
}
--
string_get_length
function string_get_length(text) {
  return [...String(text)].length;
}
--
string_get_substring
function string_get_substring(text, start, length) {
  return String(text).substring(start, start + length);
}
--
string_split
function string_split(text, delimiter) {
  return String(text).split(String(delimiter));
}
--
string_to_lowercase
function string_to_lowercase(text) {
  return String(text).toLowerCase();
}
--
string_to_uppercase
function string_to_uppercase(text) {
  return String(text).toUpperCase();
}
--
string_compare
function string_compare(left, right) {
  const result = String(left).localeCompare(String(right));
  return result < 0 ? -1 : result > 0 ? 1 : 0;
}
--
character_to_integer
function character_to_integer(value) {
  return String(value).codePointAt(0);
}
--
integer_to_character
function integer_to_character(value) {
  return String.fromCodePoint(Math.trunc(value));
}
--
value
function value(input) {
  if (typeof input === "number") return input;
  if (typeof input === "string" && input.trim() !== "" && !Number.isNaN(Number(input))) return Number(input);
  return 0;
}
--
max_integer
function max_integer() {
  return Number.MAX_SAFE_INTEGER;
}
--
throw_error
function throw_error(message) {
  throw new Error(zpeStringify(message));
}
--
print_error
function print_error(message) {
  console.error(zpeStringify(message));
}
--
_put
function _put(container, key, value) {
  if (arguments.length === 2 && Array.isArray(container)) container.push(key);
  else container[key] = value;
  return container;
}
--
_append
function _append(container, value) {
  container.push(value);
  return container;
}
