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

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

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

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

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.\hypertarget{md_sfcode_node_modules_define_properties_README_autotoc_md7944}{}\doxysubsection{Example}\label{md_sfcode_node_modules_define_properties_README_autotoc_md7944}

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

\end{DoxyCode}


Then, with predicates\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{var define = require('define-\/properties');}
\DoxyCodeLine{var assert = require('assert');}
\DoxyCodeLine{}
\DoxyCodeLine{var obj = define(\{ a: 1, b: 2, c: 3 \}, \{}
\DoxyCodeLine{    a: 10,}
\DoxyCodeLine{    b: 20,}
\DoxyCodeLine{    c: 30}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{    a: function () \{ return false; \},}
\DoxyCodeLine{    b: function () \{ return true; \}}
\DoxyCodeLine{\});}
\DoxyCodeLine{assert(obj.a === 1);}
\DoxyCodeLine{assert(obj.b === 20);}
\DoxyCodeLine{assert(obj.c === 3);}
\DoxyCodeLine{if (define.supportsDescriptors) \{}
\DoxyCodeLine{    assert.deepEqual(Object.keys(obj), ['a', 'c']);}
\DoxyCodeLine{    assert.deepEqual(Object.getOwnPropertyDescriptor(obj, 'b'), \{}
\DoxyCodeLine{        configurable: true,}
\DoxyCodeLine{        enumerable: false,}
\DoxyCodeLine{        value: 20,}
\DoxyCodeLine{        writable: false}
\DoxyCodeLine{    \});}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_define_properties_README_autotoc_md7945}{}\doxysubsection{Tests}\label{md_sfcode_node_modules_define_properties_README_autotoc_md7945}
Simply clone the repo, {\ttfamily npm install}, and run {\ttfamily npm test} 