\href{https://nodei.co/npm/convert-source-map/}{\texttt{ }}

Converts a source-\/map from/to different formats and allows adding/changing properties.


\begin{DoxyCode}{0}
\DoxyCodeLine{var convert = require('convert-\/source-\/map');}
\DoxyCodeLine{}
\DoxyCodeLine{var json = convert}
\DoxyCodeLine{  .fromComment('//\# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')}
\DoxyCodeLine{  .toJSON();}
\DoxyCodeLine{}
\DoxyCodeLine{var modified = convert}
\DoxyCodeLine{  .fromComment('//\# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')}
\DoxyCodeLine{  .setProperty('sources', [ 'CONSOLE.LOG("{}HI"{});' ])}
\DoxyCodeLine{  .toJSON();}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(json);}
\DoxyCodeLine{console.log(modified); }

\end{DoxyCode}



\begin{DoxyCode}{0}
\DoxyCodeLine{\{"{}version"{}:3,"{}file"{}:"{}foo.js"{},"{}sources"{}:["{}console.log(\(\backslash\)"{}hi\(\backslash\)"{});"{}],"{}names"{}:[],"{}mappings"{}:"{}AAAA"{},"{}sourceRoot"{}:"{}/"{}\}}
\DoxyCodeLine{\{"{}version"{}:3,"{}file"{}:"{}foo.js"{},"{}sources"{}:["{}CONSOLE.LOG(\(\backslash\)"{}HI\(\backslash\)"{});"{}],"{}names"{}:[],"{}mappings"{}:"{}AAAA"{},"{}sourceRoot"{}:"{}/"{}\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24883}{}\doxysection{API}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24883}
\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24884}{}\doxysubsection{from\+Object(obj)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24884}
Returns source map converter from given object.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24885}{}\doxysubsection{from\+JSON(json)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24885}
Returns source map converter from given json string.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24886}{}\doxysubsection{from\+Base64(base64)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24886}
Returns source map converter from given base64 encoded json string.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24887}{}\doxysubsection{from\+Comment(comment)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24887}
Returns source map converter from given base64 encoded json string prefixed with {\ttfamily //\# source\+Mapping\+URL=...}.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24888}{}\doxysubsection{from\+Map\+File\+Comment(comment, map\+File\+Dir)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24888}
Returns source map converter from given {\ttfamily filename} by parsing {\ttfamily //\# source\+Mapping\+URL=filename}.

{\ttfamily filename} must point to a file that is found inside the {\ttfamily map\+File\+Dir}. Most tools store this file right next to the generated file, i.\+e. the one containing the source map.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24889}{}\doxysubsection{from\+Source(source)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24889}
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24890}{}\doxysubsection{from\+Map\+File\+Source(source, map\+File\+Dir)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24890}
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.

The sourcemap will be read from the map file found by parsing {\ttfamily \# source\+Mapping\+URL=file} comment. For more info see from\+Map\+File\+Comment.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24891}{}\doxysubsection{to\+Object()}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24891}
Returns a copy of the underlying source map.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24892}{}\doxysubsection{to\+JSON(\mbox{[}space\mbox{]})}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24892}
Converts source map to json string. If {\ttfamily space} is given (optional), this will be passed to \href{https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify}{\texttt{ JSON.\+stringify}} when the JSON string is generated.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24893}{}\doxysubsection{to\+Base64()}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24893}
Converts source map to base64 encoded json string.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24894}{}\doxysubsection{to\+Comment()}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24894}
Converts source map to base64 encoded json string prefixed with {\ttfamily //\# source\+Mapping\+URL=...}.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24895}{}\doxysubsection{add\+Property(key, value)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24895}
Adds given property to the source map. Throws an error if property already exists.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24896}{}\doxysubsection{set\+Property(key, value)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24896}
Sets given property to the source map. If property doesn\textquotesingle{}t exist it is added, otherwise its value is updated.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24897}{}\doxysubsection{get\+Property(key)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24897}
Gets given property of the source map.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24898}{}\doxysubsection{remove\+Comments(src)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24898}
Returns {\ttfamily src} with all source map comments removed\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24899}{}\doxysubsection{remove\+Map\+File\+Comments(src)}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24899}
Returns {\ttfamily src} with all source map comments pointing to map files removed.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24900}{}\doxysubsection{comment\+Regex}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24900}
Returns the regex used to find source map comments.\hypertarget{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24901}{}\doxysubsection{map\+File\+Comment\+Regex}\label{md_sfcode_node_modules_rework_node_modules_convert_source_map_README_autotoc_md24901}
Returns the regex used to find source map comments pointing to map files.

\href{https://bitdeli.com/free}{\texttt{ }} 