\#define-\/properties \textsuperscript{\href{https://npmjs.org/package/define-properties}{\tt }}

\href{https://travis-ci.org/ljharb/define-properties}{\tt } \href{https://david-dm.org/ljharb/define-properties}{\tt } \href{https://david-dm.org/ljharb/define-properties#info=devDependencies}{\tt } \mbox{[}\mbox{]}\mbox{[}license-\/url\mbox{]} \href{http://npm-stat.com/charts.html?package=define-properties}{\tt }

\href{https://npmjs.org/package/define-properties}{\tt }

\href{https://ci.testling.com/ljharb/define-properties}{\tt }

Define multiple non-\/enumerable properties at once. Uses {\ttfamily Object.\+define\+Property} when available; falls back to standard assignment in older engines. Existing properties are not overridden. Accepts a map of property names to a predicate that, when true, force-\/overrides.

\subsection*{Example}


\begin{DoxyCode}
var define = require('define-properties');
var assert = require('assert');

var obj = define(\{ a: 1, b: 2 \}, \{
    a: 10,
    b: 20,
    c: 30
\});
assert(obj.a === 1);
assert(obj.b === 2);
assert(obj.c === 30);
if (define.supportsDescriptors) \{
    assert.deepEqual(Object.keys(obj), ['a', 'b']);
    assert.deepEqual(Object.getOwnPropertyDescriptor(obj, 'c'), \{
        configurable: true,
        enumerable: false,
        value: 30,
        writable: false
    \});
\}
\end{DoxyCode}


Then, with predicates\+: 
\begin{DoxyCode}
var define = require('define-properties');
var assert = require('assert');

var obj = define(\{ a: 1, b: 2, c: 3 \}, \{
    a: 10,
    b: 20,
    c: 30
\}, \{
    a: function () \{ return false; \},
    b: function () \{ return true; \}
\});
assert(obj.a === 1);
assert(obj.b === 20);
assert(obj.c === 3);
if (define.supportsDescriptors) \{
    assert.deepEqual(Object.keys(obj), ['a', 'c']);
    assert.deepEqual(Object.getOwnPropertyDescriptor(obj, 'b'), \{
        configurable: true,
        enumerable: false,
        value: 20,
        writable: false
    \});
\}
\end{DoxyCode}


\subsection*{Tests}

Simply clone the repo, {\ttfamily npm install}, and run {\ttfamily npm test} 