@macandersonuche/customeridurlmapperv1
v1.1.3
Published
CustomerID to URL Mapper
Readme
Utility Functions Module
This module provides two simple utility functions: getName and getAge. These functions return a formatted name string and calculate an adjusted age.
Functions
1. getName(name: string): string
This function takes a name as a string input and returns a formatted string.
Parameters:
name(string): The name you want to format.
Returns:
string: A message displaying the provided name.
Example:
const result = getName('Alice');
console.log(result); // Output: "Your name is: Alice"2. getAge(age: number): number
This function takes an age as a number and adds 10 to it.
Parameters:
age(number): The age to adjust.
Returns:
number: The age incremented by 10.
Example:
const adjustedAge = getAge(25);
console.log(adjustedAge); // Output: 35Usage
- Import the functions into your project:
import { getName, getAge } from './yourModulePath';- Use
getNameto format a name:
console.log(getName('John')); // Output: "Your name is: John"- Use
getAgeto calculate an adjusted age:
console.log(getAge(20)); // Output: 30License
This module is open source and available under the MIT License.
