File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 3434 "**/.pnp.*" : true
3535 },
3636 "editor.codeActionsOnSave" : {
37- "source.fixAll" : true
37+ "source.fixAll" : " explicit "
3838 },
3939 "cSpell.words" : [" doctoc" , " templating" ]
4040}
Original file line number Diff line number Diff line change 22 "author" : " Transcend Inc." ,
33 "name" : " @transcend-io/handlebars-utils" ,
44 "description" : " Utility functions for handlebars templating with Transcend - available in node and client side." ,
5- "version" : " 1.1 .0" ,
5+ "version" : " 1.2 .0" ,
66 "homepage" : " https://github.com/transcend-io/handlebars-utils" ,
77 "repository" : {
88 "type" : " git" ,
Original file line number Diff line number Diff line change @@ -117,6 +117,24 @@ export const DEFAULT_HANDLEBARS_HELPERS = {
117117 }
118118 return v ;
119119 } ) ,
120+ /**
121+ * Pretty JSON stringify
122+ *
123+ * @param obj - The object to convert
124+ * @returns The object stringified
125+ */
126+ toJSONPretty : < T extends ObjByString > ( obj : T ) =>
127+ JSON . stringify (
128+ obj ,
129+ ( k , v ) => {
130+ // Necessary, else functions don't get written.
131+ if ( typeof v === 'function' ) {
132+ return v . toString ( ) ;
133+ }
134+ return v ;
135+ } ,
136+ 2 ,
137+ ) ,
120138 /**
121139 * Compares two string to see if they're sorted
122140 *
You can’t perform that action at this time.
0 commit comments