-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
136 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
node_modules/ | ||
coverage/ | ||
packages/*/*.d.ts | ||
packages/retext/*.d.ts | ||
packages/retext-dutch/lib/*.d.ts | ||
packages/retext-english/lib/*.d.ts | ||
packages/retext-latin/lib/*.d.ts | ||
packages/retext-stringify/lib/*.d.ts | ||
/*.d.ts | ||
.DS_Store | ||
*.log | ||
*.d.ts | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This wrapper exists because JS in TS can’t export a `@type` of a function. | ||
import type {Root} from 'nlcst' | ||
import type {Plugin, ParserClass} from 'unified' | ||
|
||
export const Parser: ParserClass<Root> | ||
|
||
declare const retextDutch: Plugin<void[], string, Root> | ||
export default retextDutch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
/** | ||
* @typedef {import('unified').Plugin<[]>} Plugin | ||
*/ | ||
import retextDutch, {Parser} from './lib/index.js' | ||
|
||
import {unherit} from 'unherit' | ||
// @ts-expect-error: untyped. | ||
import {ParseDutch as Parser} from 'parse-dutch' | ||
|
||
// Untyped. | ||
// type-coverage:ignore-next-line | ||
export {Parser} | ||
|
||
/** @type {Plugin} */ | ||
export default function retextDutch() { | ||
Object.assign(this, {Parser: unherit(Parser)}) | ||
} | ||
export default retextDutch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @typedef {import('nlcst').Root} Root | ||
*/ | ||
|
||
import {unherit} from 'unherit' | ||
// @ts-expect-error: untyped. | ||
import {ParseDutch} from 'parse-dutch' | ||
|
||
/** @type {import('unified').ParserClass<Root>} */ | ||
export const Parser = ParseDutch | ||
|
||
/** @type {import('unified').Plugin<void[], string, Root>} */ | ||
export default function retextDutch() { | ||
Object.assign(this, {Parser: unherit(ParseDutch)}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["*.js"] | ||
"include": ["lib/**/*.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This wrapper exists because JS in TS can’t export a `@type` of a function. | ||
import type {Root} from 'nlcst' | ||
import type {Plugin, ParserClass} from 'unified' | ||
|
||
export const Parser: ParserClass<Root> | ||
|
||
declare const retextEnglish: Plugin<void[], string, Root> | ||
export default retextEnglish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
/** | ||
* @typedef {import('unified').Plugin<[]>} Plugin | ||
*/ | ||
import retextEnglish, {Parser} from './lib/index.js' | ||
|
||
import {unherit} from 'unherit' | ||
// @ts-expect-error: untyped. | ||
import {ParseEnglish as Parser} from 'parse-english' | ||
|
||
// Untyped. | ||
// type-coverage:ignore-next-line | ||
export {Parser} | ||
|
||
/** @type {Plugin} */ | ||
export default function retextEnglish() { | ||
Object.assign(this, {Parser: unherit(Parser)}) | ||
} | ||
export default retextEnglish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @typedef {import('nlcst').Root} Root | ||
*/ | ||
|
||
import {unherit} from 'unherit' | ||
// @ts-expect-error: untyped. | ||
import {ParseEnglish} from 'parse-english' | ||
|
||
/** @type {import('unified').ParserClass<Root>} */ | ||
export const Parser = ParseEnglish | ||
|
||
/** @type {import('unified').Plugin<void[], string, Root>} */ | ||
export default function retextEnglish() { | ||
Object.assign(this, {Parser: unherit(ParseEnglish)}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["*.js"] | ||
"include": ["lib/**/*.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This wrapper exists because JS in TS can’t export a `@type` of a function. | ||
import type {Root} from 'nlcst' | ||
import type {Plugin, ParserClass} from 'unified' | ||
|
||
export const Parser: ParserClass<Root> | ||
|
||
declare const retextLatin: Plugin<void[], string, Root> | ||
export default retextLatin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
/** | ||
* @typedef {import('unified').Plugin<[]>} Plugin | ||
*/ | ||
import retextLatin, {Parser} from './lib/index.js' | ||
|
||
import {unherit} from 'unherit' | ||
// @ts-expect-error: untyped. | ||
import {ParseLatin as Parser} from 'parse-latin' | ||
|
||
// Untyped. | ||
// type-coverage:ignore-next-line | ||
export {Parser} | ||
|
||
/** @type {Plugin} */ | ||
export default function retextLatin() { | ||
Object.assign(this, {Parser: unherit(Parser)}) | ||
} | ||
export default retextLatin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @typedef {import('nlcst').Root} Root | ||
*/ | ||
|
||
import {unherit} from 'unherit' | ||
// @ts-expect-error: untyped. | ||
import {ParseLatin} from 'parse-latin' | ||
|
||
/** @type {import('unified').ParserClass<Root>} */ | ||
export const Parser = ParseLatin | ||
|
||
/** @type {import('unified').Plugin<void[], string, Root>} */ | ||
export default function retextLatin() { | ||
Object.assign(this, {Parser: unherit(ParseLatin)}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["*.js"] | ||
"include": ["lib/**/*.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// This wrapper exists because JS in TS can’t export a `@type` of a function. | ||
import type {Root} from 'nlcst' | ||
import type {Plugin} from 'unified' | ||
|
||
declare const retextStringify: Plugin<void[], Root, string> | ||
export default retextStringify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,3 @@ | ||
/** | ||
* @typedef {import('unified').Plugin<[]>} Plugin | ||
* @typedef {import('unist').Node} Node | ||
*/ | ||
import retextStringify from './lib/index.js' | ||
|
||
import {toString} from 'nlcst-to-string' | ||
|
||
/** @type {Plugin} */ | ||
export default function retextStringify() { | ||
Object.assign(this, {Compiler}) | ||
} | ||
|
||
/** | ||
* @param {Node} tree | ||
* @returns {string} | ||
*/ | ||
function Compiler(tree) { | ||
return toString(tree) | ||
} | ||
export default retextStringify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @typedef {import('nlcst').Root} Root | ||
*/ | ||
|
||
import {toString} from 'nlcst-to-string' | ||
|
||
/** @type {import('unified').Plugin<void[], Root, string>} */ | ||
export default function retextStringify() { | ||
Object.assign(this, {Compiler}) | ||
} | ||
|
||
/** @type {import('unified').CompilerFunction<Root, string>} */ | ||
function Compiler(tree) { | ||
return toString(tree) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["*.js"] | ||
"include": ["lib/**/*.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters