glsl-token-whitespace-trim
Trim the whitespace within an array of GLSL tokens provided by glsl-tokenizer. Useful for minimising shader source size, especially after heavy processing steps such as seen in glslify or as part of a GLSL minifier.
Usage
trim(tokens, [all])
Trims the whitespace in an array of GLSL tokens
. By default, this will trim repeated to newlines such that no more than two newlines will appear in a row.
If you're more concerned about size than aesthetics, you can pass true
as the second argument to remove all extraneous whitespace (more or less).
const tokenize =const string =const trim =const fs =const src = fsconst tokens =const trimmed =
License
MIT, see LICENSE.md for details.