@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
package/dist/js/index.js
CHANGED
|
@@ -17263,6 +17263,9 @@ var NodeIdGenerator = class {
|
|
|
17263
17263
|
};
|
|
17264
17264
|
|
|
17265
17265
|
// src/navigation/versions/v1/converters/SlugGenerator.ts
|
|
17266
|
+
function isScopedTo(slug, prefix) {
|
|
17267
|
+
return prefix.length > 0 && (slug === prefix || slug.startsWith(`${prefix}/`));
|
|
17268
|
+
}
|
|
17266
17269
|
var SlugGenerator = class _SlugGenerator {
|
|
17267
17270
|
constructor(baseSlug, productSlug, versionSlug, slug) {
|
|
17268
17271
|
this.baseSlug = baseSlug;
|
|
@@ -17333,6 +17336,7 @@ var SlugGenerator = class _SlugGenerator {
|
|
|
17333
17336
|
}
|
|
17334
17337
|
return fullSlug;
|
|
17335
17338
|
};
|
|
17339
|
+
const relativeProductSlug = this.productSlug != null && this.baseSlug.length > 0 && isScopedTo(this.productSlug, this.baseSlug) ? this.productSlug.substring(this.baseSlug.length + 1) : this.productSlug;
|
|
17336
17340
|
if (this.productSlug != null && this.versionSlug != null) {
|
|
17337
17341
|
if (slug.startsWith(this.productSlug)) {
|
|
17338
17342
|
const remaining = getRemainingAfterProduct(slug);
|
|
@@ -17342,6 +17346,10 @@ var SlugGenerator = class _SlugGenerator {
|
|
|
17342
17346
|
const remaining = getRemainingAfterBase(slug);
|
|
17343
17347
|
return createWithSlug(navigation_exports.V1.slugjoin(this.baseSlug, remaining));
|
|
17344
17348
|
}
|
|
17349
|
+
if (relativeProductSlug != null && isScopedTo(slug, relativeProductSlug)) {
|
|
17350
|
+
const remaining = slug.substring(relativeProductSlug.length);
|
|
17351
|
+
return createWithSlug(navigation_exports.V1.slugjoin(this.versionSlug, remaining));
|
|
17352
|
+
}
|
|
17345
17353
|
return createWithSlug(navigation_exports.V1.slugjoin(this.versionSlug, slug));
|
|
17346
17354
|
}
|
|
17347
17355
|
if (this.versionSlug != null) {
|
|
@@ -17360,6 +17368,9 @@ var SlugGenerator = class _SlugGenerator {
|
|
|
17360
17368
|
if (this.baseSlug.length > 0 && slug.startsWith(this.baseSlug)) {
|
|
17361
17369
|
return createWithSlug(navigation_exports.V1.slugjoin(getRemainingAfterBase(slug)));
|
|
17362
17370
|
}
|
|
17371
|
+
if (relativeProductSlug != null && isScopedTo(slug, relativeProductSlug)) {
|
|
17372
|
+
return createWithSlug(navigation_exports.V1.slugjoin(this.baseSlug, slug));
|
|
17373
|
+
}
|
|
17363
17374
|
return createWithSlug(navigation_exports.V1.slugjoin(this.productSlug, slug));
|
|
17364
17375
|
}
|
|
17365
17376
|
if (this.baseSlug.length > 0) {
|