@@ -24,58 +24,58 @@ assert.notStrictEqual(2, "2", "uses === comparator");
24
24
assert . throws ( ( ) => { throw "a hammer at your face" ; } , "DODGED IT" ) ;
25
25
26
26
assert . doesNotThrow ( ( ) => {
27
- if ( false ) { throw "a hammer at your face" ; }
27
+ if ( false ) { throw "a hammer at your face" ; }
28
28
} , "What the...*crunch*" ) ;
29
29
30
30
////////////////////////////////////////////////////
31
31
/// File system tests : http://nodejs.org/api/fs.html
32
32
////////////////////////////////////////////////////
33
33
fs . writeFile ( "thebible.txt" ,
34
- "Do unto others as you would have them do unto you." ,
35
- assert . ifError ) ;
34
+ "Do unto others as you would have them do unto you." ,
35
+ assert . ifError ) ;
36
36
37
37
fs . writeFile ( "Harry Potter" ,
38
- "\"You be wizzing, Harry,\" jived Dumbledore." ,
39
- {
40
- encoding : "ascii"
41
- } ,
42
- assert . ifError ) ;
38
+ "\"You be wizzing, Harry,\" jived Dumbledore." ,
39
+ {
40
+ encoding : "ascii"
41
+ } ,
42
+ assert . ifError ) ;
43
43
44
44
var content : string ,
45
- buffer : Buffer ;
45
+ buffer : Buffer ;
46
46
47
47
content = fs . readFileSync ( 'testfile' , 'utf8' ) ;
48
- content = fs . readFileSync ( 'testfile' , { encoding : 'utf8' } ) ;
48
+ content = fs . readFileSync ( 'testfile' , { encoding : 'utf8' } ) ;
49
49
buffer = fs . readFileSync ( 'testfile' ) ;
50
- buffer = fs . readFileSync ( 'testfile' , { flag : 'r' } ) ;
50
+ buffer = fs . readFileSync ( 'testfile' , { flag : 'r' } ) ;
51
51
fs . readFile ( 'testfile' , 'utf8' , ( err , data ) => content = data ) ;
52
- fs . readFile ( 'testfile' , { encoding : 'utf8' } , ( err , data ) => content = data ) ;
52
+ fs . readFile ( 'testfile' , { encoding : 'utf8' } , ( err , data ) => content = data ) ;
53
53
fs . readFile ( 'testfile' , ( err , data ) => buffer = data ) ;
54
- fs . readFile ( 'testfile' , { flag : 'r' } , ( err , data ) => buffer = data ) ;
54
+ fs . readFile ( 'testfile' , { flag : 'r' } , ( err , data ) => buffer = data ) ;
55
55
56
56
class Networker extends events . EventEmitter {
57
- constructor ( ) {
58
- super ( ) ;
57
+ constructor ( ) {
58
+ super ( ) ;
59
59
60
- this . emit ( "mingling" ) ;
61
- }
60
+ this . emit ( "mingling" ) ;
61
+ }
62
62
}
63
63
64
64
var errno : number ;
65
65
fs . readFile ( 'testfile' , ( err , data ) => {
66
- if ( err && err . errno ) {
67
- errno = err . errno ;
68
- }
66
+ if ( err && err . errno ) {
67
+ errno = err . errno ;
68
+ }
69
69
} ) ;
70
70
71
71
url . format ( url . parse ( 'http://www.example.com/xyz' ) ) ;
72
72
73
73
// https://google.com/search?q=you're%20a%20lizard%2C%20gary
74
74
url . format ( {
75
- protocol : 'https' ,
76
- host : "google.com" ,
77
- pathname : 'search' ,
78
- query : { q : "you're a lizard, gary" }
75
+ protocol : 'https' ,
76
+ host : "google.com" ,
77
+ pathname : 'search' ,
78
+ query : { q : "you're a lizard, gary" }
79
79
} ) ;
80
80
81
81
// Old and new util.inspect APIs
@@ -88,10 +88,10 @@ util.inspect(["This is nice"], { colors: true, depth: 5, customInspect: false })
88
88
89
89
// http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options
90
90
function stream_readable_pipe_test ( ) {
91
- var r = fs . createReadStream ( 'file.txt' ) ;
92
- var z = zlib . createGzip ( ) ;
93
- var w = fs . createWriteStream ( 'file.txt.gz' ) ;
94
- r . pipe ( z ) . pipe ( w ) ;
91
+ var r = fs . createReadStream ( 'file.txt' ) ;
92
+ var z = zlib . createGzip ( ) ;
93
+ var w = fs . createWriteStream ( 'file.txt.gz' ) ;
94
+ r . pipe ( z ) . pipe ( w ) ;
95
95
}
96
96
97
97
////////////////////////////////////////////////////
@@ -107,18 +107,18 @@ http.createServer().listen(0).close().address();
107
107
net . createServer ( ) . listen ( 0 ) . close ( ) . address ( ) ;
108
108
109
109
var request = http . request ( 'http://0.0.0.0' ) ;
110
- request . once ( 'error' , function ( ) { } ) ;
110
+ request . once ( 'error' , function ( ) { } ) ;
111
111
request . setNoDelay ( true ) ;
112
112
request . abort ( ) ;
113
113
114
114
////////////////////////////////////////////////////
115
115
/// Http tests : http://nodejs.org/api/http.html
116
116
////////////////////////////////////////////////////
117
117
namespace http_tests {
118
- // Status codes
119
- var code = 100 ;
120
- var codeMessage = http . STATUS_CODES [ '400' ] ;
121
- var codeMessage = http . STATUS_CODES [ 400 ] ;
118
+ // Status codes
119
+ var code = 100 ;
120
+ var codeMessage = http . STATUS_CODES [ '400' ] ;
121
+ var codeMessage = http . STATUS_CODES [ 400 ] ;
122
122
}
123
123
124
124
////////////////////////////////////////////////////
@@ -156,6 +156,6 @@ rl.setPrompt("$>");
156
156
rl . prompt ( ) ;
157
157
rl . prompt ( true ) ;
158
158
159
- rl . question ( "do you like typescript?" , function ( answer : string ) {
159
+ rl . question ( "do you like typescript?" , function ( answer : string ) {
160
160
rl . close ( ) ;
161
161
} ) ;
0 commit comments