Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacobbubu/xtend
https://github.com/jacobbubu/xtend
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jacobbubu/xtend
- Owner: jacobbubu
- License: mit
- Created: 2019-12-28T12:29:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T03:49:03.000Z (about 2 years ago)
- Last Synced: 2024-12-12T23:46:16.296Z (about 2 months ago)
- Language: TypeScript
- Homepage:
- Size: 2.07 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# @jacobbubu/xtend
[![Build Status](https://travis-ci.org/jacobbubu/xtend.svg)](https://travis-ci.org/jacobbubu/xtend)
[![Coverage Status](https://coveralls.io/repos/github/jacobbubu/xtend/badge.svg)](https://coveralls.io/github/jacobbubu/xtend)
[![npm](https://img.shields.io/npm/v/@jacobbubu/xtend.svg)](https://www.npmjs.com/package/@jacobbubu/xtend/)> Rewritten [xtend](https://github.com/Raynos/xtend) in typescript for learning purpose.
## Examples
```js
import { extend, mutableExtend } from '@jacobbubu/xtend'// extend returns a new object. Does not mutate arguments
const combination = extend(
{
a: 'a',
b: 'c'
},
{
b: 'b'
}
)
// combination = { a: "a", b: "b" }// mutate argument in-place
const a = { foo: 'bar' }
mutableExtend(a, { bar: 'baz' })
// a.bar = 'baz'
```