Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
537 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | /*
|
---|
| 2 | Copyright 2015, Yahoo Inc.
|
---|
| 3 | Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
---|
| 4 | */
|
---|
| 5 | 'use strict';
|
---|
| 6 |
|
---|
| 7 | const path = require('path');
|
---|
| 8 |
|
---|
| 9 | module.exports = {
|
---|
| 10 | isAbsolute: path.isAbsolute,
|
---|
| 11 | asAbsolute(file, baseDir) {
|
---|
| 12 | return path.isAbsolute(file)
|
---|
| 13 | ? file
|
---|
| 14 | : path.resolve(baseDir || process.cwd(), file);
|
---|
| 15 | },
|
---|
| 16 | relativeTo(file, origFile) {
|
---|
| 17 | return path.isAbsolute(file)
|
---|
| 18 | ? file
|
---|
| 19 | : path.resolve(path.dirname(origFile), file);
|
---|
| 20 | }
|
---|
| 21 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.