@kehto/services 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3527,20 +3527,20 @@ function createCatalogIntentResolver(options) {
3527
3527
  }
3528
3528
 
3529
3529
  // src/manifest-intent-catalog.ts
3530
- function actionFromConvention(slug, convention) {
3531
- if (!/^[a-z0-9][a-z0-9-]*$/.test(slug)) {
3532
- throw new TypeError("manifest archetype slug is invalid");
3533
- }
3530
+ function actionFromConvention(convention) {
3534
3531
  const match = /^napplet:([^/?#\s]+)\/([^/?#\s]+)$/.exec(convention);
3535
- if (!match || match[1] !== slug) {
3536
- throw new TypeError("manifest archetype convention is invalid or mismatched");
3532
+ if (!match) {
3533
+ throw new TypeError("manifest archetype convention is invalid");
3537
3534
  }
3538
3535
  return match[2];
3539
3536
  }
3540
3537
  function manifestToIntentCatalogEntry(manifest) {
3541
3538
  const archetypes = {};
3542
3539
  for (const { slug, convention } of manifest.archetypes) {
3543
- const action = actionFromConvention(slug, convention);
3540
+ if (!/^[a-z0-9][a-z0-9-]*$/.test(slug)) {
3541
+ throw new TypeError("manifest archetype slug is invalid");
3542
+ }
3543
+ const action = actionFromConvention(convention);
3544
3544
  const support = archetypes[slug] ??= {
3545
3545
  actions: [],
3546
3546
  conventions: []