File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed
lib/node_modules/@stdlib/process/cwd Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ // MAIN //
4+
5+ /**
6+ * Returns the current working directory.
7+ *
8+ * ## Notes
9+ *
10+ * - This function assumes a virtual filesystem in a browser environment.
11+ *
12+ * @returns {string } current working directory
13+ *
14+ * @example
15+ * var dir = cwd();
16+ * // returns '/path/to/current/working/directory'
17+ */
18+ function cwd ( ) {
19+ // TODO: implement
20+ return '/' ;
21+ }
22+
23+
24+ // EXPORTS //
25+
26+ module . exports = cwd ;
Original file line number Diff line number Diff line change 1717 "cwd" : " ./bin/cli"
1818 },
1919 "main" : " ./lib" ,
20+ "browser" : " ./lib/browser.js" ,
2021 "directories" : {
2122 "benchmark" : " ./benchmark" ,
2223 "bin" : " ./bin" ,
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ // MODULES //
4+
5+ var tape = require ( 'tape' ) ;
6+ var cwd = require ( './../lib/browser.js' ) ;
7+
8+
9+ // TESTS //
10+
11+ tape ( 'main export is a function' , function test ( t ) {
12+ t . ok ( true , __filename ) ;
13+ t . equal ( typeof cwd , 'function' , 'main export is a function' ) ;
14+ t . end ( ) ;
15+ } ) ;
16+
17+ tape ( 'the function returns the current working directory' , function test ( t ) {
18+ // TODO: update if, and when, we actually have a browser implementation
19+ t . equal ( cwd ( ) , '/' , 'returns current working directory' ) ;
20+ t . end ( ) ;
21+ } ) ;
You can’t perform that action at this time.
0 commit comments