feat: Add new message bubbles (#10481)
--------- Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
@@ -7,19 +7,23 @@ import snakecaseKeys from 'snakecase-keys';
|
||||
/**
|
||||
* Vue composable that converts object keys to camelCase
|
||||
* @param {Object|Array|import('vue').Ref<Object|Array>} payload - Object or array to convert
|
||||
* @param {Object} [options] - Options object
|
||||
* @param {boolean} [options.deep=false] - Should convert keys of nested objects
|
||||
* @returns {Object|Array} Converted payload with camelCase keys
|
||||
*/
|
||||
export function useCamelCase(payload) {
|
||||
export function useCamelCase(payload, options) {
|
||||
const unrefPayload = unref(payload);
|
||||
return camelcaseKeys(unrefPayload);
|
||||
return camelcaseKeys(unrefPayload, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Vue composable that converts object keys to snake_case
|
||||
* @param {Object|Array|import('vue').Ref<Object|Array>} payload - Object or array to convert
|
||||
* @param {Object} [options] - Options object
|
||||
* @param {boolean} [options.deep=false] - Should convert keys of nested objects
|
||||
* @returns {Object|Array} Converted payload with snake_case keys
|
||||
*/
|
||||
export function useSnakeCase(payload) {
|
||||
export function useSnakeCase(payload, options) {
|
||||
const unrefPayload = unref(payload);
|
||||
return snakecaseKeys(unrefPayload);
|
||||
return snakecaseKeys(unrefPayload, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user