New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kitify

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kitify

A JavaScript utility library that provides a whole mess of useful helper functions and supports modularity.

  • 0.5.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

kitify

version CI status codecov downloads size browsers

kitify (kit + ify) is a JavaScript utility library that provides a whole mess of useful helper functions and supports modularity.

kitify 是一个 JavaScript 工具函数包,它提供了一大堆有用的辅助工具函数, 并支持模块化。

Installation

npm install kitify

Usage

import { isType, clone } from 'kitify'
// or
import isType from 'kitify/isType'
import clone from 'kitify/clone'

isType(123) // 'number'
isType('hello', 'string') // true
clone({ a: 1, b: 2 }) // { a: 1, b: 2 }

API

Type

Provides some methods for interpreting data types.

MethodDescription
isTypeCheck if the value is of the specified type.
isObjectCheck if the value is an object.
isFunctionCheck if the value is a function.
isStringCheck if the value is a string.
isNumberCheck if the value is a number.
isBooleanCheck if the value is a boolean.
isArrayCheck if the value is an array.
isSymbolCheck if the value is a symbol.
isUndefinedCheck if the value is undefined.
isNullCheck if the value is null.
isBigIntCheck if the value is a BigInt.
isNilCheck if the value is null or undefined.
isEmptyCheck if the value is empty.
isInvalidCheck if the value is invalid.

Collection

Collection related utility functions

MethodDescription
cloneDeep copy of the value.
cloneDeepDeep copy of the value. Supports Map,Set,ArrayBuffer...
cloneLoopLoop deep copy of the value.
cloneJSONJSON deep copy of the value.

Object

Object related utility functions

MethodDescription
assignMerge objects into a new object.

Data

Processing data related utility functions

MethodDescription
listToTreeConvert list to tree.
treeToListConvert tree to list.

Color

Color related utility functions

MethodDescription
isHexColorCheck if the value is a hex color.
isRgbColorCheck if the value is a rgb color.
isHslColorCheck if the value is a hsl color.
isDarkColorCheck if the color is dark.
isLightColorCheck if the color is light.
hexToRgbConvert hex color to rgb.
rgbToHexConvert rgb color to hex.
colorRGBConvert color to [R,G,B].
setColorOpacitySet the opacity of the color.
setColorBrightnessSet the brightness of the color.
darkenColorDarken the color.
lightenColorLighten the color.
mixColorsMix two colors.
colorComplementaryGet the complementary color.
colorLuminanceGet the luminance of the color.
colorContrastGet the contrast of the color.

DOM

DOM related utility functions

MethodDescription
detectMouseDirectionDetect mouse movement direction in element.

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Keywords

FAQs

Package last updated on 08 Jan 2025

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