This file contains hidden or 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
| <!--- | |
| STRINGTRUNCATE Function | |
| Description: Intelligently truncates a string to a specified length while preserving word boundaries. | |
| Can add ellipsis or custom suffix, and optionally truncate from different positions (start, middle, end). | |
| Parameters: | |
| - text: The text to truncate (required) | |
| - maxLength: Maximum length of the result including suffix (required) | |
| - suffix: String to append when truncated (optional, default: "...") |
This file contains hidden or 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
| ColdFusion implementation of set operations utility - Provides union, intersection, difference, and other mathematical set operations on arrays | |
| <!--- | |
| SETOPERATIONS Function | |
| Description: Provides utility methods for performing mathematical set operations on arrays without | |
| needing to create set objects. Includes union, intersection, difference, and other common set operations | |
| that work directly with arrays. | |
| Parameters: None - returns an object with set operation methods |
This file contains hidden or 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
| ColdFusion implementation of string slug generator - Creates URL-safe slugs from text with support for accented characters, custom separators, and max length | |
| <!--- | |
| STRINGSLUG Function | |
| Description: Generates a URL-safe slug from a string by converting to lowercase, replacing spaces | |
| with hyphens, removing special characters, and handling accented characters. Similar to slug | |
| generation in Django or other web frameworks. | |
| Parameters: |
This file contains hidden or 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
| <!--- | |
| UNIQUESET Function | |
| Description: Creates a set data structure that stores only unique values, similar to Python's set() | |
| or JavaScript's Set(). Automatically prevents duplicates and provides set operations like union, | |
| intersection, and difference. | |
| Parameters: | |
| - initialData: Optional data to initialize the set (array, string, or delimited list) (optional) | |
| - delimiter: If initialData is a string, the delimiter to split on (optional, default: ",") |
This file contains hidden or 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
| <!--- | |
| FILENAMESPLIT Function | |
| Description: Splits a filename into base name and extension. The extension is everything from the | |
| last dot to the end, including the dot. Special cases like hidden files (.bashrc) are handled correctly. | |
| Parameters: | |
| - path: The file path or filename to split (required) | |
| Returns: Array with two elements [basename, extension] |
This file contains hidden or 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
| <!--- | |
| ORDEREDSTRUCT Function | |
| Description: Creates a struct that maintains the insertion order of keys, similar to Python's OrderedDict. | |
| Regular ColdFusion structs don't guarantee key order, but this function preserves the order in which | |
| keys were added for predictable iteration and JSON serialization. | |
| Parameters: | |
| - initialData: Optional struct to pre-populate the ordered struct (optional) | |
This file contains hidden or 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
| <!--- | |
| DEFAULTDICT Function | |
| Description: Creates a struct wrapper that returns a default value for non-existent keys, similar to | |
| Python's collections.defaultdict. When accessing a key that doesn't exist, it automatically creates | |
| that key with the default value and returns it. | |
| Parameters: | |
| - defaultValue: The default value to return/set for missing keys (required) | |
| - initialData: Optional struct to pre-populate the defaultdict (optional) |
This file contains hidden or 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
| <!--- | |
| PATHEXISTS Function | |
| Description: Checks if a path exists (either as a file or directory), similar to Python's os.path.exists(). This is a convenience function that combines fileExists() and directoryExists() into a single check. | |
| Parameters: | |
| - path: The path to check (required) | |
| Returns: Boolean - true if the path exists as either a file or directory, false otherwise | |
This file contains hidden or 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
| <!--- | |
| SETDEFAULT Function | |
| Description: Sets a key to a default value if the key doesn't exist in the struct, similar to Python's dict.setdefault(). If the key already exists, returns the existing value without modification. If the key doesn't exist, sets it to the default value and returns that value. | |
| Parameters: | |
| - struct: The struct to check and potentially modify (required, modified in place) | |
| - key: The key to check/set (required) | |
| - defaultValue: Value to set if key doesn't exist (required) | |
This file contains hidden or 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
| <!--- | |
| POP Function | |
| Description: Removes a key from a struct and returns its value, similar to Python's dict.pop(). If the key doesn't exist, returns the default value or throws an error if no default is provided. | |
| Parameters: | |
| - struct: The struct to remove the key from (required, modified in place) | |
| - key: The key to remove (required) | |
| - defaultValue: Value to return if key doesn't exist (optional) | |
NewerOlder