def matches()

in mozilla_schema_generator/matcher.py [0:0]


    def matches(self, probe: Probe) -> bool:
        # Not a match if the types don't match
        if self.type and self.type != probe.get_type():
            return False

        for k, v in self.matcher.items():
            probe_value = probe.get(k)

            if not self._matches(v, probe_value):
                return False

            # Definitions are nested, check sub-fields (e.g. details)
            if isinstance(v, dict):
                for sub_k, sub_v in v.items():
                    if sub_k not in self.keywords and not self._matches(
                        sub_v, probe_value[sub_k]
                    ):
                        return False

        return True