utils
Utility functions and constants.
📦 Overview
What it does
This library provides utility functions and constants for libraries. These functions & constants usually have a global context, and could be used in any applications & libraries.
Note on niche functions & constants
Utility functions & constants specific to an app or library should be specified in the respective
app or library's lib
directory. This library is only used for globally usable functions.
Key Features
- Allows for global usage of utility functions & constants
- Write unit tests just once
How to use
Basic Usage Example
Simply import the functions you need and use them:
📖 API Reference
getBaseUrl
- Description: Gets the base URL of the window.
- Return Type: string
Error Handling
Errors should be handled within the functions themself. The library does not perform any additional error handling or manipulation on top of the provided functions.
🛠️ Commands
View all commands
To view all commands from the library's project.json
, package.json
and inheritted:
Focus library usage
To view/focus on all the apps & libraries which use this library:
📝 Contributing
Best Practices
Code Formatting
Implement your functions in identifiable files.
The library should be linted without any errors:
Testing
To run tests for this library:
❓ FAQs
How can I add a new function/constant?
Write it in an existing library file or
create a file of your own. Make sure to export
the function/constant,
and follow function definition guidelines.
Last updated on