
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@chakra-ui/shared-utils
Advanced tools
@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.
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 } }
Lodash is a popular utility library that provides a wide range of functions for common programming tasks, such as manipulating arrays, objects, and functions. It offers more comprehensive functionality compared to @chakra-ui/shared-utils, but it is also larger in size.
Ramda is a functional programming library for JavaScript that emphasizes immutability and side-effect-free functions. It provides utilities for working with arrays, objects, and functions, similar to @chakra-ui/shared-utils, but with a focus on functional programming paradigms.
Underscore is a utility library that provides a range of functions for dealing with arrays, objects, and other data types. It is similar to Lodash but with a smaller footprint and fewer features. It offers some overlapping functionality with @chakra-ui/shared-utils.
A Quick description of the component
This is an internal utility, not intended for public usage.
yarn add @chakra-ui/shared-utils
# or
npm i @chakra-ui/shared-utils
Yes please! See the contributing guidelines for details.
This project is licensed under the terms of the MIT license.
FAQs
Did you know?
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.
Research
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.