1- ! function ( e ) { if ( "object" == typeof exports && "undefined" != typeof module ) module . exports = e ( ) ; else if ( "function" == typeof define && define . amd ) define ( [ ] , e ) ; else { var f ; "undefined" != typeof window ? f = window : "undefined" != typeof global ? f = global : "undefined" != typeof self && ( f = self ) , f . debug = e ( ) } } ( function ( ) { var define , module , exports ; return ( function e ( t , n , r ) { function s ( o , u ) { if ( ! n [ o ] ) { if ( ! t [ o ] ) { var a = typeof require == "function" && require ; if ( ! u && a ) return a ( o , ! 0 ) ; if ( i ) return i ( o , ! 0 ) ; var f = new Error ( "Cannot find module '" + o + "'" ) ; throw f . code = "MODULE_NOT_FOUND" , f } var l = n [ o ] = { exports :{ } } ; t [ o ] [ 0 ] . call ( l . exports , function ( e ) { var n = t [ o ] [ 1 ] [ e ] ; return s ( n ?n :e ) } , l , l . exports , e , t , n , r ) } return n [ o ] . exports } var i = typeof require == "function" && require ; for ( var o = 0 ; o < r . length ; o ++ ) s ( r [ o ] ) ; return s } ) ( { 1 :[ function ( require , module , exports ) {
1+ ( function ( f ) { if ( typeof exports === "object" && typeof module !== "undefined" ) { module . exports = f ( ) } else if ( typeof define === "function" && define . amd ) { define ( [ ] , f ) } else { var g ; if ( typeof window !== "undefined" ) { g = window } else if ( typeof global !== "undefined" ) { g = global } else if ( typeof self !== "undefined" ) { g = self } else { g = this } g . debug = f ( ) } } ) ( function ( ) { var define , module , exports ; return ( function e ( t , n , r ) { function s ( o , u ) { if ( ! n [ o ] ) { if ( ! t [ o ] ) { var a = typeof require == "function" && require ; if ( ! u && a ) return a ( o , ! 0 ) ; if ( i ) return i ( o , ! 0 ) ; var f = new Error ( "Cannot find module '" + o + "'" ) ; throw f . code = "MODULE_NOT_FOUND" , f } var l = n [ o ] = { exports :{ } } ; t [ o ] [ 0 ] . call ( l . exports , function ( e ) { var n = t [ o ] [ 1 ] [ e ] ; return s ( n ?n :e ) } , l , l . exports , e , t , n , r ) } return n [ o ] . exports } var i = typeof require == "function" && require ; for ( var o = 0 ; o < r . length ; o ++ ) s ( r [ o ] ) ; return s } ) ( { 1 :[ function ( require , module , exports ) {
22
33/**
44 * This is the common logic for both the Node.js and web browser
@@ -238,13 +238,15 @@ module.exports = function(val, options){
238238 */
239239
240240function parse ( str ) {
241- var match = / ^ ( (?: \d + ) ? \. ? \d + ) * ( m s | s e c o n d s ? | s | m i n u t e s ? | m | h o u r s ? | h | d a y s ? | d | y e a r s ? | y ) ? $ / i. exec ( str ) ;
241+ var match = / ^ ( (?: \d + ) ? \. ? \d + ) * ( m i l l i s e c o n d s ? | m s e c s ? | m s | s e c o n d s ? | s e c s ? | s | m i n u t e s ? | m i n s ? | m | h o u r s ? | h r s ? | h | d a y s ? | d | y e a r s ? | y r s ? | y ) ? $ / i. exec ( str ) ;
242242 if ( ! match ) return ;
243243 var n = parseFloat ( match [ 1 ] ) ;
244244 var type = ( match [ 2 ] || 'ms' ) . toLowerCase ( ) ;
245245 switch ( type ) {
246246 case 'years' :
247247 case 'year' :
248+ case 'yrs' :
249+ case 'yr' :
248250 case 'y' :
249251 return n * y ;
250252 case 'days' :
@@ -253,16 +255,26 @@ function parse(str) {
253255 return n * d ;
254256 case 'hours' :
255257 case 'hour' :
258+ case 'hrs' :
259+ case 'hr' :
256260 case 'h' :
257261 return n * h ;
258262 case 'minutes' :
259263 case 'minute' :
264+ case 'mins' :
265+ case 'min' :
260266 case 'm' :
261267 return n * m ;
262268 case 'seconds' :
263269 case 'second' :
270+ case 'secs' :
271+ case 'sec' :
264272 case 's' :
265273 return n * s ;
274+ case 'milliseconds' :
275+ case 'millisecond' :
276+ case 'msecs' :
277+ case 'msec' :
266278 case 'ms' :
267279 return n ;
268280 }
@@ -325,6 +337,17 @@ exports.save = save;
325337exports . load = load ;
326338exports . useColors = useColors ;
327339
340+ /**
341+ * Use chrome.storage.local if we are in an app
342+ */
343+
344+ var storage ;
345+
346+ if ( typeof chrome !== 'undefined' && typeof chrome . storage !== 'undefined' )
347+ storage = chrome . storage . local ;
348+ else
349+ storage = localstorage ( ) ;
350+
328351/**
329352 * Colors.
330353 */
@@ -414,10 +437,10 @@ function formatArgs() {
414437 */
415438
416439function log ( ) {
417- // This hackery is required for IE8,
418- // where the `console.log` function doesn't have 'apply'
419- return 'object' == typeof console
420- && 'function' == typeof console . log
440+ // this hackery is required for IE8/9, where
441+ // the `console.log` function doesn't have 'apply'
442+ return 'object' === typeof console
443+ && console . log
421444 && Function . prototype . apply . call ( console . log , console , arguments ) ;
422445}
423446
@@ -431,9 +454,9 @@ function log() {
431454function save ( namespaces ) {
432455 try {
433456 if ( null == namespaces ) {
434- localStorage . removeItem ( 'debug' ) ;
457+ storage . removeItem ( 'debug' ) ;
435458 } else {
436- localStorage . debug = namespaces ;
459+ storage . debug = namespaces ;
437460 }
438461 } catch ( e ) { }
439462}
@@ -448,7 +471,7 @@ function save(namespaces) {
448471function load ( ) {
449472 var r ;
450473 try {
451- r = localStorage . debug ;
474+ r = storage . debug ;
452475 } catch ( e ) { }
453476 return r ;
454477}
@@ -459,5 +482,22 @@ function load() {
459482
460483exports . enable ( load ( ) ) ;
461484
485+ /**
486+ * Localstorage attempts to return the localstorage.
487+ *
488+ * This is necessary because safari throws
489+ * when a user disables cookies/localstorage
490+ * and you attempt to access it.
491+ *
492+ * @return {LocalStorage }
493+ * @api private
494+ */
495+
496+ function localstorage ( ) {
497+ try {
498+ return window . localStorage ;
499+ } catch ( e ) { }
500+ }
501+
462502} , { "./debug" :1 } ] } , { } , [ 3 ] ) ( 3 )
463503} ) ;
0 commit comments