Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
A JavaScript utility library that provides a whole mess of useful helper functions and supports modularity.
kitify
(kit + ify
) is a JavaScript utility library that provides a whole mess of useful helper functions and supports modularity.
kitify
是一个 JavaScript 工具函数包,它提供了一大堆有用的辅助工具函数, 并支持模块化。
npm install kitify
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 }
Provides some methods for interpreting data types.
Method | Description |
---|---|
isType | Check if the value is of the specified type. |
isObject | Check if the value is an object. |
isFunction | Check if the value is a function. |
isString | Check if the value is a string. |
isNumber | Check if the value is a number. |
isBoolean | Check if the value is a boolean. |
isArray | Check if the value is an array. |
isSymbol | Check if the value is a symbol. |
isUndefined | Check if the value is undefined. |
isNull | Check if the value is null. |
isBigInt | Check if the value is a BigInt. |
isNil | Check if the value is null or undefined. |
isEmpty | Check if the value is empty. |
isInvalid | Check if the value is invalid. |
Collection related utility functions
Method | Description |
---|---|
clone | Deep copy of the value. |
cloneDeep | Deep copy of the value. Supports Map,Set,ArrayBuffer... |
cloneLoop | Loop deep copy of the value. |
cloneJSON | JSON deep copy of the value. |
Object related utility functions
Method | Description |
---|---|
assign | Merge objects into a new object. |
Processing data related utility functions
Method | Description |
---|---|
listToTree | Convert list to tree. |
treeToList | Convert tree to list. |
Color related utility functions
Method | Description |
---|---|
isHexColor | Check if the value is a hex color. |
isRgbColor | Check if the value is a rgb color. |
isHslColor | Check if the value is a hsl color. |
isDarkColor | Check if the color is dark. |
isLightColor | Check if the color is light. |
hexToRgb | Convert hex color to rgb. |
rgbToHex | Convert rgb color to hex. |
colorRGB | Convert color to [R,G,B] . |
setColorOpacity | Set the opacity of the color. |
setColorBrightness | Set the brightness of the color. |
darkenColor | Darken the color. |
lightenColor | Lighten the color. |
mixColors | Mix two colors. |
colorComplementary | Get the complementary color. |
colorLuminance | Get the luminance of the color. |
colorContrast | Get the contrast of the color. |
DOM related utility functions
Method | Description |
---|---|
detectMouseDirection | Detect mouse movement direction in element. |
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
v0.5.3
FAQs
A JavaScript utility library that provides a whole mess of useful helper functions and supports modularity.
We found that kitify demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.