Skip to content

Commit 564546c

Browse files
authored
Update README.md
1 parent 65a8092 commit 564546c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@ which provides higher fidelity input, allowing FSTree to also detect changes.
7878
[walkSync.entries](https://github.com/joliss/node-walk-sync#entries).)
7979

8080
```js
81-
var walkSync = require('walk-sync');
81+
const walkSync = require('walk-sync');
8282

8383
// path/to/root/foo.js
8484
// path/to/root/bar.js
85-
var current = new FSTree({
85+
const current = new FSTree({
8686
entries: walkSync.entries('path/to/root')
8787
});
8888

8989
writeFileSync('path/to/root/foo.js', 'new content');
9090
writeFileSync('path/to/root/baz.js', 'new file');
9191

92-
var next = new FSTree({
92+
const next = new FSTree({
9393
entries: walkSync.entries('path/to/root')
9494
});
9595

@@ -196,11 +196,11 @@ They must also implement the following API:
196196
`FSTree.fromEntries` composes well with the output of `walkSync.entries`:
197197

198198
```js
199-
var walkSync = require('walk-sync');
199+
const walkSync = require('walk-sync');
200200

201201
// path/to/root/foo.js
202202
// path/to/root/bar.js
203-
var current = FSTree.fromEntries(walkSync.entries('path/to/root'));
203+
const current = FSTree.fromEntries(walkSync.entries('path/to/root'));
204204
```
205205

206206
## Change Calculation
@@ -222,7 +222,7 @@ User specified `isEqual` will often want to use the default `isEqual`, so it is
222222
Example
223223

224224
```js
225-
var defaultIsEqual = FSTree.defaultIsEqual;
225+
const defaultIsEqual = FSTree.defaultIsEqual;
226226

227227
function isEqualCheckingMeta(a, b) {
228228
return defaultIsEqual(a, b) && isMetaEqual(a, b);
@@ -239,9 +239,9 @@ When you want to apply changes from one tree to another easily, you can use the
239239
`FSTree.applyPatch` method. For example, given:
240240

241241
```js
242-
var patch = oldInputTree.calculatePatch(newInputTree);
243-
var inputDir = 'src';
244-
var outputDir = 'dist';
242+
const patch = oldInputTree.calculatePatch(newInputTree);
243+
const inputDir = 'src';
244+
const outputDir = 'dist';
245245
FSTree.applyPatch(inputDir, outputDir, patch);
246246
```
247247

@@ -250,16 +250,16 @@ non-destructive operations (`mkdir`, `create`, `change`). If you want to calcula
250250
and apply a patch without any intermediate operations, you can do:
251251

252252
```js
253-
var inputDir = 'src';
254-
var outputDir = 'dist';
253+
const inputDir = 'src';
254+
const outputDir = 'dist';
255255
oldInputTree.calculateAndApplyPatch(newInputTree, inputDir, outputDir);
256256
```
257257

258258
You can optionally provide a delegate object to handle applying specific types
259259
of operations:
260260

261261
```js
262-
var createCount = 0;
262+
let createCount = 0;
263263
FSTree.applyPatch(inputDir, outputDir, patch, {
264264
create: function(inputPath, outputPath, relativePath) {
265265
createCount++;

0 commit comments

Comments
 (0)