@mciureanu/forge-library
v1.0.0
Published
A minimal TypeScript library for UiPath Studio Forge
Maintainers
Readme
Forge Library
A minimal TypeScript library for UiPath Studio Forge with utility functions for mathematical operations, string manipulation, and logging.
Installation
npm install @uipath/forge-libraryUsage
import { MathUtils, StringUtils, Logger } from '@uipath/forge-library';
// Math operations
const sum = MathUtils.add(5, 3); // 8
const product = MathUtils.multiply(4, 6); // 24
const factorial = MathUtils.factorial(5); // 120
// String operations
const capitalized = StringUtils.capitalize('hello world'); // 'Hello world'
const reversed = StringUtils.reverse('typescript'); // 'tpircsepyt'
const isPal = StringUtils.isPalindrome('racecar'); // true
// Logging
Logger.setLogLevel('debug');
Logger.info('Application started');
Logger.debug('Debug information');
Logger.warn('Warning message');
Logger.error('Error occurred');API Reference
MathUtils
add(a: number, b: number): number- Adds two numbersmultiply(a: number, b: number): number- Multiplies two numbersfactorial(n: number): number- Calculates factorial (throws error for negative numbers)
StringUtils
capitalize(str: string): string- Capitalizes first letterreverse(str: string): string- Reverses a stringisPalindrome(str: string): boolean- Checks if string is palindrome
Logger
setLogLevel(level: 'debug' | 'info' | 'warn' | 'error'): void- Sets log leveldebug(message: string): void- Logs debug messageinfo(message: string): void- Logs info messagewarn(message: string): void- Logs warning messageerror(message: string): void- Logs error message
License
MIT
