;
;
;
;
/**
* clone : a -> a
*
* Returns a clone of a value.
* @function
* @template a
* @param {a} value - Value to be cloned.
* @returns {a} Cloned value
* @function
* @see {@link https://lodash.com/docs/#cloneDeep|Lodash}
* @see {@link https://stackoverflow.com/a/54157459|StackOverflow}
* @see {@link https://stackoverflow.com/a/53737490|StackOverflow}
* @see {@link https://stackoverflow.com/a/24648941|StackOverflow}
*/
;
/**
* @description Returns an updated object.
* @param {Object} object_arguments - Contains the arguments for the function.
* @template a
* @param {a} object_arguments.object_original - The original object.i
* @param {Object} object_arguments.object_properties_new - An object whose properties will be used to replace those of the original in the new object to be returned.
* @returns {a} The updated object.
* @todo Make this more functional. Maybe use `entries`, `fromEntries`, `map`, `reduce`, `any_while`.
*/
;
/**
* @description Returns an array of strings that match all or of the regular expression objects specified.
* @param {Object} object_arguments - Contains the arguments for the function.
* @param {string[]} object_arguments.array_strings - Contains the strings to check.
* @param {Object[]} object_arguments.array_regexes - Contains regular expression objects that the strings will be checked against.
* @param {boolean} object_arguments.boolean_all - Whether or not the strings should match all or some of the regular expressions.
* @returns {string[]} Contains the strings that match all or some of the regular expression.
*/
0 === r
? s
: s
.;
/**
* @description A unary function that returns a boolean.
* @callback UnaryBoolean
* @param {any} state - The state.
* @returns {boolean}
*/
/**
* @description A unary function whose output is the same type as its input.
* @callback UnaryGeneric
* @template a
* @param {a} input
* @returns {a}
*/
/**
* @description Recurses while a condition is true. Not stack-safe.
* @param {Object} object_arguments - Contains the arguments for the function.
* @template a
* @param {a} object_arguments.any_state - The state to process.
* @param {UnaryBoolean} object_arguments.boolean_condition - Processes state to determine whether or not to recurse.
* @param {UnaryGeneric} object_arguments.any_function - Processes state.
* @returns {a} The output.
* @todo Make this stack-safe by using trampoline?
*/
?
: s;
/**
* @description Runs a function a certain number of times.
* @param {Object} object_arguments - Contains the arguments for the function.
* @param {function} object_arguments.any_function - The function to apply on the state.
* @param {Object} object_arguments.object_state - The initial state.
* @param {number} object_arguments.integer_repeats - The amount of repetitions.
* @param {string} object_arguments.string_property_counter - The name of the property to store the count of repetitions.
* @example
* const object_plus_two = (object_integer) => ({
* any_output: object_integer.any_output + 2,
* });
*
* export const main = async (object_netscript) => {
* object_netscript.tprint(`Output was: ${any_repeat({
* object_state: { any_output: 0, },
* any_function: object_plus_two,
* integer_repeats: 10,
* }).any_output}.`); // Output was: 20
* };
*/
;
/**
* @description Returns `true` if a value is a string, otherwise returns `false`.
* @param {any} any_value - Value to check.
* @returns `true` if input is a string, otherwise `false.
* @see {@link https://lodash.com/docs/#isString|Lodash}
* @see {@link https://raw.githubusercontent.com/lodash/lodash/4.0.1-npm-packages/lodash.isstring/index.js|Github}
* @license MIT
*/
;
/**
* @description Returns an array of server objects.
* @param {Object} object_arguments - Contains the arguments for the function.
* @param {Object} object_arguments.object_netscript - The Netscript environment.
* @param {function} object_arguments.array_method_get_servers - The function to use to get the array of server names.
* @param {function} object_arguments.object_method_make_server - The function to use to generate objects from the server names.
* @returns {Object[]} The generated array of server objects.
*/
.;
/**
* @description Clamps a value within the inclusive range specified by boundary values. If the value falls within the range, returns it. Otherwise, returns the nearest value in the range.
* @function
* @param {Object} object_arguments - Contains the arguments for the function.
* @param {number} object_arguments.value The value to clamp.
* @param {number} object_arguments.lower The inclusive lower bound of the range.
* @param {number} object_arguments.upper The inclusive upper bound of the range.
* @returns {number} The clamped value.
*/
.;
/**
* @description Returns a string with characters converted to their HTML equivalents.
* @param {string} string - String to sanitise.
* @returns {string} The sanitised string.
* @see {@link https://stackoverflow.com/a/30376762|StackOverflow}
*/
;
/**
* @description Parses arguments.
* @param {Object} object_arguments - Contains the arguments for the function.
* @param {string[]} object_arguments.array_arguments - Array of arguments.
* @param {Object} [object_arguments.object_options] - Options set for the arguments.
* @returns {Object} Object populated with the parsed arguments.
* @see {@link https://github.com/lukeed/mri/blob/dda3343b92b2d96facafaa38f1e55bd1bcbaf7fc/src/index.js|GitHub}
* @see {@link https://github.com/substack/minimist/|GitHub}
* @see {@link https://github.com/ethanent/gar|GitHub}
* @see {@link https://github.com/yargs/yargs-parser|GitHub}
*/
;