File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ This is a list of code fragments for the copy / paste tool on yours keyboard. I
3
3
4
4
<!-- TOC depthFrom:2 -->
5
5
6
+ - [ Base Services] ( #base-services )
7
+ - [ Pretty JSON in Logger] ( #pretty-json-in-logger )
6
8
- [ Spreadsheets] ( #spreadsheets )
7
9
- [ Common elements for spreadsheets] ( #common-elements-for-spreadsheets )
8
10
- [ Round to day] ( #round-to-day )
@@ -16,6 +18,21 @@ This is a list of code fragments for the copy / paste tool on yours keyboard. I
16
18
17
19
<!-- /TOC -->
18
20
21
+ ## Base Services
22
+
23
+ ### Pretty JSON in Logger
24
+ _ example [ /issues/3] ( /issues/3 ) _
25
+ ``` js
26
+ function ll (){
27
+ var args = [];
28
+ for (var i = 0 ; i < arguments .length ; i++ ) {
29
+ args .push (typeof arguments [i] === ' object' ? JSON .stringify (arguments [i], null , ' ' ) : arguments [i]);
30
+ }
31
+ if (typeof args[0 ] === ' string' && ! / %s/ .test (args[0 ]))
32
+ args .unshift (Array (args .length ).join (' \n %s' ));
33
+ Logger .log .apply (Logger, args);
34
+ }
35
+ ```
19
36
## Spreadsheets
20
37
21
38
### Common elements for spreadsheets
You can’t perform that action at this time.
0 commit comments