How to use the jsii-reflect.isProperty function in jsii-reflect

To help you get started, we’ve selected a few jsii-reflect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / jsii / packages / jsii-diff / lib / classes-ifaces.ts View on Github external
if (original.docs.subclassable && !updated.docs.subclassable) {
    context.mismatches.report({
      ruleKey: 'remove-subclassable',
      message: 'has gone from @subclassable to non-@subclassable',
      violator: original,
    });
  }

  for (const [origMethod, updatedElement] of memberPairs(original, original.allMethods, updated, context)) {
    if (reflect.isMethod(origMethod) && reflect.isMethod(updatedElement)) {
      compareMethod(origMethod, updatedElement, context);
    }
  }

  for (const [origProp, updatedElement] of memberPairs(original, original.allProperties, updated, context)) {
    if (reflect.isProperty(origProp) && reflect.isProperty(updatedElement)) {
      compareProperty(origProp, updatedElement, context);
    }
  }

  // You cannot have added abstract members to the class/interface, as they are
  // an added burden on potential implementors.
  //
  // Only for types that are explicitly marked as intended to be subclassed by customers.
  if (subclassableType(original)) {
    noNewAbstractMembers(original, updated, context);
  }
}