diff --git a/src/url/urlRule.ts b/src/url/urlRule.ts index 56708347..60e94af2 100644 --- a/src/url/urlRule.ts +++ b/src/url/urlRule.ts @@ -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) {} @@ -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; } @@ -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; diff --git a/test/urlRuleSpec.ts b/test/urlRuleSpec.ts index f47603c5..99925f96 100644 --- a/test/urlRuleSpec.ts +++ b/test/urlRuleSpec.ts @@ -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();