mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-23 06:13:38 -04:00
Migrated to ESLint
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { Observable, Subject, defer, of, NEVER } from "rxjs"
|
||||
import { NEVER, Observable, Subject, defer, of } from "rxjs"
|
||||
import {
|
||||
catchError,
|
||||
filter,
|
||||
@@ -35,10 +35,7 @@ import { renderSourceFacts } from "~/templates"
|
||||
import { hash } from "~/utilities"
|
||||
|
||||
import { Component } from "../../_"
|
||||
import {
|
||||
fetchSourceFacts,
|
||||
SourceFacts
|
||||
} from "../facts"
|
||||
import { SourceFacts, fetchSourceFacts } from "../facts"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Types
|
||||
@@ -69,7 +66,7 @@ let fetch$: Observable<Source>
|
||||
*
|
||||
* @param el - Repository information element
|
||||
*
|
||||
* @return Repository information observable
|
||||
* @returns Repository information observable
|
||||
*/
|
||||
export function watchSource(
|
||||
el: HTMLAnchorElement
|
||||
@@ -108,7 +105,7 @@ export function watchSource(
|
||||
*
|
||||
* @param el - Repository information element
|
||||
*
|
||||
* @return Repository information component observable
|
||||
* @returns Repository information component observable
|
||||
*/
|
||||
export function mountSource(
|
||||
el: HTMLAnchorElement
|
||||
|
||||
@@ -43,7 +43,7 @@ export type SourceFacts = string[]
|
||||
*
|
||||
* @param url - Repository URL
|
||||
*
|
||||
* @return Repository facts observable
|
||||
* @returns Repository facts observable
|
||||
*/
|
||||
export function fetchSourceFacts(
|
||||
url: string
|
||||
@@ -53,12 +53,12 @@ export function fetchSourceFacts(
|
||||
|
||||
/* GitHub repository */
|
||||
case "github":
|
||||
const [, user, repo] = url.match(/^.+github\.com\/([^\/]+)\/?([^\/]+)?/i)!
|
||||
const [, user, repo] = url.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i)!
|
||||
return fetchSourceFactsFromGitHub(user, repo)
|
||||
|
||||
/* GitLab repository */
|
||||
case "gitlab":
|
||||
const [, base, slug] = url.match(/^.+?([^\/]*gitlab[^\/]+)\/(.+?)\/?$/i)!
|
||||
const [, base, slug] = url.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i)!
|
||||
return fetchSourceFactsFromGitLab(base, slug)
|
||||
|
||||
/* Everything else */
|
||||
|
||||
@@ -43,7 +43,7 @@ import { SourceFacts } from "../_"
|
||||
* @param user - GitHub user
|
||||
* @param repo - GitHub repository
|
||||
*
|
||||
* @return Repository facts observable
|
||||
* @returns Repository facts observable
|
||||
*/
|
||||
export function fetchSourceFactsFromGitHub(
|
||||
user: string, repo?: string
|
||||
|
||||
@@ -43,7 +43,7 @@ import { SourceFacts } from "../_"
|
||||
* @param base - GitLab base
|
||||
* @param project - GitLab project
|
||||
*
|
||||
* @return Repository facts observable
|
||||
* @returns Repository facts observable
|
||||
*/
|
||||
export function fetchSourceFactsFromGitLab(
|
||||
base: string, project: string
|
||||
|
||||
Reference in New Issue
Block a user