added build badge

This commit is contained in:
Leon van Kammen 2023-03-31 17:35:39 +02:00
parent c026d900f1
commit 8379c8a39b
2 changed files with 3 additions and 2 deletions

View file

@ -11,6 +11,7 @@
1. `=` is used to split fragment key/values
1. fragment-values are urlencoded (space becomes `+` using `encodeUriComponent` e.g.)
1. every recognized fragment key/value-pair is added to a central map/associative array/object
[https://github.com/coderofsalvation/xrfragment/workflows/test/badge.svg](https://github.com/coderofsalvation/xrfragment)
# XR Fragments (key/value params)

View file

@ -5,11 +5,11 @@ import xrfragment.Parser;
@:expose // <- makes the class reachable from plain JavaScript
@:keep // <- avoids accidental removal by dead code elimination
//
// # `protocol://domain.com/some3d.asset#pos=1,0,0&prio=-5`
// # `://foo.com/my3d.asset#pos=1,0,0&prio=-5`
class URI {
@:keep // # URI parser
public static function parse(qs:String):haxe.DynamicAccess<Dynamic> { //
var fragment:Array<String> = qs.split("#"); // > icanhazcode? yes, see [URI.hx](./../src/xrfragment/URI.hx)
var fragment:Array<String> = qs.split("#"); // > icanhazcode? yes, see [URI.hx](https://github.com/coderofsalvation/xrfragment/blob/main/src/xrfragment/URI.hx)
var splitArray:Array<String> = fragment[1].split('&'); //
var resultMap:haxe.DynamicAccess<Dynamic> = {}; // 1. fragment URI starts with `#`
for (i in 0...splitArray.length) { // 1. fragments are split by `&`