codeql-action/node_modules/just-extend
dependabot[bot] b1bd8da5e7
Bump the npm group with 3 updates (#2303)
* ---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-20 12:17:29 -07:00
..
CHANGELOG.md Bump the npm group with 3 updates (#2303) 2024-05-20 12:17:29 -07:00
LICENSE Add sinon package for mocking 2020-06-24 14:34:08 +01:00
README.md Bump the npm group with 3 updates (#2303) 2024-05-20 12:17:29 -07:00
index.cjs Bump the npm group with 3 updates (#2303) 2024-05-20 12:17:29 -07:00
index.d.ts Bump the npm group with 3 updates (#2303) 2024-05-20 12:17:29 -07:00
index.mjs Bump the npm group with 3 updates (#2303) 2024-05-20 12:17:29 -07:00
index.tests.ts Bump the npm group with 3 updates (#2303) 2024-05-20 12:17:29 -07:00
package.json Bump the npm group with 3 updates (#2303) 2024-05-20 12:17:29 -07:00
rollup.config.js Bump the npm group with 3 updates (#2303) 2024-05-20 12:17:29 -07:00

README.md

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