refactor(front-matter): remove Extractor type (#5659)

This commit is contained in:
Tim Reichen 2024-08-08 23:02:08 +02:00 committed by GitHub
parent c7a39f0752
commit 860f578a10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 21 deletions

View File

@ -1,5 +1,11 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
/**
* Supported format for front matter. `"unknown"` is used when auto format
* detection logic fails.
*/
export type Format = "yaml" | "toml" | "json";
const BOM = "\\ufeff?";
const YAML_DELIMITER = "= yaml =|---";

View File

@ -1,7 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { RECOGNIZE_REGEXP_MAP } from "./_formats.ts";
import type { Format } from "./_types.ts";
import { type Format, RECOGNIZE_REGEXP_MAP } from "./_formats.ts";
import type { Extract } from "./types.ts";
/** Parser function type */

View File

@ -1,17 +0,0 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import type { Extract } from "./types.ts";
/**
* Supported format for front matter. `"unknown"` is used when auto format
* detection logic fails.
*/
export type Format = "yaml" | "toml" | "json";
/**
* Type for function that accepts an input string and returns
* {@linkcode Extract}.
*/
export type Extractor = <T = Record<string, unknown>>(
str: string,
) => Extract<T>;

View File

@ -1,7 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { EXTRACT_REGEXP_MAP } from "./_formats.ts";
import type { Format } from "./_types.ts";
import { EXTRACT_REGEXP_MAP, type Format } from "./_formats.ts";
export type { Format };