@fern-api/fdr-sdk 1.2.94-cdc1690f8b → 1.2.96-133bf6a1f0
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/js/converters/index.js +11 -0
- package/dist/js/converters/index.js.map +1 -1
- package/dist/js/converters/index.mjs +11 -0
- package/dist/js/converters/index.mjs.map +1 -1
- package/dist/js/index.js +11 -0
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.mjs +11 -0
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/navigation/index.js +11 -0
- package/dist/js/navigation/index.js.map +1 -1
- package/dist/js/navigation/index.mjs +11 -0
- package/dist/js/navigation/index.mjs.map +1 -1
- package/dist/types/navigation/versions/v1/converters/SlugGenerator.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -13128,6 +13128,9 @@ var NodeIdGenerator = class {
|
|
|
13128
13128
|
};
|
|
13129
13129
|
|
|
13130
13130
|
// src/navigation/versions/v1/converters/SlugGenerator.ts
|
|
13131
|
+
function isScopedTo(slug, prefix) {
|
|
13132
|
+
return prefix.length > 0 && (slug === prefix || slug.startsWith(`${prefix}/`));
|
|
13133
|
+
}
|
|
13131
13134
|
var SlugGenerator = class _SlugGenerator {
|
|
13132
13135
|
constructor(baseSlug, productSlug, versionSlug, slug) {
|
|
13133
13136
|
this.baseSlug = baseSlug;
|
|
@@ -13198,6 +13201,7 @@ var SlugGenerator = class _SlugGenerator {
|
|
|
13198
13201
|
}
|
|
13199
13202
|
return fullSlug;
|
|
13200
13203
|
};
|
|
13204
|
+
const relativeProductSlug = this.productSlug != null && this.baseSlug.length > 0 && isScopedTo(this.productSlug, this.baseSlug) ? this.productSlug.substring(this.baseSlug.length + 1) : this.productSlug;
|
|
13201
13205
|
if (this.productSlug != null && this.versionSlug != null) {
|
|
13202
13206
|
if (slug.startsWith(this.productSlug)) {
|
|
13203
13207
|
const remaining = getRemainingAfterProduct(slug);
|
|
@@ -13207,6 +13211,10 @@ var SlugGenerator = class _SlugGenerator {
|
|
|
13207
13211
|
const remaining = getRemainingAfterBase(slug);
|
|
13208
13212
|
return createWithSlug(navigation_exports.V1.slugjoin(this.baseSlug, remaining));
|
|
13209
13213
|
}
|
|
13214
|
+
if (relativeProductSlug != null && isScopedTo(slug, relativeProductSlug)) {
|
|
13215
|
+
const remaining = slug.substring(relativeProductSlug.length);
|
|
13216
|
+
return createWithSlug(navigation_exports.V1.slugjoin(this.versionSlug, remaining));
|
|
13217
|
+
}
|
|
13210
13218
|
return createWithSlug(navigation_exports.V1.slugjoin(this.versionSlug, slug));
|
|
13211
13219
|
}
|
|
13212
13220
|
if (this.versionSlug != null) {
|
|
@@ -13225,6 +13233,9 @@ var SlugGenerator = class _SlugGenerator {
|
|
|
13225
13233
|
if (this.baseSlug.length > 0 && slug.startsWith(this.baseSlug)) {
|
|
13226
13234
|
return createWithSlug(navigation_exports.V1.slugjoin(getRemainingAfterBase(slug)));
|
|
13227
13235
|
}
|
|
13236
|
+
if (relativeProductSlug != null && isScopedTo(slug, relativeProductSlug)) {
|
|
13237
|
+
return createWithSlug(navigation_exports.V1.slugjoin(this.baseSlug, slug));
|
|
13238
|
+
}
|
|
13228
13239
|
return createWithSlug(navigation_exports.V1.slugjoin(this.productSlug, slug));
|
|
13229
13240
|
}
|
|
13230
13241
|
if (this.baseSlug.length > 0) {
|