TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/feathersjs/feathers/llms.txt
Use this file to discover all available pages before exploring further.
@feathersjs/commons package provides a collection of utility functions and helpers that are used throughout the Feathers ecosystem. These utilities offer lightweight alternatives to lodash-style operations and common JavaScript patterns.
Installation
String Utilities
stripSlashes
Removes all leading and trailing slashes from a path string.The string to strip slashes from
The string with leading and trailing slashes removed
Object Utilities
The_ object provides a collection of utility functions for working with objects and arrays.
_.each
Iterates over an object or array and executes a callback for each element.The object or array to iterate over
Function called for each element with value and key/index
_.some
Tests whether at least one element passes the test implemented by the callback.The object to test
Function to test each element
True if at least one element passes the test, false otherwise
_.every
Tests whether all elements pass the test implemented by the callback.The object to test
Function to test each element
True if all elements pass the test, false otherwise
_.keys
Returns an array of the object’s keys.The object to extract keys from
Array of object keys
_.values
Returns an array of the object’s values.The object to extract values from
Array of object values
_.isMatch
Checks if all properties in the item object match those in the source object.The source object to check against
The object with properties to match
True if all item properties match obj properties
_.isEmpty
Checks if an object has no properties.The object to check
True if the object has no keys
_.isObject
Checks if a value is a plain object (not an array or null).The value to check
True if the value is a plain object
_.isObjectOrArray
Checks if a value is an object or array (not null).The value to check
True if the value is an object or array
_.extend
Shallow merges multiple objects into the first object.The target object to extend
Additional objects to merge into the target
The extended target object
_.omit
Creates a new object with specified keys removed.The source object
Keys to omit from the result
New object without the specified keys
_.pick
Creates a new object with only the specified keys.The source object
Keys to include in the result
New object with only the specified keys
_.merge
Recursively merges the source object into the target object.The target object to merge into
The source object to merge from
The merged target object
Promise Utilities
isPromise
Duck-checks if an object looks like a promise.The value to check
True if the value has a then method
Symbol Utilities
createSymbol
Creates a symbol usingSymbol.for() if available, otherwise returns the string.
The name for the symbol
A symbol created with Symbol.for(), or the name string if Symbol is unavailable
Debug Utilities
createDebug
Creates a debug function for a specific namespace.The namespace for the debug function
A debug function for the specified namespace
setDebug
Sets a custom debug initializer for all debug instances.The debug initializer function
noopDebug
A no-operation debug function that does nothing.A function that does nothing when called