xrfragment/test/test.js

19 lines
460 B
JavaScript
Raw Normal View History

2023-03-09 19:58:08 +01:00
// in the browser use this instead of require():
//
2023-03-31 19:13:42 +02:00
// <script src="dist/xrfragment.js"></script>
2023-03-09 19:58:08 +01:00
// <script>
2023-03-31 19:13:42 +02:00
// var XR = xrfragment;
2023-03-09 19:58:08 +01:00
// </script>
2023-03-31 19:13:42 +02:00
var XF = require('../dist/xrfragment').xrfragment
2023-03-09 19:58:08 +01:00
2023-03-31 19:13:42 +02:00
let print = (e) => console.log( JSON.stringify(e, null, 1) + "\n" )
2023-03-09 19:58:08 +01:00
2023-04-14 15:19:52 +02:00
print( XF.URI.parse('://foo.com/1.gltf#pos=1.0,2.0,3.0&q=-.foo&t=1,100',true) );
2023-03-09 19:58:08 +01:00
2023-03-31 19:13:42 +02:00
// query
let q = new XF.Query();
print( q.parse("-.foo -plane") )
print( q.parse("price:>2") )