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

21
node_modules/@docusaurus/utils-common/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

3
node_modules/@docusaurus/utils-common/README.md generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# `@docusaurus/utils`
Common (Node/Browser) utility functions for Docusaurus packages.

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;AAC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AAW,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"}

36
node_modules/@docusaurus/utils-common/package.json generated vendored Normal file
View File

@@ -0,0 +1,36 @@
{
"name": "@docusaurus/utils-common",
"version": "3.1.1",
"description": "Common (Node/Browser) utility functions for Docusaurus packages.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"sideEffects": false,
"scripts": {
"build": "tsc",
"watch": "tsc --watch"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-utils-common"
},
"license": "MIT",
"dependencies": {
"tslib": "^2.6.0"
},
"peerDependencies": {
"@docusaurus/types": "*"
},
"peerDependenciesMeta": {
"@docusaurus/types": {
"optional": true
}
},
"engines": {
"node": ">=18.0"
},
"gitHead": "8017f6a6776ba1bd7065e630a52fe2c2654e2f1b"
}

View File

@@ -0,0 +1,57 @@
/**
* 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'
>;
// Trailing slash handling depends in some site configuration options
export default function applyTrailingSlash(
path: string,
options: ApplyTrailingSlashParams,
): string {
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: string): string {
return str.endsWith('/') ? str : `${str}/`;
}
function removeTrailingSlash(str: string): string {
return str.endsWith('/') ? str.slice(0, -1) : str;
}
function handleTrailingSlash(str: string, trailing: boolean): string {
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(/[#?]/) as [string, ...string[]];
// 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);
}

View File

@@ -0,0 +1,14 @@
/**
* 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 function getErrorCausalChain(error: Error): CausalChain {
if (error.cause) {
return [error, ...getErrorCausalChain(error.cause as Error)];
}
return [error];
}

16
node_modules/@docusaurus/utils-common/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* 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.
*/
// __ prefix allows search crawlers (Algolia/DocSearch) to ignore anchors
// https://github.com/facebook/docusaurus/issues/8883#issuecomment-1516328368
export const blogPostContainerID = '__blog-post-container';
export {
default as applyTrailingSlash,
type ApplyTrailingSlashParams,
} from './applyTrailingSlash';
export {getErrorCausalChain} from './errorUtils';