Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chakra-ui/shared-utils

Package Overview
Dependencies
Maintainers
3
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/shared-utils

A Quick description of the component

  • 2.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

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

Keywords

FAQs

Package last updated on 26 Dec 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc