6.2.0 • Published 3 years ago

just-extend v6.2.0

Weekly downloads
2,756,962
License
MIT
Repository
github
Last release
3 years ago

just-extend

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-extend
yarn add just-extend

Extend an object

import extend from 'just-extend';

var obj = {a: 3, b: 5};
extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
obj; // {a: 4, b: 5, c: 8}

var obj = {a: 3, b: 5};
extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
obj; // {a: 3, b: 5}

var arr = [1, 2, 3];
var obj = {a: 3, b: 5};
extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
arr.push(4);
obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}

var arr = [1, 2, 3];
var obj = {a: 3, b: 5};
extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
arr.push(4);
obj; // {a: 3, b: 5, c: [1, 2, 3]}

extend({a: 4, b: 5}); // {a: 4, b: 5}
extend({a: 4, b: 5}, 3); {a: 4, b: 5}
extend({a: 4, b: 5}, true); {a: 4, b: 5}
extend('hello', {a: 4, b: 5}); // throws
extend(3, {a: 4, b: 5}); // throws
nise@neggi/baseui@iobroker-community-adapters/iobroker.device-watcher@heights/heights-ui@everything-registry/sub-chunk-1995@miracle-box/flintsveltify-cmswinx-form-winxw3c-design-tokenswx-http-middlewarek0mmand3rhttp-queue-middlewarehw9i18n-auto-translationi18n-auto-translation-msnyderi18n-ai-translationgulp-pottopogridder-jsgulp-uf-bundle-assetslionecslodown-rayford-smith@vendure/admin-ui@vendure.ecommerce/admin-ui@types/just-extend@tokens-studio/plugin-library@userfrosting/browserify-dependencies@userfrosting/gulp-bundle-assets@vuico/vuic@uponcommerce/admin-ui@yhostc/nodejs-translate-api@yonah-mozaic/jammber_mozaic_api@zalastax/nolb-jusallapisaxios-yet-another-proxy-fixapp-audiogenerator-sventecheleventy-plugin-iconsdotex-plugindropzonedropzone-jimmyembed-plugin-baseembed-plugin-emojiembed-plugin-facebookembed-plugin-githubembed-plugin-mapembed-plugin-mediaembed-plugin-noembedembed-plugin-twitterembed-plugin-urlembed-plugin-url-linkifyjsembed-plugin-utilitiesembed-plugin-youtubeembed-preset-basicembed-jsembed-plugin-highlightembed-plugin-instagrameleventy-plugin-validateember-deep-buffered-proxyfigma-tokens-libraryfixed_form_buildercl-toolcoppicedcd-scenebaseuibaseuitestbaseui-omsbaseui-sddotenv-coressh2-keeper@astro-my/sign-requestwavearea@infinitebrahmanuniverse/nolb-jus@shopness/admin-uimpd-parser-1mobx-form-storeminiapp-basepath-middlewareminiapp-request-middlewareminiapp-token-based-loginminiapp-login-middlewaremermalowt-client-javascriptoffdjsprofb-jsclientsearchbox-clisemantic-release-gitmoji-actionsettings-panelneulib-reactnise_forknodysseuspolypackagepramarequest-queue-middlewarequerystring-jsonredux-standard-reducersgqty@kgit/readability@kgit/readbility@nowmade/sveltify-cms@nexo-stack/cli@shoplyjs/admin-ui
6.2.0

3 years ago

6.1.0

3 years ago

6.1.1

3 years ago

6.0.1

4 years ago

6.0.0

4 years ago

5.1.1

4 years ago

5.1.0

4 years ago

5.0.0

4 years ago

4.2.1

5 years ago

4.2.0

5 years ago

4.1.1

5 years ago

4.1.0

6 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.0.0

7 years ago

2.1.0

7 years ago

1.1.27

8 years ago

1.1.26

8 years ago

1.1.25

8 years ago

1.1.24

8 years ago

1.1.23

8 years ago

1.1.22

9 years ago

1.1.21

9 years ago

1.1.20

9 years ago

1.1.19

9 years ago

1.1.18

9 years ago

1.1.17

9 years ago

1.1.16

9 years ago

1.1.15

10 years ago

1.1.10

10 years ago

1.1.9

10 years ago

1.1.8

10 years ago

1.1.7

10 years ago

1.1.5

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

1.0.1

10 years ago