This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { DocusaurusConfig } from '@docusaurus/types';
export type ApplyTrailingSlashParams = Pick<DocusaurusConfig, 'trailingSlash' | 'baseUrl'>;
export default function applyTrailingSlash(path: string, options: ApplyTrailingSlashParams): string;
//# sourceMappingURL=applyTrailingSlash.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"applyTrailingSlash.d.ts","sourceRoot":"","sources":["../src/applyTrailingSlash.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,gBAAgB,EAChB,eAAe,GAAG,SAAS,CAC5B,CAAC;AAGF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,wBAAwB,GAChC,MAAM,CAsCR"}

View File

@@ -0,0 +1,43 @@
"use strict";
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Object.defineProperty(exports, "__esModule", { value: true });
// Trailing slash handling depends in some site configuration options
function applyTrailingSlash(path, options) {
const { trailingSlash, baseUrl } = options;
if (path.startsWith('#')) {
// Never apply trailing slash to an anchor link
return path;
}
// TODO deduplicate: also present in @docusaurus/utils
function addTrailingSlash(str) {
return str.endsWith('/') ? str : `${str}/`;
}
function removeTrailingSlash(str) {
return str.endsWith('/') ? str.slice(0, -1) : str;
}
function handleTrailingSlash(str, trailing) {
return trailing ? addTrailingSlash(str) : removeTrailingSlash(str);
}
// undefined = legacy retrocompatible behavior
if (typeof trailingSlash === 'undefined') {
return path;
}
// The trailing slash should be handled before the ?search#hash !
const [pathname] = path.split(/[#?]/);
// Never transform '/' to ''
// Never remove the baseUrl trailing slash!
// If baseUrl = /myBase/, we want to emit /myBase/index.html and not
// /myBase.html! See https://github.com/facebook/docusaurus/issues/5077
const shouldNotApply = pathname === '/' || pathname === baseUrl;
const newPathname = shouldNotApply
? pathname
: handleTrailingSlash(pathname, trailingSlash);
return path.replace(pathname, newPathname);
}
exports.default = applyTrailingSlash;
//# sourceMappingURL=applyTrailingSlash.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"applyTrailingSlash.js","sourceRoot":"","sources":["../src/applyTrailingSlash.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AASH,qEAAqE;AACrE,SAAwB,kBAAkB,CACxC,IAAY,EACZ,OAAiC;IAEjC,MAAM,EAAC,aAAa,EAAE,OAAO,EAAC,GAAG,OAAO,CAAC;IAEzC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACxB,+CAA+C;QAC/C,OAAO,IAAI,CAAC;KACb;IAED,sDAAsD;IACtD,SAAS,gBAAgB,CAAC,GAAW;QACnC,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC;IAC7C,CAAC;IACD,SAAS,mBAAmB,CAAC,GAAW;QACtC,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpD,CAAC;IACD,SAAS,mBAAmB,CAAC,GAAW,EAAE,QAAiB;QACzD,OAAO,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC;IAED,8CAA8C;IAC9C,IAAI,OAAO,aAAa,KAAK,WAAW,EAAE;QACxC,OAAO,IAAI,CAAC;KACb;IAED,iEAAiE;IACjE,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAA0B,CAAC;IAE/D,4BAA4B;IAC5B,2CAA2C;IAC3C,oEAAoE;IACpE,uEAAuE;IACvE,MAAM,cAAc,GAAG,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,OAAO,CAAC;IAEhE,MAAM,WAAW,GAAG,cAAc;QAChC,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAEjD,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC7C,CAAC;AAzCD,qCAyCC"}

View File

@@ -0,0 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
type CausalChain = [Error, ...Error[]];
export declare function getErrorCausalChain(error: Error): CausalChain;
export {};
//# sourceMappingURL=errorUtils.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"errorUtils.d.ts","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,KAAK,WAAW,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;AAEvC,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,CAK7D"}

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorCausalChain = void 0;
function getErrorCausalChain(error) {
if (error.cause) {
return [error, ...getErrorCausalChain(error.cause)];
}
return [error];
}
exports.getErrorCausalChain = getErrorCausalChain;
//# sourceMappingURL=errorUtils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../src/errorUtils.ts"],"names":[],"mappings":";;;AAQA,SAAgB,mBAAmB,CAAC,KAAY;IAC9C,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,KAAK,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,KAAc,CAAC,CAAC,CAAC;KAC9D;IACD,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC;AALD,kDAKC"}

10
node_modules/@docusaurus/utils-common/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export declare const blogPostContainerID = "__blog-post-container";
export { default as applyTrailingSlash, type ApplyTrailingSlashParams, } from './applyTrailingSlash';
export { getErrorCausalChain } from './errorUtils';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D,OAAO,EACL,OAAO,IAAI,kBAAkB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC"}

20
node_modules/@docusaurus/utils-common/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
"use strict";
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getErrorCausalChain = exports.applyTrailingSlash = exports.blogPostContainerID = void 0;
// __ prefix allows search crawlers (Algolia/DocSearch) to ignore anchors
// https://github.com/facebook/docusaurus/issues/8883#issuecomment-1516328368
exports.blogPostContainerID = '__blog-post-container';
var applyTrailingSlash_1 = require("./applyTrailingSlash");
Object.defineProperty(exports, "applyTrailingSlash", { enumerable: true, get: function () { return __importDefault(applyTrailingSlash_1).default; } });
var errorUtils_1 = require("./errorUtils");
Object.defineProperty(exports, "getErrorCausalChain", { enumerable: true, get: function () { return errorUtils_1.getErrorCausalChain; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,yEAAyE;AACzE,6EAA6E;AAChE,QAAA,mBAAmB,GAAG,uBAAuB,CAAC;AAE3D,2DAG8B;AAF5B,yIAAA,OAAO,OAAsB;AAG/B,2CAAiD;AAAzC,iHAAA,mBAAmB,OAAA"}