Socket
Socket
Sign inDemoInstall

@chakra-ui/shared-utils

Package Overview
Dependencies
0
Maintainers
3
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/shared-utils


Version published
Maintainers
3
Created

Package description

What is @chakra-ui/shared-utils?

@chakra-ui/shared-utils is a utility package that provides shared utility functions and constants used across various Chakra UI components. It helps in maintaining consistency and reducing code duplication within the Chakra UI library.

What are @chakra-ui/shared-utils's main functionalities?

isFunction

The `isFunction` utility checks if a given value is a function. This is useful for type-checking and ensuring that certain operations are only performed on functions.

const { isFunction } = require('@chakra-ui/shared-utils');

console.log(isFunction(() => {})); // true
console.log(isFunction(123)); // false

isObject

The `isObject` utility checks if a given value is a plain object. This helps in validating inputs and ensuring that operations meant for objects are not mistakenly applied to other types.

const { isObject } = require('@chakra-ui/shared-utils');

console.log(isObject({})); // true
console.log(isObject(null)); // false

mergeWith

The `mergeWith` utility merges two objects deeply, combining their properties. This is useful for combining configuration objects or state objects in a predictable manner.

const { mergeWith } = require('@chakra-ui/shared-utils');

const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { b: { d: 3 } };
const result = mergeWith(obj1, obj2);
console.log(result); // { a: 1, b: { c: 2, d: 3 } }

Other packages similar to @chakra-ui/shared-utils

Readme

Source

@chakra-ui/shared-utils

A Quick description of the component

This is an internal utility, not intended for public usage.

Installation

yarn add @chakra-ui/shared-utils
# or
npm i @chakra-ui/shared-utils

Contribution

Yes please! See the contributing guidelines for details.

Licence

This project is licensed under the terms of the MIT license.

Keywords

FAQs

Last updated on 08 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc