simplest validator for javascript (amd, commonjs, global)