{"name":"micromark-factory-space","version":"1.0.0-alpha.3","description":"micromark factory to parse markdown space (found in lots of places)","license":"MIT","keywords":["micromark","factory","space"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-character":"^1.0.0-alpha.3","micromark-util-types":"1.0.0-alpha.3"},"scripts":{"build":"rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"readme":"# micromark-factory-space\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][bundle-size-badge]][bundle-size]\n[![Sponsors][sponsors-badge]][opencollective]\n[![Backers][backers-badge]][opencollective]\n[![Chat][chat-badge]][chat]\n\nmicromark factory to parse [markdown space][markdown-space] (found in lots of\nplaces).\n\n## Contents\n\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`factorySpace(…)`](#factoryspace)\n*   [Security](#security)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## Install\n\n[npm][]:\n\n```sh\nnpm install micromark-factory-space\n```\n\n## Use\n\n```js\nimport {factorySpace} from 'micromark-factory-space'\nimport {codes} from 'micromark-util-symbol/codes'\nimport {types} from 'micromark-util-symbol/types'\n\n// A micromark tokenizer that uses the factory:\n/** @type {Tokenizer} */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n  return start\n\n  // …\n\n  /** @type {State} */\n  function info(code) {\n    if (code === codes.eof || markdownLineEndingOrSpace(code)) {\n      effects.exit(types.chunkString)\n      effects.exit(types.codeFencedFenceInfo)\n      return factorySpace(effects, infoAfter, types.whitespace)(code)\n    }\n\n    if (code === codes.graveAccent && code === marker) return nok(code)\n    effects.consume(code)\n    return info\n  }\n\n  // …\n}\n```\n\n## API\n\nThis module exports the following identifiers: `factorySpace`.\nThere is no default export.\n\n### `factorySpace(…)`\n\nNote that there is no `nok` parameter:\n\n*   spaces in markdown are often optional, in which case this factory can be\n    used and `ok` will be switched to whether spaces were found or not,\n*   One space character can be detected with\n    [markdownSpace(code)][markdown-space] right before using `factorySpace`\n\n###### Parameters\n\n*   `effects` (`Effects`) — Context\n*   `ok` (`State`) — State switched to when successful\n*   `type` (`string`) — Token type for whole (`' \\t'`)\n*   `max` (`number`, default: `Infinity`) — Max size of whitespace\n\n###### Returns\n\n`State`.\n\n###### Examples\n\nWhere `␉` represents a tab (plus how much it expands) and `␠` represents a\nsingle space.\n\n```markdown\n␉\n␠␠␠␠\n␉␠\n```\n\n## Security\n\nSee [`security.md`][securitymd] in [`micromark/.github`][health] for how to\nsubmit a security report.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`micromark/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organisation, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg\n\n[build]: https://github.com/micromark/micromark/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg\n\n[coverage]: https://codecov.io/github/micromark/micromark\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-factory-space.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-factory-space\n\n[bundle-size-badge]: https://img.shields.io/bundlephobia/minzip/micromark-factory-space.svg\n\n[bundle-size]: https://bundlephobia.com/result?p=micromark-factory-space\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[opencollective]: https://opencollective.com/unified\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/micromark/micromark/discussions\n\n[license]: https://github.com/micromark/micromark/blob/main/license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/micromark/.github\n\n[securitymd]: https://github.com/micromark/.github/blob/HEAD/security.md\n\n[contributing]: https://github.com/micromark/.github/blob/HEAD/contributing.md\n\n[support]: https://github.com/micromark/.github/blob/HEAD/support.md\n\n[coc]: https://github.com/micromark/.github/blob/HEAD/code-of-conduct.md\n\n[markdown-space]: https://github.com/micromark/micromark/tree/main/packages/micromark-util-character#markdownspacecode\n","readmeFilename":"readme.md","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-factory-space@1.0.0-alpha.3","_nodeVersion":"16.2.0","_npmVersion":"7.16.0","dist":{"integrity":"sha512-CDI+tFLAxayTJN5m5ZxVUXTULTPxKn/WYuaII9h2zcVpj4bkgz65bcRUUS0Z88HzPC+t1Bw6rGIhc4ghW49r1g==","shasum":"4d34b7e759ab1266b4db152ea56886f8a95a87b0","tarball":"http://registry-npm.ywwl.com/micromark-factory-space/download/micromark-factory-space-1.0.0-alpha.3.tgz","fileCount":6,"unpackedSize":8030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyjJKCRA9TVsSAnZWagAAjFYQAIOzWaTwh4nikhjBL8KR\neA/AxpSH+JIYOIng2eDIwWc4EHXAerSKjVWOKkzgthS95C4fynt3aeWerFFX\nr26JDPU4I0Gjul0wd5H0A/d3NzBZDfOCtlzasa7voL2I1DAsbFIP8nGVJVKg\nU4l7CrW0EI5YRAJMJ5SIkOjPWca8Ai3WTmZzaASBYtpAnCMDwdt7Npozjwdu\ncSoHeuX5TVNL7rpHDQx+A2cn0Lr1avHtdM+Q14M/95QssnaI5n0UHo4Bpbwq\n0SnfOQrko8YHec6lfojisB60DB/ynlNnrGq8mMt72AZlahxm+P0TkElVMPL/\n0n7FH0rgP4pFy82lkncCYOBUe0WB4KKRHHgykqwSrTDPbvBBf6ptgErbWudt\n/yPuSMYhy1J3Sm+WVt7MlCYivcmObdor/vb8uMCxrLsudozNrVLgj/sYfSiQ\nnfg1sPozJcgncrX3DH3kmVdZIJCHoimKpAv79ScxY6+atw80EJyaY2wM+PHU\nNnGX0b+MwdGSHu13V10wbBtXk9vRYkGf4VyJniIIfKn3OM69xBKpubtsOILf\n6nGfa92G/Klwub7FqOJag2QyvEoarOd74bTDLNnpk0msMo+IPQuuh3Coq4Vt\nYhwzJHLK3C1zy3avqbHivbYqNleg8usVG3nGqLseInlUCXuPZm6kQDL8axzt\ndjn4\r\n=BwDI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQOogOXrDAHeQPwOtNvihD4hkZKGcA6NguKv2tplhEQAIhAOD6vpEbq+brcgel42spJ3bEbW+u8T5iLCf/UxT76lTx"}],"size":2610,"noattachment":false,"key":"/micromark-factory-space/-/micromark-factory-space-1.0.0-alpha.3.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-factory-space_1.0.0-alpha.3_1623863882494_0.7158164527583084"},"_hasShrinkwrap":false,"publish_time":1623863882641,"_cnpm_publish_time":1623863882641,"dist-tags":{"latest":"2.1.0","next":"1.0.0-beta.1"}}