@jdeighan/coffee-utils 4.0.16 → 4.0.17
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/fs_utils.coffee +7 -0
- package/src/fs_utils.js +7 -0
package/package.json
CHANGED
package/src/fs_utils.coffee
CHANGED
@@ -23,6 +23,13 @@ export isDir = (fullpath) ->
|
|
23
23
|
|
24
24
|
return fs.lstatSync(fullpath).isDirectory()
|
25
25
|
|
26
|
+
# ---------------------------------------------------------------------------
|
27
|
+
|
28
|
+
export isSimpleFileName = (path) ->
|
29
|
+
|
30
|
+
h = pathlib.parse(path)
|
31
|
+
return ! h.root && ! h.dir && h.base
|
32
|
+
|
26
33
|
# ---------------------------------------------------------------------------
|
27
34
|
# mydir() - pass argument `import.meta.url` and it will return
|
28
35
|
# the directory your file is in
|
package/src/fs_utils.js
CHANGED
@@ -38,6 +38,13 @@ export var isDir = function(fullpath) {
|
|
38
38
|
return fs.lstatSync(fullpath).isDirectory();
|
39
39
|
};
|
40
40
|
|
41
|
+
// ---------------------------------------------------------------------------
|
42
|
+
export var isSimpleFileName = function(path) {
|
43
|
+
var h;
|
44
|
+
h = pathlib.parse(path);
|
45
|
+
return !h.root && !h.dir && h.base;
|
46
|
+
};
|
47
|
+
|
41
48
|
// ---------------------------------------------------------------------------
|
42
49
|
// mydir() - pass argument `import.meta.url` and it will return
|
43
50
|
// the directory your file is in
|