@macandersonuche/customeridurlmapperv1
v1.1.3
Published
CustomerID to URL Mapper
Downloads
7
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: 35
Usage
- Import the functions into your project:
import { getName, getAge } from './yourModulePath';
- Use
getName
to format a name:
console.log(getName('John')); // Output: "Your name is: John"
- Use
getAge
to calculate an adjusted age:
console.log(getAge(20)); // Output: 30
License
This module is open source and available under the MIT License.