File tree 1 file changed +25
-11
lines changed 1 file changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -346,16 +346,30 @@ var domToString = function(d) {
346
346
return tmp . innerHTML ;
347
347
} ;
348
348
349
- var logError = function ( message , options ) {
350
- if ( ! options ) options = { } ;
351
- var component = "Selectize" ;
349
+ var logError = function ( message , options ) {
350
+ if ( ! options ) options = { } ;
351
+ var component = "Selectize" ;
352
352
353
- console . error ( component + ": " + message )
353
+ console . error ( component + ": " + message )
354
354
355
- if ( options . explanation ) {
356
- // console.group is undefined in <IE11
357
- if ( console . group ) console . group ( ) ;
358
- console . error ( options . explanation ) ;
359
- if ( console . group ) console . groupEnd ( ) ;
360
- }
361
- }
355
+ if ( options . explanation ) {
356
+ // console.group is undefined in <IE11
357
+ if ( console . group ) console . group ( ) ;
358
+ console . error ( options . explanation ) ;
359
+ if ( console . group ) console . groupEnd ( ) ;
360
+ }
361
+ } ;
362
+
363
+ /**
364
+ *
365
+ * @param {any } data Data to testing
366
+ * @returns {Boolean } true if is an JSON object
367
+ */
368
+ var isJSON = function ( data ) {
369
+ try {
370
+ JSON . parse ( str ) ;
371
+ } catch ( e ) {
372
+ return false ;
373
+ }
374
+ return true ;
375
+ } ;
You can’t perform that action at this time.
0 commit comments