path-class 0.8.0 → 0.8.1

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.
Files changed (2) hide show
  1. package/README.md +2 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -24,10 +24,8 @@ console.log(`Building to: ${distDir}`);
24
24
 
25
25
  // Get XDG dirs, read JSON with fallback, write JSON
26
26
  const info = Path.xdg.data.join("my-tool/info.json");
27
- const config: { counter: number } = await info.readJSON({
28
- fallback: { counter: 0 },
29
- });
30
- config.counter++;
27
+ const config: { counter?: number } = await info.readJSON({ fallback: {} });
28
+ config.counter = (config.counter ?? 0) + 1;
31
29
  await info.writeJSON(config);
32
30
 
33
31
  // Extensive example: create temp dirs and files, fetch into path, chaining,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "path-class",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "author": "Lucas Garron <code@garron.net>",
5
5
  "type": "module",
6
6
  "main": "./dist/lib/path-class/index.js",