aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Path.purs
blob: e071e35f270c552544b9bd378647957d03590972 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module PursLoader.Path
  ( dirname
  , join
  , relative
  , resolve
  ) where

foreign import dirname """
function dirname(filepath) {
  var path = require('path');
  return path.dirname(filepath);
}
""" :: String -> String

foreign import join """
function join(parts) {
  var path = require('path');
  return path.join.apply(path, parts);
}
""" :: [String] -> String

foreign import relative """
function relative(from) {
  return function(to){
    var path = require('path');
    return path.relative(from, to);
  };
}
""" :: String -> String -> String

foreign import resolve """
function resolve(filepath) {
  var path = require('path');
  return path.resolve(filepath);
}
""" :: String -> String