INNER CODE UNIT · JavaScript

validateObjectProperties

Arenukvern/mcp_flutter · showcase/flutter_test_app/web/intentcall_webmcp.generated.js:121

  function validateObjectProperties(pathPrefix, schema, args) {
    args = args && typeof args === 'object' && !Array.isArray(args) ? args : {};
    var properties = schema.properties || {};
    if (schema.additionalProperties === false) {
      for (var key in args) {
        if (Object.prototype.hasOwnProperty.call(args, key) &&
            !Object.prototype.hasOwnProperty.call(properties, key)) {
          var at = pathPrefix ? ' at "' + pathPrefix + '"' : '';
          return validationError('Unknown property "' + key + '"' + at + '.');
        }
      }
    }
    var required = schema.required;
    if (required && required.length) {
      for (var r = 0; r < required.length; r += 1) {
        var name = required[r];
        if (!Object.prototype.hasOwnProperty.call(args, name)) {
          var atReq = pathPrefix ? ' at "' + pathPrefix + '"' : '';

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…