@jdeighan/coffee-utils 7.0.7 → 7.0.8

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": "7.0.7",
4
+ "version": "7.0.8",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -186,13 +186,19 @@ export withUnderScore = (path) ->
186
186
  {dir, base} = pathlib.parse(path)
187
187
  return mkpath(dir, "_#{base}")
188
188
 
189
+ # ---------------------------------------------------------------------------
190
+
191
+ isSystemDir = (dir) ->
192
+
193
+ return dir in ['$Recycle.Bin', '$WinREAgent']
194
+
189
195
  # ---------------------------------------------------------------------------
190
196
  # Get all subdirectories of a directory
191
197
 
192
198
  export getSubDirs = (dir) ->
193
199
 
194
200
  return fs.readdirSync(dir, {withFileTypes: true}) \
195
- .filter((d) -> d.isDirectory() && (d.name != '$Recycle.Bin')) \
201
+ .filter((d) -> d.isDirectory() && !isSystemDir(d.name)) \
196
202
  .map((d) -> mkpath(d.name)) \
197
203
  .sort()
198
204
 
package/src/fs_utils.js CHANGED
@@ -1,5 +1,7 @@
1
1
  // Generated by CoffeeScript 2.6.1
2
2
  // fs_utils.coffee
3
+ var isSystemDir;
4
+
3
5
  import pathlib from 'path';
4
6
 
5
7
  import urllib from 'url';
@@ -217,13 +219,18 @@ export var withUnderScore = function(path) {
217
219
  return mkpath(dir, `_${base}`);
218
220
  };
219
221
 
222
+ // ---------------------------------------------------------------------------
223
+ isSystemDir = function(dir) {
224
+ return dir === '$Recycle.Bin' || dir === '$WinREAgent';
225
+ };
226
+
220
227
  // ---------------------------------------------------------------------------
221
228
  // Get all subdirectories of a directory
222
229
  export var getSubDirs = function(dir) {
223
230
  return fs.readdirSync(dir, {
224
231
  withFileTypes: true
225
232
  }).filter(function(d) {
226
- return d.isDirectory() && (d.name !== '$Recycle.Bin');
233
+ return d.isDirectory() && !isSystemDir(d.name);
227
234
  }).map(function(d) {
228
235
  return mkpath(d.name);
229
236
  }).sort();