Skip to content

Commit 814f5f7

Browse files
committed
lint
1 parent 67fcce6 commit 814f5f7

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ const braces = require('braces');
55
const picomatch = require('picomatch');
66
const utils = require('picomatch/lib/utils');
77

8-
const isEmptyString = (v) => v === "" || v === "./";
9-
const hasBraces = (v) => {
10-
const index = v.indexOf("{");
11-
return index > -1 && v.indexOf("}", index) > -1;
8+
const isEmptyString = v => v === '' || v === './';
9+
const hasBraces = v => {
10+
const index = v.indexOf('{');
11+
return index > -1 && v.indexOf('}', index) > -1;
1212
};
13+
1314
/**
1415
* Returns an array of strings that match one or more glob patterns.
1516
*

test/braces.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@ const mm = require('..');
55
const { isMatch, hasBraces } = mm;
66

77
describe('braces', () => {
8-
it("should return true when braces are found", () => {
9-
assert.equal(hasBraces("{foo}"), true);
10-
assert.equal(hasBraces("foo}"), false);
11-
assert.equal(hasBraces("{foo"), false);
12-
assert.equal(hasBraces("a{}b"), true);
13-
assert.equal(hasBraces("abc {foo} xyz"), true);
14-
assert.equal(hasBraces("abc {foo xyz"), false);
15-
assert.equal(hasBraces("abc {foo} xyz"), true);
16-
assert.equal(hasBraces("abc foo} xyz"), false);
17-
assert.equal(hasBraces("abc foo xyz"), false);
18-
assert.equal(hasBraces("abc {foo} xyz {bar} pqr"), true);
19-
assert.equal(hasBraces("abc {foo xyz {bar} pqr"), true);
20-
assert.equal(hasBraces("abc foo} xyz {bar pqr"), false);
21-
});
22-
8+
it('should return true when braces are found', () => {
9+
assert.equal(hasBraces('{foo}'), true);
10+
assert.equal(hasBraces('foo}'), false);
11+
assert.equal(hasBraces('{foo'), false);
12+
assert.equal(hasBraces('a{}b'), true);
13+
assert.equal(hasBraces('abc {foo} xyz'), true);
14+
assert.equal(hasBraces('abc {foo xyz'), false);
15+
assert.equal(hasBraces('abc {foo} xyz'), true);
16+
assert.equal(hasBraces('abc foo} xyz'), false);
17+
assert.equal(hasBraces('abc foo xyz'), false);
18+
assert.equal(hasBraces('abc {foo} xyz {bar} pqr'), true);
19+
assert.equal(hasBraces('abc {foo xyz {bar} pqr'), true);
20+
assert.equal(hasBraces('abc foo} xyz {bar pqr'), false);
21+
});
2322

2423
it('should handle extglobs in braces', () => {
2524
let fixtures = ['a', 'b', 'c', 'd', 'ab', 'ac', 'ad', 'bc', 'cb', 'bc,d', 'c,db', 'c,d', 'd)', '(b|c', '*(b|c', 'b|c', 'b|cc', 'cb|c', 'x(a|b|c)', 'x(a|c)', '(a|b|c)', '(a|c)'];

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy