Build JsPath from raw string

16 views
Skip to first unread message

Florian Mériaux

unread,
Feb 15, 2018, 3:56:47 PM2/15/18
to Play Framework
Is there a way to build a `JsPath` from a raw string ?

Example :

From `"/foo/bar"` get `JsPath \ "foo" \ "bar"`

Is it conceivable to support this, if it is not already the case ?

If so, it would also be interesting to have a format to read / write a path.

Greg Methvin

unread,
Feb 16, 2018, 5:11:40 AM2/16/18
to play-framework
I'm not aware of any existing library to do it, but it's definitely possible to parse a string like that and generate a JsPath. You'll want to consider what the syntax should look like for index nodes, path nodes, and recursive nodes (assuming you want to support all those), and decide how to handle node names with slashes in them (e.g. `/foo/"bar/baz"`).


--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/241b3f41-6680-4e01-9f06-dbf7eef11af3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages