forked from mmistakes/minimal-mistakes
/
url.urlmatcher.html
769 lines (768 loc) · 38.8 KB
/
url.urlmatcher.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
---
---
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>UrlMatcher | @uirouter/react</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<link rel="stylesheet" href="../assets/css/uirouter.css">
<script src="../assets/js/modernizr.js"></script>
<script src="../assets/js/reset.js"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">@uirouter/react</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<!--
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
-->
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Internal UI-Router API</label>
<!--
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
-->
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">@uirouter/react</a>
</li>
<li>
<a href="../modules/url.html">url</a>
</li>
<li>
<a href="url.urlmatcher.html">UrlMatcher</a>
</li>
</ul>
<h1>Class UrlMatcher</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Matches URLs against patterns.</p>
</div>
<p>Matches URLs against patterns and extracts named parameters from the path or the search
part of the URL.</p>
<p>A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query)
parameters. Multiple search parameter names are separated by '&'. Search parameters
do not influence whether or not a URL is matched, but their values are passed through into
the matched parameters returned by <a href="url.urlmatcher.html#exec">UrlMatcher.exec</a>.</p>
<ul>
<li><p><em>Path parameters</em> are defined using curly brace placeholders (<code>/somepath/{param}</code>)
or colon placeholders (<code>/somePath/:param</code>).</p>
</li>
<li><p><em>A parameter RegExp</em> may be defined for a param after a colon
(<code>/somePath/{param:[a-zA-Z0-9]+}</code>) in a curly brace placeholder.
The regexp must match for the url to be matched.
Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.</p>
</li>
</ul>
<p>Note: a RegExp parameter will encode its value using either <a href="params.paramtypes.html#path">ParamTypes.path</a> or <a href="params.paramtypes.html#query">ParamTypes.query</a>.</p>
<ul>
<li><p><em>Custom parameter types</em> may also be specified after a colon (<code>/somePath/{param:int}</code>) in curly brace parameters.
See <a href="url.urlmatcherfactory.html#type">UrlMatcherFactory.type</a> for more information.</p>
</li>
<li><p><em>Catch-all parameters</em> are defined using an asterisk placeholder (<code>/somepath/*catchallparam</code>).
A catch-all * parameter value will contain the remainder of the URL.</p>
</li>
</ul>
<hr>
<p>Parameter names may contain only word characters (latin letters, digits, and underscore) and
must be unique within the pattern (across both path and search parameters).
A path parameter matches any number of characters other than '/'. For catch-all
placeholders the path parameter matches any number of characters.</p>
<p>Examples:</p>
<ul>
<li><code>'/hello/'</code> - Matches only if the path is exactly '/hello/'. There is no special treatment for
trailing slashes, and patterns have to match the entire path, not just a prefix.</li>
<li><code>'/user/:id'</code> - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or
'/user/bob/details'. The second path segment will be captured as the parameter 'id'.</li>
<li><code>'/user/{id}'</code> - Same as the previous example, but using curly brace syntax.</li>
<li><code>'/user/{id:[^/]*}'</code> - Same as the previous example.</li>
<li><code>'/user/{id:[0-9a-fA-F]{1,8}}'</code> - Similar to the previous example, but only matches if the id
parameter consists of 1 to 8 hex digits.</li>
<li><code>'/files/{path:.*}'</code> - Matches any URL starting with '/files/' and captures the rest of the
path into the parameter 'path'.</li>
<li><code>'/files/*path'</code> - ditto.</li>
<li><code>'/calendar/{start:date}'</code> - Matches "/calendar/2014-11-12" (because the pattern defined
in the built-in <code>date</code> ParamType matches <code>2014-11-12</code>) and provides a Date object in $stateParams.start</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">UrlMatcher</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="url.urlmatcher.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="url.urlmatcher.html#pattern" class="tsd-kind-icon">pattern</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class"><a href="url.urlmatcher.html#append" class="tsd-kind-icon">append</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="url.urlmatcher.html#exec" class="tsd-kind-icon">exec</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="url.urlmatcher.html#format" class="tsd-kind-icon">format</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="url.urlmatcher.html#tostring" class="tsd-kind-icon">to<wbr>String</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="url.urlmatcher.html#validates" class="tsd-kind-icon">validates</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="url.urlmatcher.html#compare" class="tsd-kind-icon">compare</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
<a name="constructor" class="tsd-anchor"></a>
<!--
<h3>constructor</h3>
-->
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">new <wbr>Url<wbr>Matcher<span class="tsd-signature-symbol">(</span>pattern<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, paramTypes<span class="tsd-signature-symbol">: </span><a href="params.paramtypes.html" class="tsd-signature-type">ParamTypes</a>, paramFactory<span class="tsd-signature-symbol">: </span><a href="url.paramfactory.html" class="tsd-signature-type">ParamFactory</a>, config<span class="tsd-signature-symbol">?: </span><a href="../interfaces/url.urlmatchercompileconfig.html" class="tsd-signature-type">UrlMatcherCompileConfig</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>pattern <span class="tsd-signature-type">string</span></h5>
: <div class="tsd-comment tsd-typography">
<div class="lead">
<p>The pattern to compile into a matcher.</p>
</div>
</div>
</li>
<li>
<h5>paramTypes <a href="params.paramtypes.html" class="tsd-signature-type">ParamTypes</a></h5>
: <div class="tsd-comment tsd-typography">
<div class="lead">
<p>The <a href="params.paramtypes.html">ParamTypes</a> registry</p>
</div>
</div>
</li>
<li>
<h5>paramFactory <a href="url.paramfactory.html" class="tsd-signature-type">ParamFactory</a></h5>
: <div class="tsd-comment tsd-typography">
<div class="lead">
<p>A <a href="url.paramfactory.html">ParamFactory</a> object</p>
</div>
</div>
</li>
<li>
<h5>config: <span class="tsd-flag ts-flagOptional">Optional</span> <a href="../interfaces/url.urlmatchercompileconfig.html" class="tsd-signature-type">UrlMatcherCompileConfig</a></h5>
: <div class="tsd-comment tsd-typography">
<div class="lead">
<p>A <a href="../interfaces/url.urlmatchercompileconfig.html">UrlMatcherCompileConfig</a> configuration object</p>
</div>
</div>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a></h4>
</div>
<hr>
<aside class="tsd-sources">
<ul>
<li>Defined in ui-router-core/src/url/urlMatcher.ts:230</li>
</ul>
</aside> </li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="pattern" class="tsd-anchor"></a>
<!--
<h3>pattern</h3>
-->
<div class="tsd-signature tsd-kind-icon">pattern<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <div class="tsd-header">
<p> The pattern that was passed into the constructor </p>
</div>
</div>
<div class="tsd-declaration">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The pattern that was passed into the constructor</p>
</div>
</div>
</div>
<aside class="tsd-sources">
<ul>
<li>Defined in ui-router-core/src/url/urlMatcher.ts:134</li>
</ul>
</aside>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="append" class="tsd-anchor"></a>
<!--
<h3>append</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">append<span class="tsd-signature-symbol">(</span>url<span class="tsd-signature-symbol">: </span><a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a></li>
<li class="tsd-header">
<p> Creates a new concatenated UrlMatcher </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates a new concatenated UrlMatcher</p>
</div>
<p>Builds a new UrlMatcher by appending another UrlMatcher to this one.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>url <a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a></h5>
: <div class="tsd-comment tsd-typography">
<p>A <code>UrlMatcher</code> instance to append as a child of the current <code>UrlMatcher</code>.</p>
</div>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a></h4>
</div>
<hr>
<aside class="tsd-sources">
<ul>
<li>Defined in ui-router-core/src/url/urlMatcher.ts:335</li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="exec" class="tsd-anchor"></a>
<!--
<h3>exec</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">exec<span class="tsd-signature-symbol">(</span>path<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, search<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span>, hash<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/params.rawparams.html" class="tsd-signature-type">RawParams</a></li>
<li class="tsd-header">
<p> Tests the specified url/path against this matcher. </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Tests the specified url/path against this matcher.</p>
</div>
<p>Tests if the given url matches this matcher's pattern, and returns an object containing the captured
parameter values. Returns null if the path does not match.</p>
<p>The returned object contains the values
of any search parameters that are mentioned in the pattern, but their value may be null if
they are not present in <code>search</code>. This means that search parameters are always treated
as optional.</p>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h4>Example:</h4>
</a>
<pre><code class="language-js"><span class="hljs-keyword">new</span> UrlMatcher(<span class="hljs-string">'/user/{id}?q&r'</span>).exec(<span class="hljs-string">'/user/bob'</span>, {
<span class="hljs-attr">x</span>: <span class="hljs-string">'1'</span>, <span class="hljs-attr">q</span>: <span class="hljs-string">'hello'</span>
});
<span class="hljs-comment">// returns { id: 'bob', q: 'hello', r: null }</span></code></pre>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>path <span class="tsd-signature-type">string</span></h5>
: <div class="tsd-comment tsd-typography">
<p>The URL path to match, e.g. <code>$location.path()</code>.</p>
</div>
</li>
<li>
<h5>search: <span class="tsd-flag ts-flagDefault value">Default value</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = {}</span></h5>
: <div class="tsd-comment tsd-typography">
<p>URL search parameters, e.g. <code>$location.search()</code>.</p>
</div>
</li>
<li>
<h5>hash: <span class="tsd-flag ts-flagOptional">Optional</span> <span class="tsd-signature-type">string</span></h5>
: <div class="tsd-comment tsd-typography">
<p>URL hash e.g. <code>$location.hash()</code>.</p>
</div>
</li>
<li>
<h5>options: <span class="tsd-flag ts-flagDefault value">Default value</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = {}</span></h5>
: <div class="tsd-comment tsd-typography">
</div>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <a href="../interfaces/params.rawparams.html" class="tsd-signature-type">RawParams</a></h4>
: <p>The captured parameter values.</p>
</div>
<hr>
<aside class="tsd-sources">
<ul>
<li>Defined in ui-router-core/src/url/urlMatcher.ts:381</li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="format" class="tsd-anchor"></a>
<!--
<h3>format</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">format<span class="tsd-signature-symbol">(</span>values<span class="tsd-signature-symbol">?: </span><a href="../interfaces/params.rawparams.html" class="tsd-signature-type">RawParams</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
<li class="tsd-header">
<p> Given a set of parameter values, creates a URL from this UrlMatcher. </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Given a set of parameter values, creates a URL from this UrlMatcher.</p>
</div>
<p>Creates a URL that matches this pattern by substituting the specified values
for the path and search parameters.</p>
<a href="#example" id="example" style="color: inherit; text-decoration: none;">
<h4>Example:</h4>
</a>
<pre><code class="language-js"><span class="hljs-keyword">new</span> UrlMatcher(<span class="hljs-string">'/user/{id}?q'</span>).format({ <span class="hljs-attr">id</span>:<span class="hljs-string">'bob'</span>, <span class="hljs-attr">q</span>:<span class="hljs-string">'yes'</span> });
<span class="hljs-comment">// returns '/user/bob?q=yes'</span></code></pre>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>values: <span class="tsd-flag ts-flagDefault value">Default value</span> <a href="../interfaces/params.rawparams.html" class="tsd-signature-type">RawParams</a><span class="tsd-signature-symbol"> = {}</span></h5>
: <div class="tsd-comment tsd-typography">
<p>the values to substitute for the parameters in this pattern.</p>
</div>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
: <p>the formatted URL (path and optionally search part).</p>
</div>
<hr>
<aside class="tsd-sources">
<ul>
<li>Defined in ui-router-core/src/url/urlMatcher.ts:510</li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="tostring" class="tsd-anchor"></a>
<!--
<h3>to<wbr>String</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">to<wbr>String<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
<li class="tsd-header">
<p> Returns the input pattern string </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the input pattern string</p>
</div>
</div>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</div>
<hr>
<aside class="tsd-sources">
<ul>
<li>Defined in ui-router-core/src/url/urlMatcher.ts:351</li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="validates" class="tsd-anchor"></a>
<!--
<h3>validates</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">validates<span class="tsd-signature-symbol">(</span>params<span class="tsd-signature-symbol">: </span><a href="../interfaces/params.rawparams.html" class="tsd-signature-type">RawParams</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
<li class="tsd-header">
<p> Validates the input parameter values against this UrlMatcher </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Validates the input parameter values against this UrlMatcher</p>
</div>
<p>Checks an object hash of parameters to validate their correctness according to the parameter
types of this <code>UrlMatcher</code>.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>params <a href="../interfaces/params.rawparams.html" class="tsd-signature-type">RawParams</a></h5>
: <div class="tsd-comment tsd-typography">
<p>The object hash of parameters to validate.</p>
</div>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
: <p>Returns <code>true</code> if <code>params</code> validates, otherwise <code>false</code>.</p>
</div>
<hr>
<aside class="tsd-sources">
<ul>
<li>Defined in ui-router-core/src/url/urlMatcher.ts:485</li>
</ul>
</aside> </li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="compare" class="tsd-anchor"></a>
<!--
<h3><span class="tsd-flag ts-flagStatic">Static</span> compare</h3>
-->
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">compare<span class="tsd-signature-symbol">(</span>a<span class="tsd-signature-symbol">: </span><a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a>, b<span class="tsd-signature-symbol">: </span><a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
<li class="tsd-header">
<p> Compare two UrlMatchers </p>
</li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Compare two UrlMatchers</p>
</div>
<p>This comparison function converts a UrlMatcher into static and dynamic path segments.
Each static path segment is a static string between a path separator (slash character).
Each dynamic segment is a path parameter.</p>
<p>The comparison function sorts static segments before dynamic ones.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>a <a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a></h5>
</li>
<li>
<h5>b <a href="url.urlmatcher.html" class="tsd-signature-type">UrlMatcher</a></h5>
</li>
</ul>
<div class="tsd-returns">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
</div>
<hr>
<aside class="tsd-sources">
<ul>
<li>Defined in ui-router-core/src/url/urlMatcher.ts:172</li>
</ul>
</aside> </li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../index.html"><em>@uirouter/react</em></a>
</li>
<li class="label tsd-is-external">
<span>Public API</span>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/common.html">common</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/components.html">components</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/core.html">core</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/params.html">params</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/react.html">react</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/resolve.html">resolve</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/state.html">state</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/transition.html">transition</a>
</li>
<li class="current tsd-kind-external-module">
<a href="../modules/url.html">url</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/view.html">view</a>
</li>
<li class="label tsd-is-external">
<span>Internal UI-<wbr><wbr>Router API</span>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/_ui_router_core_src_common_trace_.html">"ui-<wbr>router-<wbr>core/src/common/trace"</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common_hof.html">common_<wbr>hof</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common_predicates.html">common_<wbr>predicates</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/common_strings.html">common_<wbr>strings</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/hooks.html">hooks</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/path.html">path</a>
</li>
<li class=" tsd-kind-external-module tsd-is-external">
<a href="../modules/vanilla.html">vanilla</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="url.baseurlrule.html" class="tsd-kind-icon">Base<wbr>Url<wbr>Rule</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="url.paramfactory.html" class="tsd-kind-icon">Param<wbr>Factory</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="url.urlconfig.html" class="tsd-kind-icon">Url<wbr>Config</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-class tsd-parent-kind-external-module">
<a href="url.urlmatcher.html" class="tsd-kind-icon">Url<wbr>Matcher</a>
<ul>
<li class=" tsd-kind-constructor tsd-parent-kind-class">
<a href="url.urlmatcher.html#constructor" class="tsd-kind-icon">constructor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="url.urlmatcher.html#pattern" class="tsd-kind-icon">pattern</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="url.urlmatcher.html#append" class="tsd-kind-icon">append</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="url.urlmatcher.html#exec" class="tsd-kind-icon">exec</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="url.urlmatcher.html#format" class="tsd-kind-icon">format</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="url.urlmatcher.html#tostring" class="tsd-kind-icon">to<wbr>String</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="url.urlmatcher.html#validates" class="tsd-kind-icon">validates</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a href="url.urlmatcher.html#compare" class="tsd-kind-icon">compare</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="url.urlmatcherfactory.html" class="tsd-kind-icon">Url<wbr>Matcher<wbr>Factory</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="url.urlrouter.html" class="tsd-kind-icon">Url<wbr>Router</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external">
<a href="url.urlrulefactory.html" class="tsd-kind-icon">Url<wbr>Rule<wbr>Factory</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="url.urlrules.html" class="tsd-kind-icon">Url<wbr>Rules</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-external-module">
<a href="url.urlservice.html" class="tsd-kind-icon">Url<wbr>Service</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="../interfaces/url.matchresult.html" class="tsd-kind-icon">Match<wbr>Result</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="../interfaces/url.matcherurlrule.html" class="tsd-kind-icon">Matcher<wbr>Url<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="../interfaces/url.regexprule.html" class="tsd-kind-icon">Reg<wbr>Exp<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="../interfaces/url.staterule.html" class="tsd-kind-icon">State<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="../interfaces/url.urlconfigapi.html" class="tsd-kind-icon">Url<wbr>Config<wbr>Api</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="../interfaces/url.urlmatchercompileconfig.html" class="tsd-kind-icon">Url<wbr>Matcher<wbr>Compile<wbr>Config</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="../interfaces/url.urlmatcherconfig.html" class="tsd-kind-icon">Url<wbr>Matcher<wbr>Config</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="../interfaces/url.urlparts.html" class="tsd-kind-icon">Url<wbr>Parts</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="../interfaces/url.urlrule.html" class="tsd-kind-icon">Url<wbr>Rule</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="../interfaces/url.urlrulehandlerfn.html" class="tsd-kind-icon">Url<wbr>Rule<wbr>Handler<wbr>Fn</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="../interfaces/url.urlrulematchfn.html" class="tsd-kind-icon">Url<wbr>Rule<wbr>Match<wbr>Fn</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="../interfaces/url.urlrulesapi.html" class="tsd-kind-icon">Url<wbr>Rules<wbr>Api</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external">
<a href="../interfaces/url.urlsyncapi.html" class="tsd-kind-icon">Url<wbr>Sync<wbr>Api</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module tsd-is-external">
<a href="../modules/url.html#urlruletype" class="tsd-kind-icon">Url<wbr>Rule<wbr>Type</a>
</li>
<li class=" tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported">
<a href="../modules/url.html#defaultrulesortfn" class="tsd-kind-icon">default<wbr>Rule<wbr>Sort<wbr>Fn</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="http://typedoc.io" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>