{"_id":"micromark-util-resolve-all","_rev":"267335","name":"micromark-util-resolve-all","description":"micromark utility to resolve subtokens","dist-tags":{"latest":"1.0.0","next":"1.0.0-beta.1"},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"time":{"modified":"2023-03-27T19:09:16.000Z","created":"2021-06-07T09:26:34.098Z","1.0.0":"2021-06-22T19:04:21.977Z","1.0.0-beta.1":"2021-06-20T12:13:34.719Z","1.0.0-alpha.3":"2021-06-16T17:18:50.597Z","1.0.0-alpha.2":"2021-06-07T13:36:10.530Z","1.0.0-alpha.1":"2021-06-07T09:26:34.098Z"},"users":{},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"versions":{"1.0.0":{"name":"micromark-util-resolve-all","version":"1.0.0","description":"micromark utility to resolve subtokens","license":"MIT","keywords":["micromark","util","utility","resolve"],"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":"index.d.ts","exports":"./index.js","dependencies":{"micromark-util-types":"^1.0.0"},"scripts":{"build":"rimraf \"*.d.ts\" && tsc && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-resolve-all@1.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.18.1","dist":{"shasum":"a7c363f49a0162e931960c44f3127ab58f031d88","size":2550,"noattachment":false,"key":"/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/micromark-util-resolve-all/download/micromark-util-resolve-all-1.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-resolve-all_1.0.0_1624388661832_0.9958865729445827"},"_hasShrinkwrap":false,"publish_time":1624388661977,"_cnpm_publish_time":1624388661977,"_cnpmcore_publish_time":"2021-12-14T05:34:44.691Z"},"1.0.0-beta.1":{"name":"micromark-util-resolve-all","version":"1.0.0-beta.1","description":"micromark utility to resolve subtokens","license":"MIT","keywords":["micromark","util","utility","resolve"],"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":"index.d.ts","exports":"./index.js","dependencies":{"micromark-util-types":"1.0.0-beta.1"},"scripts":{"build":"rimraf \"*.d.ts\" && tsc && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"readmeFilename":"readme.md","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-resolve-all@1.0.0-beta.1","_nodeVersion":"16.2.0","_npmVersion":"7.18.1","dist":{"shasum":"d735440893e2f9bd0a4c23ad8b63991dda5b0b91","size":2553,"noattachment":false,"key":"/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0-beta.1.tgz","tarball":"http://name.csiicloud.com:7001/micromark-util-resolve-all/download/micromark-util-resolve-all-1.0.0-beta.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-resolve-all_1.0.0-beta.1_1624191214374_0.9653130775566121"},"_hasShrinkwrap":false,"publish_time":1624191214719,"_cnpm_publish_time":1624191214719,"_cnpmcore_publish_time":"2021-12-14T05:34:44.888Z"},"1.0.0-alpha.3":{"name":"micromark-util-resolve-all","version":"1.0.0-alpha.3","description":"micromark utility to resolve subtokens","license":"MIT","keywords":["micromark","util","utility","resolve"],"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":"index.d.ts","exports":"./index.js","dependencies":{"micromark-util-types":"1.0.0-alpha.3"},"scripts":{"build":"rimraf \"*.d.ts\" && tsc && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"readmeFilename":"readme.md","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-resolve-all@1.0.0-alpha.3","_nodeVersion":"16.2.0","_npmVersion":"7.16.0","dist":{"shasum":"82c874c8b0dc5e09a02fcfea05aa37b4f67b0222","size":2552,"noattachment":false,"key":"/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0-alpha.3.tgz","tarball":"http://name.csiicloud.com:7001/micromark-util-resolve-all/download/micromark-util-resolve-all-1.0.0-alpha.3.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-resolve-all_1.0.0-alpha.3_1623863930469_0.8788458204829386"},"_hasShrinkwrap":false,"publish_time":1623863930597,"_cnpm_publish_time":1623863930597,"_cnpmcore_publish_time":"2021-12-14T05:34:45.086Z"},"1.0.0-alpha.2":{"name":"micromark-util-resolve-all","version":"1.0.0-alpha.2","description":"micromark utility to resolve subtokens","license":"MIT","keywords":["micromark","util","utility","resolve"],"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":"index.d.ts","exports":"./index.js","dependencies":{"micromark-util-types":"1.0.0-alpha.2"},"scripts":{"build":"rimraf \"*.d.ts\" && tsc && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"readmeFilename":"readme.md","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-resolve-all@1.0.0-alpha.2","_nodeVersion":"16.2.0","_npmVersion":"7.15.1","dist":{"shasum":"ee65b2b2c552fff85d7ded0fc5ae1d4c210192a4","size":2552,"noattachment":false,"key":"/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0-alpha.2.tgz","tarball":"http://name.csiicloud.com:7001/micromark-util-resolve-all/download/micromark-util-resolve-all-1.0.0-alpha.2.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-resolve-all_1.0.0-alpha.2_1623072970328_0.28868983885713373"},"_hasShrinkwrap":false,"publish_time":1623072970530,"_cnpm_publish_time":1623072970530,"_cnpmcore_publish_time":"2021-12-14T05:34:45.381Z"},"1.0.0-alpha.1":{"name":"micromark-util-resolve-all","version":"1.0.0-alpha.1","description":"micromark utility to resolve subtokens","license":"MIT","keywords":["micromark","util","utility","resolve"],"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"}],"type":"module","main":"index.js","types":"index.d.ts","exports":"./index.js","dependencies":{"micromark-util-types":"1.0.0-alpha.1"},"scripts":{"build":"rimraf \"*.d.ts\" && tsc && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-util-resolve-all@1.0.0-alpha.1","_nodeVersion":"16.2.0","_npmVersion":"7.15.1","dist":{"shasum":"94121c08e818eb224dfb61ab7c0cda776fcedd9f","size":2539,"noattachment":false,"key":"/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0-alpha.1.tgz","tarball":"http://name.csiicloud.com:7001/micromark-util-resolve-all/download/micromark-util-resolve-all-1.0.0-alpha.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-util-resolve-all_1.0.0-alpha.1_1623057993971_0.8700618955303532"},"_hasShrinkwrap":false,"publish_time":1623057994098,"_cnpm_publish_time":1623057994098,"_cnpmcore_publish_time":"2021-12-14T05:34:45.559Z"}},"readme":"# micromark-util-resolve-all\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 utility to resolve subtokens.\n\n[Resolvers][resolver] are functions that take events and manipulate them.\nThis is needed for example because media (links, images) and attention (strong,\nitalic) aren’t parsed left-to-right.\nInstead, their openings and closings are parsed, and when done, their openings\nand closings are matched, and left overs are turned into plain text.\nBecause media and attention can’t overlap, we need to perform that operation\nwhen one closing matches an opening, too.\n\n## Contents\n\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`resolveAll(constructs, events, context)`](#resolveallconstructs-events-context)\n*   [Security](#security)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## Install\n\n[npm][]:\n\n```sh\nnpm install micromark-util-resolve-all\n```\n\n## Use\n\n```js\nimport {push} from 'micromark-util-chunked'\nimport {resolveAll} from 'micromark-util-resolve-all'\n\n/**\n * @type {Resolver}\n */\nfunction resolveAllAttention(events, context) {\n  // …\n\n  // Walk through all events.\n  while (++index < events.length) {\n    // Find a token that can close.\n    if (\n      events[index][0] === 'enter' &&\n      events[index][1].type === 'attentionSequence' &&\n      events[index][1]._close\n    ) {\n      open = index\n\n      // Now walk back to find an opener.\n      while (open--) {\n        // Find a token that can open the closer.\n        if (\n          // …\n        ) {\n          // …\n\n          // Opening.\n          nextEvents = push(nextEvents, [\n            // …\n          ])\n\n          // Between.\n          nextEvents = push(\n            nextEvents,\n            resolveAll(\n              context.parser.constructs.insideSpan.null,\n              events.slice(open + 1, index),\n              context\n            )\n          )\n\n          // Closing.\n          nextEvents = push(nextEvents, [\n            // …\n          ])\n\n          // …\n        }\n      }\n    }\n  }\n\n  // …\n}\n```\n\n## API\n\nThis module exports the following identifiers: `resolveAll`.\nThere is no default export.\n\n### `resolveAll(constructs, events, context)`\n\nCall all `resolveAll`s in `constructs`.\n\n###### Parameters\n\n*   `constructs` (`Construct[]`) — List of constructs, optionally with\n    `resolveAll`s\n*   `events` (`Event[]`) — List of events\n*   `context` (`TokenizeContext`) — Context used by `tokenize`\n\n###### Returns\n\n`Events[]` — Changed events.\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-util-resolve-all.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-util-resolve-all\n\n[bundle-size-badge]: https://img.shields.io/bundlephobia/minzip/micromark-util-resolve-all.svg\n\n[bundle-size]: https://bundlephobia.com/result?p=micromark-util-resolve-all\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[resolver]: https://github.com/micromark/micromark/blob/a571c09/packages/micromark-util-types/index.js#L219\n","_attachments":{},"homepage":"https://github.com/micromark/micromark/tree/main#readme","bugs":{"url":"https://github.com/micromark/micromark/issues"},"license":"MIT"}