Skip to content

Commit

Permalink
fix(watchpack): pin chokidar to 3.3.1 until watchpack gets their duck…
Browse files Browse the repository at this point in the history
…s in a row.

without this yarn resolution, karma runner fails on mac with 'fsevents is not a constructor'
see: webpack/watchpack#153 webpack/watchpack#130
  • Loading branch information
christopherthielen committed Apr 19, 2020
1 parent 1a05737 commit 5ee2d12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/url/urlRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
* @internalapi
*/
export class UrlRuleFactory {
static isUrlRule = (obj) => obj && ['type', 'match', 'handler'].every((key) => isDefined(obj[key]));
static isUrlRule = obj => obj && ['type', 'match', 'handler'].every(key => isDefined(obj[key]));

constructor(public router: UIRouter) {}

Expand Down Expand Up @@ -108,9 +108,9 @@ export class UrlRuleFactory {
// - Some optional parameters, some matched
// - Some optional parameters, all matched
function matchPriority(params: RawParams): number {
const optional = urlMatcher.parameters().filter((param) => param.isOptional);
const optional = urlMatcher.parameters().filter(param => param.isOptional);
if (!optional.length) return 0.000001;
const matched = optional.filter((param) => params[param.id]);
const matched = optional.filter(param => params[param.id]);
return matched.length / optional.length;
}

Expand Down Expand Up @@ -216,7 +216,7 @@ export class BaseUrlRule implements UrlRule {
_group: number;
type: UrlRuleType = 'RAW';
handler: UrlRuleHandlerFn;
matchPriority = (match) => 0 - this.$id;
matchPriority = match => 0 - this.$id;

constructor(public match: UrlRuleMatchFn, handler?: UrlRuleHandlerFn) {
this.handler = handler || identity;
Expand Down
2 changes: 1 addition & 1 deletion test/urlRuleSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('UrlRuleFactory', () => {

it('should create a UrlRule from a UrlRuleMatchFn', () => {
const factory = setup();
const rule = factory.create((url) => url.path === '/foo/bar/baz');
const rule = factory.create(url => url.path === '/foo/bar/baz');
expect(rule.type).toBe('RAW');
expect(rule.match({ path: '/foo/bar/baz' })).toBeTruthy();
expect(rule.match({ path: '/nope/bar/baz' })).toBeFalsy();
Expand Down

0 comments on commit 5ee2d12

Please sign in to comment.