function anonymous(self,RULES,formats,root,refVal,defaults,customRules,equal,ucs2length,ValidationError ) { var validate = function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; var vErrors = null; var errors = 0; if (rootData === undefined) rootData = data; if ((data && typeof data === "object" && !Array.isArray(data))) { var errs__0 = errors;var valid1 = true; var data1 = data.city; if ( data1 === undefined ) { valid1 = true; } else { var errs_1 = errors; if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { var errs__1 = errors;var valid2 = true; if ( data1.confidence === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.confidence !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.city.confidence' , schemaPath: '#/properties/city/properties/confidence/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { if ( data1.geoname_id === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.geoname_id !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.city.geoname_id' , schemaPath: '#/properties/city/properties/geoname_id/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { var data2 = data1.names; if ( data2 === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { var errs__2 = errors;var valid3 = true; if ( data2.en === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2.en !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.city.names.en' , schemaPath: '#/properties/city/properties/names/properties/en/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { if ( data2.ja === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2.ja !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.city.names.ja' , schemaPath: '#/properties/city/properties/names/properties/ja/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { }} if (errs__2 == errors) { } } else { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.city.names' , schemaPath: '#/properties/city/properties/names/type' , params: { type: 'object' } , message: 'should be object' } ]; return false; } if (errors === errs_2) { } var valid2 = errors === errs_2; } if (valid2) { }}} if (errs__1 == errors) { } } else { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.city' , schemaPath: '#/properties/city/type' , params: { type: 'object' } , message: 'should be object' } ]; return false; } if (errors === errs_1) { } var valid1 = errors === errs_1; } if (valid1) { var data1 = data.continent; if ( data1 === undefined ) { valid1 = true; } else { var errs_1 = errors; if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { var errs__1 = errors;var valid2 = true; if ( data1.code === undefined ) { valid2 = true; } else { var errs_2 = errors; if (typeof data1.code !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.code' , schemaPath: '#/properties/continent/properties/code/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { if ( data1.geoname_id === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.geoname_id !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.geoname_id' , schemaPath: '#/properties/continent/properties/geoname_id/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { var data2 = data1.names; if ( data2 === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { var errs__2 = errors;var valid3 = true; if ( data2.de === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2.de !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.names.de' , schemaPath: '#/properties/continent/properties/names/properties/de/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { if ( data2.en === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2.en !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.names.en' , schemaPath: '#/properties/continent/properties/names/properties/en/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { if ( data2.es === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2.es !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.names.es' , schemaPath: '#/properties/continent/properties/names/properties/es/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { if ( data2.fr === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2.fr !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.names.fr' , schemaPath: '#/properties/continent/properties/names/properties/fr/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { if ( data2.ja === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2.ja !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.names.ja' , schemaPath: '#/properties/continent/properties/names/properties/ja/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { if ( data2['pt-BR'] === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2['pt-BR'] !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.names[\'pt-BR\']' , schemaPath: '#/properties/continent/properties/names/properties/pt-BR/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { if ( data2.ru === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2.ru !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.names.ru' , schemaPath: '#/properties/continent/properties/names/properties/ru/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { if ( data2['zh-CN'] === undefined ) { valid3 = true; } else { var errs_3 = errors; if (typeof data2['zh-CN'] !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.names[\'zh-CN\']' , schemaPath: '#/properties/continent/properties/names/properties/zh-CN/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid3 = errors === errs_3; } if (valid3) { }}}}}}}} if (errs__2 == errors) { } } else { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent.names' , schemaPath: '#/properties/continent/properties/names/type' , params: { type: 'object' } , message: 'should be object' } ]; return false; } if (errors === errs_2) { } var valid2 = errors === errs_2; } if (valid2) { }}} if (errs__1 == errors) { } } else { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.continent' , schemaPath: '#/properties/continent/type' , params: { type: 'object' } , message: 'should be object' } ]; return false; } if (errors === errs_1) { } var valid1 = errors === errs_1; } if (valid1) { var data1 = data.location; if ( data1 === undefined ) { valid1 = true; } else { var errs_1 = errors; if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { var errs__1 = errors;var valid2 = true; if ( data1.accuracy_radius === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.accuracy_radius !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.location.accuracy_radius' , schemaPath: '#/properties/location/properties/accuracy_radius/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { if ( data1.average_income === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.average_income !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.location.average_income' , schemaPath: '#/properties/location/properties/average_income/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { if ( data1.latitude === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.latitude !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.location.latitude' , schemaPath: '#/properties/location/properties/latitude/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { if ( data1.longitude === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.longitude !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.location.longitude' , schemaPath: '#/properties/location/properties/longitude/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { if ( data1.metro_code === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.metro_code !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.location.metro_code' , schemaPath: '#/properties/location/properties/metro_code/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { if ( data1.population_density === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.population_density !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.location.population_density' , schemaPath: '#/properties/location/properties/population_density/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { if ( data1.time_zone === undefined ) { valid2 = true; } else { var errs_2 = errors; if (typeof data1.time_zone !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.location.time_zone' , schemaPath: '#/properties/location/properties/time_zone/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { }}}}}}} if (errs__1 == errors) { } } else { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.location' , schemaPath: '#/properties/location/type' , params: { type: 'object' } , message: 'should be object' } ]; return false; } if (errors === errs_1) { } var valid1 = errors === errs_1; } if (valid1) { var data1 = data.postal; if ( data1 === undefined ) { valid1 = true; } else { var errs_1 = errors; if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { var errs__1 = errors;var valid2 = true; if ( data1.confidence === undefined ) { valid2 = true; } else { var errs_2 = errors; if ((typeof data1.confidence !== "number")) { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.postal.confidence' , schemaPath: '#/properties/postal/properties/confidence/type' , params: { type: 'number' } , message: 'should be number' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { if ( data1.code === undefined ) { valid2 = true; } else { var errs_2 = errors; if (typeof data1.code !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.postal.code' , schemaPath: '#/properties/postal/properties/code/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid2 = errors === errs_2; } if (valid2) { }} if (errs__1 == errors) { } } else { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.postal' , schemaPath: '#/properties/postal/type' , params: { type: 'object' } , message: 'should be object' } ]; return false; } if (errors === errs_1) { } var valid1 = errors === errs_1; } if (valid1) { if ( data.url === undefined ) { valid1 = true; } else { var errs_1 = errors; if (typeof data.url !== "string") { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + '.url' , schemaPath: '#/properties/url/type' , params: { type: 'string' } , message: 'should be string' } ]; return false; } var valid1 = errors === errs_1; } if (valid1) { }}}}} if (errs__0 == errors) { } } else { validate.errors = [ { keyword: 'type' , dataPath: (dataPath || '') + "" , schemaPath: '#/type' , params: { type: 'object' } , message: 'should be object' } ]; return false; } if (errors === 0) { } validate.errors = vErrors; return errors === 0; }; return validate; }