@flex-development/docmark-factory-space
v1.0.0-alpha.22
Published
docmark factory to parse docmark space
Maintainers
Readme
docmark-factory-space
docmark factory to parse whitespace.
Contents
What is this?
This package exposes states to parse spaces and/or tabs.
When should I use this?
This package may be useful when making your own docmark extensions.
Install
This package is ESM only.
In Node.js with yarn:
yarn add @flex-development/docmark-factory-spaceIn Deno with esm.sh:
import { factorySpace } from 'https://esm.sh/@flex-development/docmark-factory-space'In browsers with esm.sh:
<script type="module">
import { factorySpace } from 'https://esm.sh/@flex-development/docmark-factory-space'
</script>Use
TODO: use
API
This package exports the identifier factorySpace.
There is no default export.
factorySpace(effects, ok[, type][, max])
Tokenize spaces and tabs.
Parameters
effects(Effects) — the context object used to transition the state machineok(State) — the successful tokenization statetype(TokenType|null|undefined, optional) — the token type to capture whitespace asmax(number|null|undefined, optional) — the maximum number of spaces/tabs to consume (exclusive)
Returns
(State) The initial state
Types
This package is fully typed with TypeScript. It exports no additional types.
Project
Version
docmark-factory-space adheres to semver.
Contribute
See CONTRIBUTING.md.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
Sponsor
Small primitives power larger systems. Support long-term stability by sponsoring Flex Development.
