Skip to content

Latest commit

 

History

History
197 lines (156 loc) · 5.37 KB

README.CN.md

File metadata and controls

197 lines (156 loc) · 5.37 KB

@13OnTheCode/Utils

JavaScript

Version License

English | 简体中文

JavaScript/TypeScript 实用工具集

Features

  • 零依赖 (zero-dependency)
  • 可摇树 (tree-shakable)

Prerequisites

Node.js

  • 版本 >= 16.0.0
  • ESM 项目

Install

npm install @13onthecode/utils --save-dev

Usage

import { mergeObject } from '@13onthecode/utils'

const foo = {
  foo: 'foo',
  other: {
    foo: 'foo'
  }
}

const bar = {
  bar: 'bar',
  other: {
    bar: 'bar'
  }
}

const merged = mergeObject(foo, bar)

// => {
//   foo: "foo"
//   bar: "bar"
//   other: {
//       bar: 'bar'
//   }
// }

const deepMerged = mergeObject(foo, bar, { mode: 'deep' })

// => {
//   foo: "foo"
//   bar: "bar"
//   other: {
//       foo: "foo"
//       bar: "bar"
//   }
// }

API

Array

Collocation

Guard

Map

Node

Object

Runtime

Set

String

Check Also

License

MIT License © 2023-PRESENT 13OnTheCode