protected function configAssert($key, $singular)
    {
        $types = $this->config->get($key);
        // No types, nothing to assert. The route _DOES_ expect a string, so
        // we return a regex that never matches.
        if (empty($types)) {
            return '$.';
        }

        $slugs = [];
        foreach ($types as $type) {
            $slugs[] = $type['slug'];
            if ($singular) {
                $slugs[] = $type['singular_slug'];
            }
        }

        return implode('|', $slugs);
    }