build: enable JS semicolons (#22783)
This commit is contained in:
parent
24e21467b9
commit
5d657dece4
354 changed files with 21512 additions and 21510 deletions
|
@ -1,22 +1,22 @@
|
|||
import { expect } from 'chai'
|
||||
import { expect } from 'chai';
|
||||
|
||||
describe('feature-string parsing', () => {
|
||||
it('is indifferent to whitespace around keys and values', () => {
|
||||
const parseFeaturesString = require('../lib/common/parse-features-string')
|
||||
const parseFeaturesString = require('../lib/common/parse-features-string');
|
||||
const checkParse = (string: string, parsed: Record<string, string | boolean>) => {
|
||||
const features: Record<string, string | boolean> = {}
|
||||
parseFeaturesString(string, (k: string, v: any) => { features[k] = v })
|
||||
expect(features).to.deep.equal(parsed)
|
||||
}
|
||||
checkParse('a=yes,c=d', { a: true, c: 'd' })
|
||||
checkParse('a=yes ,c=d', { a: true, c: 'd' })
|
||||
checkParse('a=yes, c=d', { a: true, c: 'd' })
|
||||
checkParse('a=yes , c=d', { a: true, c: 'd' })
|
||||
checkParse(' a=yes , c=d', { a: true, c: 'd' })
|
||||
checkParse(' a= yes , c=d', { a: true, c: 'd' })
|
||||
checkParse(' a = yes , c=d', { a: true, c: 'd' })
|
||||
checkParse(' a = yes , c =d', { a: true, c: 'd' })
|
||||
checkParse(' a = yes , c = d', { a: true, c: 'd' })
|
||||
checkParse(' a = yes , c = d ', { a: true, c: 'd' })
|
||||
})
|
||||
})
|
||||
const features: Record<string, string | boolean> = {};
|
||||
parseFeaturesString(string, (k: string, v: any) => { features[k] = v; });
|
||||
expect(features).to.deep.equal(parsed);
|
||||
};
|
||||
checkParse('a=yes,c=d', { a: true, c: 'd' });
|
||||
checkParse('a=yes ,c=d', { a: true, c: 'd' });
|
||||
checkParse('a=yes, c=d', { a: true, c: 'd' });
|
||||
checkParse('a=yes , c=d', { a: true, c: 'd' });
|
||||
checkParse(' a=yes , c=d', { a: true, c: 'd' });
|
||||
checkParse(' a= yes , c=d', { a: true, c: 'd' });
|
||||
checkParse(' a = yes , c=d', { a: true, c: 'd' });
|
||||
checkParse(' a = yes , c =d', { a: true, c: 'd' });
|
||||
checkParse(' a = yes , c = d', { a: true, c: 'd' });
|
||||
checkParse(' a = yes , c = d ', { a: true, c: 'd' });
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue