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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i create-object-and-assign

Weekly Downloads

0

Version

0.1.1

License

ISC

Unpacked Size

3.93 kB

Total Files

5

Last publish

Collaborators

  • mk-pmb