3 var KNOWN_TYPES = ['undefined', 'string', 'number', 'object', 'function', 'boolean', 'symbol'];
5 module.exports = function defFunc(ajv) {
7 inline: function (it, keyword, schema) {
8 var data = 'data' + (it.dataLevel || '');
9 if (typeof schema == 'string') return 'typeof ' + data + ' == "' + schema + '"';
10 schema = 'validate.schema' + it.schemaPath + '.' + keyword;
11 return schema + '.indexOf(typeof ' + data + ') >= 0';
30 ajv.addKeyword('typeof', defFunc.definition);