Closed samreid closed 8 years ago
Query String Machine has been designed as a zero-dependency module for ease of use in any project. From the README https://github.com/phetsims/query-string-machine
Query String parser that supports type coercion, defaults, error checking, etc. based on a schema. Small and dependency-free.
window.assert
and assert
both check for the existence of a global named assert. However, the latter errors out if the global is not found.
I'm curious to know your thoughts and recommendations @pixelzoom.
Recommended to add this at the top of QueryStringMachine:
// Query String Machine has been designed as a zero-dependency module for ease of use in any project.
// window.assert and assert both check for the existence of a global named assert. However, the latter errors out if the global is not found.
var assert = window.assert;
... then use PhET's typical assert && assert( ... )
pattern.
Nice idea, committed above, anything else to do here?
👍 Closing.
From https://github.com/phetsims/query-string-machine/issues/9#issuecomment-249651783
@pixelzoom said:
Also wondering about why
window.assert && assert()
is being used, seem atypical and inconsistent. Should be eitherwindow.assert && window.assert(...)
orassert && assert(...)
. E.g.