mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
refactor(front-matter): remove Extractor
type (#5659)
This commit is contained in:
parent
c7a39f0752
commit
860f578a10
@ -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 =|---";
|
||||
|
@ -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 */
|
||||
|
@ -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>;
|
@ -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 };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user