@fern-api/fdr-sdk 1.2.95-42ec487d61 → 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.mjs
CHANGED
|
@@ -17200,6 +17200,9 @@ var NodeIdGenerator = class {
|
|
|
17200
17200
|
};
|
|
17201
17201
|
|
|
17202
17202
|
// src/navigation/versions/v1/converters/SlugGenerator.ts
|
|
17203
|
+
function isScopedTo(slug, prefix) {
|
|
17204
|
+
return prefix.length > 0 && (slug === prefix || slug.startsWith(`${prefix}/`));
|
|
17205
|
+
}
|
|
17203
17206
|
var SlugGenerator = class _SlugGenerator {
|
|
17204
17207
|
constructor(baseSlug, productSlug, versionSlug, slug) {
|
|
17205
17208
|
this.baseSlug = baseSlug;
|
|
@@ -17270,6 +17273,7 @@ var SlugGenerator = class _SlugGenerator {
|
|
|
17270
17273
|
}
|
|
17271
17274
|
return fullSlug;
|
|
17272
17275
|
};
|
|
17276
|
+
const relativeProductSlug = this.productSlug != null && this.baseSlug.length > 0 && isScopedTo(this.productSlug, this.baseSlug) ? this.productSlug.substring(this.baseSlug.length + 1) : this.productSlug;
|
|
17273
17277
|
if (this.productSlug != null && this.versionSlug != null) {
|
|
17274
17278
|
if (slug.startsWith(this.productSlug)) {
|
|
17275
17279
|
const remaining = getRemainingAfterProduct(slug);
|
|
@@ -17279,6 +17283,10 @@ var SlugGenerator = class _SlugGenerator {
|
|
|
17279
17283
|
const remaining = getRemainingAfterBase(slug);
|
|
17280
17284
|
return createWithSlug(navigation_exports.V1.slugjoin(this.baseSlug, remaining));
|
|
17281
17285
|
}
|
|
17286
|
+
if (relativeProductSlug != null && isScopedTo(slug, relativeProductSlug)) {
|
|
17287
|
+
const remaining = slug.substring(relativeProductSlug.length);
|
|
17288
|
+
return createWithSlug(navigation_exports.V1.slugjoin(this.versionSlug, remaining));
|
|
17289
|
+
}
|
|
17282
17290
|
return createWithSlug(navigation_exports.V1.slugjoin(this.versionSlug, slug));
|
|
17283
17291
|
}
|
|
17284
17292
|
if (this.versionSlug != null) {
|
|
@@ -17297,6 +17305,9 @@ var SlugGenerator = class _SlugGenerator {
|
|
|
17297
17305
|
if (this.baseSlug.length > 0 && slug.startsWith(this.baseSlug)) {
|
|
17298
17306
|
return createWithSlug(navigation_exports.V1.slugjoin(getRemainingAfterBase(slug)));
|
|
17299
17307
|
}
|
|
17308
|
+
if (relativeProductSlug != null && isScopedTo(slug, relativeProductSlug)) {
|
|
17309
|
+
return createWithSlug(navigation_exports.V1.slugjoin(this.baseSlug, slug));
|
|
17310
|
+
}
|
|
17300
17311
|
return createWithSlug(navigation_exports.V1.slugjoin(this.productSlug, slug));
|
|
17301
17312
|
}
|
|
17302
17313
|
if (this.baseSlug.length > 0) {
|