File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ var debug = require ( 'debug' ) ;
4+
5+ exports . path = require ( './path' ) ;
6+
7+ /**
8+ * Writes messages to stdout.
9+ * Log messages are suppressed by default, but can be enabled by setting the DEBUG variable.
10+ * @type {function }
11+ */
12+ exports . debug = debug ( 'json-schema-ref-parser' ) ;
13+
14+ /**
15+ * Asynchronously invokes the given callback function with the given parameters.
16+ *
17+ * @param {function|undefined } callback
18+ * @param {* } [err]
19+ * @param {...* } [params]
20+ */
21+ exports . doCallback = function doCallback ( callback , err , params ) {
22+ if ( typeof ( callback ) === 'function' ) {
23+ var args = Array . prototype . slice . call ( arguments , 1 ) ;
24+
25+ /* istanbul ignore if: code-coverage doesn't run in the browser */
26+ if ( process . browser ) {
27+ process . nextTick ( invokeCallback ) ;
28+ }
29+ else {
30+ setImmediate ( invokeCallback ) ;
31+ }
32+ }
33+
34+ function invokeCallback ( ) {
35+ callback . apply ( null , args ) ;
36+ }
37+ } ;
Original file line number Diff line number Diff line change 11'use strict' ;
22
3- var debug = require ( 'debug' ) ,
4- protocolPattern = / ^ [ a - z 0 - 9 . + - ] + : \/ \/ / i;
5-
6- /**
7- * Writes messages to stdout.
8- * Log messages are suppressed by default, but can be enabled by setting the DEBUG variable.
9- * @type {function }
10- */
11- exports . debug = debug ( 'json-schema-ref-parser' ) ;
3+ var protocolPattern = / ^ [ a - z 0 - 9 . + - ] + : \/ \/ / i;
124
135/**
146 * Returns the current working directory (in Node) or the current page URL (in browsers).
@@ -70,28 +62,3 @@ exports.extname = function extname(path) {
7062 }
7163 return '' ;
7264} ;
73-
74- /**
75- * Asynchronously invokes the given callback function with the given parameters.
76- *
77- * @param {function|undefined } callback
78- * @param {* } [err]
79- * @param {...* } [params]
80- */
81- exports . doCallback = function doCallback ( callback , err , params ) {
82- if ( typeof ( callback ) === 'function' ) {
83- var args = Array . prototype . slice . call ( arguments , 1 ) ;
84-
85- /* istanbul ignore if: code-coverage doesn't run in the browser */
86- if ( process . browser ) {
87- process . nextTick ( invokeCallback ) ;
88- }
89- else {
90- setImmediate ( invokeCallback ) ;
91- }
92- }
93-
94- function invokeCallback ( ) {
95- callback . apply ( null , args ) ;
96- }
97- } ;
You can’t perform that action at this time.
0 commit comments