@jdeighan/coffee-utils 4.0.16 → 4.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jdeighan/coffee-utils",
3
3
  "type": "module",
4
- "version": "4.0.16",
4
+ "version": "4.0.17",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -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