6.2.0 • Published 2 years ago

just-extend v6.2.0

Weekly downloads
2,756,962
License
MIT
Repository
github
Last release
2 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-middleware@dotconf-pro/dotconf-pro@dotconf-pro/dotenv@crespire/dropzonek0mmand3rssh2-keeper@astro-my/sign-request@alam.santiko/blog-jmk@alpacahq/alpaca-trade-api@awinogrodzki/embed-js@awinogrodzki/embed-plugin-utilities@awinogrodzki/embed-plugin-youtube@babbel/rollbar-client.js@bearclaw/immutable-class@bb-vendure/admin-ui@clcorp/react-ui@bento-editor/corewavearea@educandu/dev-tools@emerson-eps/cypress-image-snapshot@gasket/react-intl@fusion-ui/baseweb@infinitebrahmanuniverse/nolb-jus@nexo-stack/cli@netuno/auth-client@netuno/service-client@netuno/ws-client@neeschit/alpaca-trade-api@fabwcie/ckeditor5-preview@miksu/baseui@meta-cms/core@modular-css/css-to-js@jay-es/just-all@johnhamlin/redux-persist@kgit/readability@hieuquang2212/form@offirgolan/nise@olofd/gqty@pyro-ui/components@saasak/utils-env@nowmade/sveltify-cms@parkcedar/leaflet@shopness/admin-ui@rill/refresh-withmpd-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-reducersgqtyhttp-queue-middlewarehw9i18n-auto-translationi18n-auto-translation-msnyderi18n-ai-translationgulp-pottopogridder-jsgulp-uf-bundle-assetslionecslodown-rayford-smithcl-toolcoppicedotex-plugindropzonedotenv-coredropzone-jimmydcd-sceneembed-jsembed-preset-basicembed-plugin-baseembed-plugin-emojiembed-plugin-facebookembed-plugin-githubembed-plugin-highlightembed-plugin-instagram
6.2.0

2 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

4 years ago

4.2.0

4 years ago

4.1.1

5 years ago

4.1.0

5 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

9 years ago

1.1.10

9 years ago

1.1.9

9 years ago

1.1.8

9 years ago

1.1.7

9 years ago

1.1.5

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

1.0.1

9 years ago