create-object-and-assign

0.1.1 • Public • Published

create-object-and-assign

(p, ...a) → Object.assign(Object.create(p), ...a)

  • Exactly what is says on the tin. ( is not =>)
  • No shenanigans.
  • No polyfills. (If you want them, try npm:create-assign instead.)

API

This module exports one function:

function crObAss(p, ...a) { return Object.assign(Object.create(p), ...a); }
module.exports = crObAss;

Usage

see test/usage.mjs

import crObAss from 'create-object-and-assign';

Known issues

  • Needs more/better tests and docs.

 

License

ISC

Package Sidebar

Install

npm i create-object-and-assign

Weekly Downloads

1

Version

0.1.1

License

ISC

Unpacked Size

3.93 kB

Total Files

5

Last publish

Collaborators

  • mk-pmb