-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(router): working route change from set context
affects: @tao.js/router, patois.web tao-router able to update the route path when a subscribed taople is set using data from the taople
- Loading branch information
Showing
7 changed files
with
367 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# tao-router | ||
|
||
## node console testing | ||
|
||
```sh | ||
> let re = /\{([\w|\.]+)}/gm | ||
undefined | ||
> re | ||
/\{([\w|\.]+)}/gm | ||
> let path = /{t}/path/{term.id}/{action.go}/ | ||
let path = /{t}/path/{term.id}/{action.go}/ | ||
^ | ||
|
||
SyntaxError: Invalid regular expression flags | ||
|
||
> let url = '/{t}/path/{term.id}/{action.go}/ | ||
let url = '/{t}/path/{term.id}/{action.go}/ | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
SyntaxError: Invalid or unexpected token | ||
|
||
> let earl = '/{t}/path/{term.id}/{action.go}/' | ||
undefined | ||
> earl | ||
'/{t}/path/{term.id}/{action.go}/' | ||
> re.match(earl) | ||
TypeError: re.match is not a function | ||
> re.test(earl) | ||
true | ||
> re.exec(earl) | ||
[ '{term.id}', | ||
'term.id', | ||
index: 10, | ||
input: '/{t}/path/{term.id}/{action.go}/' ] | ||
> re = /\({([\w|\.]+)})*/gm | ||
SyntaxError: Invalid regular expression: /\({([\w|\.]+)})*/: Unmatched ')' | ||
> re = /\({([\w|\.]+)\})*/gm | ||
SyntaxError: Invalid regular expression: /\({([\w|\.]+)\})*/: Unmatched ')' | ||
> re = /(\{([\w|\.]+)\})*/gm | ||
/(\{([\w|\.]+)\})*/gm | ||
> re.exec(earl) | ||
[ '', | ||
undefined, | ||
undefined, | ||
index: 0, | ||
input: '/{t}/path/{term.id}/{action.go}/' ] | ||
> re = /(\{([\w|\.]+)\})*/gm | ||
/(\{([\w|\.]+)\})*/gm | ||
> re.exec(earl) | ||
[ '', | ||
undefined, | ||
undefined, | ||
index: 0, | ||
input: '/{t}/path/{term.id}/{action.go}/' ] | ||
> earl.match(re) | ||
[ '', | ||
'{t}', | ||
'', | ||
'', | ||
'', | ||
'', | ||
'', | ||
'', | ||
'{term.id}', | ||
'', | ||
'{action.go}', | ||
'', | ||
'' ] | ||
> earl.split('/') | ||
[ '', '{t}', 'path', '{term.id}', '{action.go}', '' ] | ||
> earl.match(/\//g).length | ||
5 | ||
> earl.match(/\//g).length + earl.split('/') | ||
'5,{t},path,{term.id},{action.go},' | ||
> earl.match(/\//g).length + earl.split('/').length | ||
11 | ||
> earl.match(re).length | ||
13 | ||
> re = /(\{([\w|\.]+)\})/gm | ||
/(\{([\w|\.]+)\})/gm | ||
> earl.match(re) | ||
[ '{t}', '{term.id}', '{action.go}' ] | ||
> | ||
(To exit, press ^C again or type .exit) | ||
> | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.