@jdeighan/coffee-utils 14.0.11 → 14.0.13

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": "14.0.11",
4
+ "version": "14.0.13",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -49,13 +49,13 @@
49
49
  },
50
50
  "homepage": "https://github.com/johndeighan/coffee-utils#readme",
51
51
  "dependencies": {
52
- "@jdeighan/base-utils": "^4.0.5",
52
+ "@jdeighan/base-utils": "^4.0.7",
53
53
  "cross-env": "^7.0.3",
54
54
  "n-readlines": "^1.0.1",
55
55
  "readline-sync": "^1.4.10",
56
- "svelte": "^3.55.0"
56
+ "svelte": "^3.55.1"
57
57
  },
58
58
  "devDependencies": {
59
- "@jdeighan/unit-tester": "^3.0.22"
59
+ "@jdeighan/unit-tester": "^3.0.24"
60
60
  }
61
61
  }
@@ -35,3 +35,17 @@ export localStore = (key, value=undef) =>
35
35
  if defined(value)
36
36
  return JSON.parse(localStorage.getItem(key))
37
37
  return undef
38
+
39
+ # ---------------------------------------------------------------------------
40
+
41
+ storeKey = 'hPrefs'
42
+ export hPrefs = localStore(storeKey) || {}
43
+
44
+ # ---------------------------------------------------------------------------
45
+
46
+ export setPref = (key, value) =>
47
+
48
+ hPrefs[key] = value
49
+ localStore storeKey, hPrefs
50
+
51
+ # ---------------------------------------------------------------------------
package/src/browser.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  // browser.coffee
3
- var audio;
3
+ var audio, storeKey;
4
4
 
5
5
  import {
6
6
  undef,
@@ -44,3 +44,16 @@ export var localStore = (key, value = undef) => {
44
44
  }
45
45
  return undef;
46
46
  };
47
+
48
+ // ---------------------------------------------------------------------------
49
+ storeKey = 'hPrefs';
50
+
51
+ export var hPrefs = localStore(storeKey) || {};
52
+
53
+ // ---------------------------------------------------------------------------
54
+ export var setPref = (key, value) => {
55
+ hPrefs[key] = value;
56
+ return localStore(storeKey, hPrefs);
57
+ };
58
+
59
+ // ---------------------------------------------------------------------------
package/src/fs.coffee CHANGED
@@ -270,14 +270,6 @@ export removeFileWithExt = (path, newExt, hOptions={}) =>
270
270
  success = false
271
271
  return success
272
272
 
273
- # ---------------------------------------------------------------------------
274
- # withUnderScore - add '_' to file name
275
-
276
- export withUnderScore = (path) =>
277
-
278
- {dir, base} = pathlib.parse(path)
279
- return mkpath(dir, "_#{base}")
280
-
281
273
  # ---------------------------------------------------------------------------
282
274
 
283
275
  isSystemDir = (dir) ->
package/src/fs.js CHANGED
@@ -316,14 +316,6 @@ export var removeFileWithExt = (path, newExt, hOptions = {}) => {
316
316
  return success;
317
317
  };
318
318
 
319
- // ---------------------------------------------------------------------------
320
- // withUnderScore - add '_' to file name
321
- export var withUnderScore = (path) => {
322
- var base, dir;
323
- ({dir, base} = pathlib.parse(path));
324
- return mkpath(dir, `_${base}`);
325
- };
326
-
327
319
  // ---------------------------------------------------------------------------
328
320
  isSystemDir = function(dir) {
329
321
  return dir === '$Recycle.Bin' || dir === '$WinREAgent';