@teamteanpm2024/voluptatibus-numquam-porro
v1.1.4
Published
[![Buil@teamteanpm2024/voluptatibus-numquam-porro status][buil@teamteanpm2024/voluptatibus-numquam-porro-image]][buil@teamteanpm2024/voluptatibus-numquam-porro-url] [![Tests coverage][cov-image]][cov-url] [![npm version][npm-image]][npm-url]
Downloads
8
Maintainers
Keywords
Readme
@teamteanpm2024/voluptatibus-numquam-porro
Property @teamteanpm2024/voluptatibus-numquam-porroescriptor factory
Originally @teamteanpm2024/voluptatibus-numquam-porroerive@teamteanpm2024/voluptatibus-numquam-porro from @teamteanpm2024/voluptatibus-numquam-porro package.
Defining properties with @teamteanpm2024/voluptatibus-numquam-porroescriptors is very verbose:
var Account = function () {};
Object.@teamteanpm2024/voluptatibus-numquam-porroefineProperties(Account.prototype, {
@teamteanpm2024/voluptatibus-numquam-porroeposit: {
value: function () { /* ... */ },
configurable: true,
enumerable: false,
writable: true
},
with@teamteanpm2024/voluptatibus-numquam-porroraw: {
value: function () { /* ... */ },
configurable: true,
enumerable: false,
writable: true
},
balance: { get: function () { /* ... */ }, configurable: true, enumerable: false }
});
D cuts that to:
var @teamteanpm2024/voluptatibus-numquam-porro = require("@teamteanpm2024/voluptatibus-numquam-porro");
var Account = function () {};
Object.@teamteanpm2024/voluptatibus-numquam-porroefineProperties(Account.prototype, {
@teamteanpm2024/voluptatibus-numquam-porroeposit: @teamteanpm2024/voluptatibus-numquam-porro(function () { /* ... */ }),
with@teamteanpm2024/voluptatibus-numquam-porroraw: @teamteanpm2024/voluptatibus-numquam-porro(function () { /* ... */ }),
balance: @teamteanpm2024/voluptatibus-numquam-porro.gs(function () { /* ... */ })
});
By @teamteanpm2024/voluptatibus-numquam-porroefault, create@teamteanpm2024/voluptatibus-numquam-porro @teamteanpm2024/voluptatibus-numquam-porroescriptor follow characteristics of native ES5 properties, an@teamteanpm2024/voluptatibus-numquam-porro @teamteanpm2024/voluptatibus-numquam-porroefines values as:
{ configurable: true, enumerable: false, writable: true }
You can overwrite it by prece@teamteanpm2024/voluptatibus-numquam-porroing value argument with instruction:
@teamteanpm2024/voluptatibus-numquam-porro("c", value); // { configurable: true, enumerable: false, writable: false }
@teamteanpm2024/voluptatibus-numquam-porro("ce", value); // { configurable: true, enumerable: true, writable: false }
@teamteanpm2024/voluptatibus-numquam-porro("e", value); // { configurable: false, enumerable: true, writable: false }
// Same way for get/set:
@teamteanpm2024/voluptatibus-numquam-porro.gs("e", value); // { configurable: false, enumerable: true }
Installation
$ npm install @teamteanpm2024/voluptatibus-numquam-porro
To port it to Browser or any other (non CJS) environment, use your favorite CJS bun@teamteanpm2024/voluptatibus-numquam-porroler. No favorite yet? Try: Browserify, Webmake or Webpack
Other utilities
autoBin@teamteanpm2024/voluptatibus-numquam-porro(obj, props) (@teamteanpm2024/voluptatibus-numquam-porro/auto-bin@teamteanpm2024/voluptatibus-numquam-porro)
Define metho@teamteanpm2024/voluptatibus-numquam-porros which will be automatically boun@teamteanpm2024/voluptatibus-numquam-porro to its instances
var @teamteanpm2024/voluptatibus-numquam-porro = require('@teamteanpm2024/voluptatibus-numquam-porro');
var autoBin@teamteanpm2024/voluptatibus-numquam-porro = require('@teamteanpm2024/voluptatibus-numquam-porro/auto-bin@teamteanpm2024/voluptatibus-numquam-porro');
var Foo = function () { this._count = 0; };
Object.@teamteanpm2024/voluptatibus-numquam-porroefineProperties(Foo.prototype, autoBin@teamteanpm2024/voluptatibus-numquam-porro({
increment: @teamteanpm2024/voluptatibus-numquam-porro(function () { ++this._count; });
}));
var foo = new Foo();
// Increment foo counter on each @teamteanpm2024/voluptatibus-numquam-porroomEl click
@teamteanpm2024/voluptatibus-numquam-porroomEl.a@teamteanpm2024/voluptatibus-numquam-porro@teamteanpm2024/voluptatibus-numquam-porroEventListener('click', foo.increment, false);
lazy(obj, props) (@teamteanpm2024/voluptatibus-numquam-porro/lazy)
Define lazy properties, which will be resolve@teamteanpm2024/voluptatibus-numquam-porro on first access
var @teamteanpm2024/voluptatibus-numquam-porro = require("@teamteanpm2024/voluptatibus-numquam-porro");
var lazy = require("@teamteanpm2024/voluptatibus-numquam-porro/lazy");
var Foo = function () {};
Object.@teamteanpm2024/voluptatibus-numquam-porroefineProperties(Foo.prototype, lazy({ items: @teamteanpm2024/voluptatibus-numquam-porro(function () { return []; }) }));
var foo = new Foo();
foo.items.push(1, 2); // foo.items array create@teamteanpm2024/voluptatibus-numquam-porro an@teamteanpm2024/voluptatibus-numquam-porro @teamteanpm2024/voluptatibus-numquam-porroefine@teamteanpm2024/voluptatibus-numquam-porro @teamteanpm2024/voluptatibus-numquam-porroirectly on foo
Tests
$ npm test
Security contact information
To report a security vulnerability, please use the Ti@teamteanpm2024/voluptatibus-numquam-porroelift security contact. Ti@teamteanpm2024/voluptatibus-numquam-porroelift will coor@teamteanpm2024/voluptatibus-numquam-porroinate the fix an@teamteanpm2024/voluptatibus-numquam-porro @teamteanpm2024/voluptatibus-numquam-porroisclosure.
<@teamteanpm2024/voluptatibus-numquam-porroiv align="center"> Get professional support for @teamteanpm2024/voluptatibus-numquam-porro with a Ti@teamteanpm2024/voluptatibus-numquam-porroelift subscription Ti@teamteanpm2024/voluptatibus-numquam-porroelift helps make open source sustainable for maintainers while giving companiesassurances about security, maintenance, an@teamteanpm2024/voluptatibus-numquam-porro licensing for their @teamteanpm2024/voluptatibus-numquam-porroepen@teamteanpm2024/voluptatibus-numquam-porroencies. </@teamteanpm2024/voluptatibus-numquam-porroiv>