\begin{quote}
Create nested values and any intermediaries using dot notation (`\textquotesingle{}a.\+b.\+c'\`{}) paths. \end{quote}
\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26979}{}\doxysection{Install}\label{md_sfcode_node_modules_set_value_README_autotoc_md26979}
Install with \href{https://www.npmjs.com/}{\texttt{ npm}}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install -\/-\/save set-\/value }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26980}{}\doxysection{Usage}\label{md_sfcode_node_modules_set_value_README_autotoc_md26980}

\begin{DoxyCode}{0}
\DoxyCodeLine{var set = require('set-\/value');}
\DoxyCodeLine{set(object, prop, value); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26981}{}\doxysubsection{Params}\label{md_sfcode_node_modules_set_value_README_autotoc_md26981}

\begin{DoxyItemize}
\item {\ttfamily object} $\ast$$\ast$\{object\}$\ast$$\ast$\+: The object to set {\ttfamily value} on
\item {\ttfamily prop} $\ast$$\ast$\{string\}$\ast$$\ast$\+: The property to set. Dot-\/notation may be used.
\item {\ttfamily value} $\ast$$\ast$\{any\}$\ast$$\ast$\+: The value to set on {\ttfamily object\mbox{[}prop\mbox{]}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26982}{}\doxysection{Examples}\label{md_sfcode_node_modules_set_value_README_autotoc_md26982}
Updates and returns the given object\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var obj = \{\};}
\DoxyCodeLine{set(obj, 'a.b.c', 'd');}
\DoxyCodeLine{console.log(obj);}
\DoxyCodeLine{//=> \{ a: \{ b: \{ c: 'd' \} \} \} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26983}{}\doxysubsection{Escaping}\label{md_sfcode_node_modules_set_value_README_autotoc_md26983}
{\bfseries{Escaping with backslashes}}

Prevent set-\/value from splitting on a dot by prefixing it with backslashes\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{console.log(set(\{\}, 'a\(\backslash\)\(\backslash\).b.c', 'd'));}
\DoxyCodeLine{//=> \{ 'a.b': \{ c: 'd' \} \}}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(set(\{\}, 'a\(\backslash\)\(\backslash\).b\(\backslash\)\(\backslash\).c', 'd'));}
\DoxyCodeLine{//=> \{ 'a.b.c': 'd' \} }

\end{DoxyCode}


{\bfseries{Escaping with double-\/quotes or single-\/quotes}}

Wrap double or single quotes around the string, or part of the string, that should not be split by set-\/value\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{console.log(set(\{\}, '"{}a.b"{}.c', 'd'));}
\DoxyCodeLine{//=> \{ 'a.b': \{ c: 'd' \} \}}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(set(\{\}, "{}'a.b'.c"{}, "{}d"{}));}
\DoxyCodeLine{//=> \{ 'a.b': \{ c: 'd' \} \}}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(set(\{\}, '"{}this/is/a/.file.path"{}', 'd'));}
\DoxyCodeLine{//=> \{ 'this/is/a/file.path': 'd' \} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26984}{}\doxysubsection{Bracket support}\label{md_sfcode_node_modules_set_value_README_autotoc_md26984}
set-\/value does not split inside brackets or braces\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{console.log(set(\{\}, '[a.b].c', 'd'));}
\DoxyCodeLine{//=> \{ '[a.b]': \{ c: 'd' \} \}}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(set(\{\}, "{}(a.b).c"{}, "{}d"{}));}
\DoxyCodeLine{//=> \{ '(a.b)': \{ c: 'd' \} \}}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(set(\{\}, "{}<a.b>.c"{}, "{}d"{}));}
\DoxyCodeLine{//=> \{ '<a.b>': \{ c: 'd' \} \}}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(set(\{\}, "{}\{a..b\}.c"{}, "{}d"{}));}
\DoxyCodeLine{//=> \{ '\{a..b\}': \{ c: 'd' \} \} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26985}{}\doxysection{History}\label{md_sfcode_node_modules_set_value_README_autotoc_md26985}
\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26986}{}\doxysubsection{v2.\+0.\+0}\label{md_sfcode_node_modules_set_value_README_autotoc_md26986}

\begin{DoxyItemize}
\item Adds support for escaping with double or single quotes. See \href{\#escaping}{\texttt{ escaping}} for examples.
\item Will no longer split inside brackets or braces. See \href{\#bracket-support}{\texttt{ bracket support}} for examples.
\end{DoxyItemize}

If there are any regressions please create a \href{../../issues/new}{\texttt{ bug report}}. Thanks!\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26987}{}\doxysection{About}\label{md_sfcode_node_modules_set_value_README_autotoc_md26987}
\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26988}{}\doxysubsection{Related projects}\label{md_sfcode_node_modules_set_value_README_autotoc_md26988}

\begin{DoxyItemize}
\item \href{https://www.npmjs.com/package/assign-value}{\texttt{ assign-\/value}}\+: Assign a value or extend a deeply nested property of an object using object path… \href{https://github.com/jonschlinkert/assign-value}{\texttt{ more}} $\vert$ \href{https://github.com/jonschlinkert/assign-value}{\texttt{ homepage}}
\item \href{https://www.npmjs.com/package/get-value}{\texttt{ get-\/value}}\+: Use property paths ({\ttfamily a.\+b.\+c}) to get a nested value from an object. $\vert$ \mbox{[}homepage\mbox{]}(\href{https://github.com/jonschlinkert/get-value}{\texttt{ https\+://github.\+com/jonschlinkert/get-\/value}} \char`\"{}\+Use property paths (\`{}a.\+b.\+c\`{}) to get a nested value from an object.\char`\"{})
\item \href{https://www.npmjs.com/package/has-value}{\texttt{ has-\/value}}\+: Returns true if a value exists, false if empty. Works with deeply nested values using… \href{https://github.com/jonschlinkert/has-value}{\texttt{ more}} $\vert$ \href{https://github.com/jonschlinkert/has-value}{\texttt{ homepage}}
\item \href{https://www.npmjs.com/package/merge-value}{\texttt{ merge-\/value}}\+: Similar to assign-\/value but deeply merges object values or nested values using object path/dot notation. $\vert$ \href{https://github.com/jonschlinkert/merge-value}{\texttt{ homepage}}
\item \href{https://www.npmjs.com/package/omit-value}{\texttt{ omit-\/value}}\+: Omit properties from an object or deeply nested property of an object using object path… \href{https://github.com/jonschlinkert/omit-value}{\texttt{ more}} $\vert$ \href{https://github.com/jonschlinkert/omit-value}{\texttt{ homepage}}
\item \href{https://www.npmjs.com/package/set-value}{\texttt{ set-\/value}}\+: Create nested values and any intermediaries using dot notation (`\textquotesingle{}a.\+b.\+c'{\ttfamily ) paths. $\vert$ \mbox{[}homepage\mbox{]}(\href{https://github.com/jonschlinkert/set-value}{\texttt{ https\+://github.\+com/jonschlinkert/set-\/value}} \char`\"{}\+Create nested values and any intermediaries using dot notation ($<$/tt$>$\textquotesingle{}a.\+b.\+c\textquotesingle{}\`{}) paths.\char`\"{})}
\item {\ttfamily \mbox{[}union-\/value\mbox{]}(\href{https://www.npmjs.com/package/union-value}{\texttt{ https\+://www.\+npmjs.\+com/package/union-\/value}})\+: Set an array of unique values as the property of an object. Supports setting deeply… \mbox{[}more\mbox{]}(\href{https://github.com/jonschlinkert/union-value}{\texttt{ https\+://github.\+com/jonschlinkert/union-\/value}}) $\vert$ \mbox{[}homepage\mbox{]}(\href{https://github.com/jonschlinkert/union-value}{\texttt{ https\+://github.\+com/jonschlinkert/union-\/value}} \char`\"{}\+Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-\/paths/dot notation.\char`\"{})}
\item {\ttfamily \mbox{[}unset-\/value\mbox{]}(\href{https://www.npmjs.com/package/unset-value}{\texttt{ https\+://www.\+npmjs.\+com/package/unset-\/value}})\+: Delete nested properties from an object using dot notation. $\vert$ \mbox{[}homepage\mbox{]}(\href{https://github.com/jonschlinkert/unset-value}{\texttt{ https\+://github.\+com/jonschlinkert/unset-\/value}} \char`\"{}\+Delete nested properties from an object using dot notation.\char`\"{})}
\end{DoxyItemize}

{\ttfamily }\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26989}{}\doxysubsection{Contributing}\label{md_sfcode_node_modules_set_value_README_autotoc_md26989}
{\ttfamily  Pull requests and stars are always welcome. For bugs and feature requests, \href{../../issues/new}{\texttt{ please create an issue}}.}

{\ttfamily }\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26990}{}\doxysubsection{Contributors}\label{md_sfcode_node_modules_set_value_README_autotoc_md26990}
{\ttfamily  \tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ {\bfseries{Commits}}   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ {\bfseries{Contributor}}    }\\\cline{1-2}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ {\bfseries{Commits}}   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ {\bfseries{Contributor}}    }\\\cline{1-2}
\endhead
59   &\href{https://github.com/jonschlinkert}{\texttt{ jonschlinkert}}    \\\cline{1-2}
1   &\href{https://github.com/vadimdemedes}{\texttt{ vadimdemedes}}    \\\cline{1-2}
1   &\href{https://github.com/wtgtybhertgeghgtwtg}{\texttt{ wtgtybhertgeghgtwtg}}   \\\cline{1-2}
\end{longtabu}
}

{\ttfamily }\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26991}{}\doxysubsection{Building docs}\label{md_sfcode_node_modules_set_value_README_autotoc_md26991}
{\ttfamily  \+\_\+(This project\textquotesingle{}s readme.\+md is generated by \href{https://github.com/verbose/verb-generate-readme}{\texttt{ verb}}, please don\textquotesingle{}t edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)\+\_\+}

{\ttfamily To generate the readme, run the following command\+:}

{\ttfamily 
\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install -\/g verbose/verb\#dev verb-\/generate-\/readme \&\& verb }

\end{DoxyCode}
}

{\ttfamily }\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26992}{}\doxysubsection{Running tests}\label{md_sfcode_node_modules_set_value_README_autotoc_md26992}
{\ttfamily  Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command\+:}

{\ttfamily 
\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install \&\& npm test }

\end{DoxyCode}
}

{\ttfamily }\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26993}{}\doxysubsection{Author}\label{md_sfcode_node_modules_set_value_README_autotoc_md26993}
{\ttfamily  {\bfseries{Jon Schlinkert}}}

{\ttfamily 
\begin{DoxyItemize}
\item \href{https://github.com/jonschlinkert}{\texttt{ github/jonschlinkert}}
\item \href{https://twitter.com/jonschlinkert}{\texttt{ twitter/jonschlinkert}}
\end{DoxyItemize}}

{\ttfamily }\hypertarget{md_sfcode_node_modules_set_value_README_autotoc_md26994}{}\doxysubsection{License}\label{md_sfcode_node_modules_set_value_README_autotoc_md26994}
{\ttfamily  Copyright © 2017, \href{https://github.com/jonschlinkert}{\texttt{ Jon Schlinkert}}. Released under the \mbox{[}MIT License\mbox{]}(LICENSE).}

{\ttfamily \DoxyHorRuler{0}
}

{\ttfamily {\itshape This file was generated by \href{https://github.com/verbose/verb-generate-readme}{\texttt{ verb-\/generate-\/readme}}, v0.\+6.\+0, on June 21, 2017.} }