remark-remove-travis-ci-badge
Advanced tools
+52
| import { remove } from 'unist-util-remove'; | ||
| import { visit } from 'unist-util-visit'; | ||
| import { definitions } from 'mdast-util-definitions'; | ||
| function createBadgePredicate () { | ||
| return node => 'link' === node.type && node.url.startsWith('https://travis-ci.com'); | ||
| } | ||
| function createReferencedBadgePredicate (tree) { | ||
| const getDefinitionByIdentifier = definitions(tree); | ||
| return node => { | ||
| if ('linkReference' === node.type) { | ||
| const definition = getDefinitionByIdentifier(node.identifier); | ||
| return !!definition.url && definition.url.startsWith('https://travis-ci.com'); | ||
| } | ||
| return false; | ||
| }; | ||
| } | ||
| function nodeIsLastChild(index, parent) { | ||
| return index === parent.children.length - 1; | ||
| } | ||
| function nextSiblingIsNewline(nextSibling) { | ||
| return 'text' === nextSibling?.type && '\n' === nextSibling.value; | ||
| } | ||
| function mergeNewlines (node, index, parent) { | ||
| if ('paragraph' === parent.type) { | ||
| const nextSibling = parent.children[index + 1]; | ||
| if (nodeIsLastChild(index, parent) || nextSiblingIsNewline(nextSibling)) { | ||
| parent.children.splice(index, 1); | ||
| } | ||
| } | ||
| } | ||
| function plugin () { | ||
| return function transformer(tree) { | ||
| remove(tree, createBadgePredicate()); | ||
| remove(tree, createReferencedBadgePredicate(tree)); | ||
| remove(tree, {type: 'definition', identifier: 'ci-badge'}); | ||
| remove(tree, {type: 'definition', identifier: 'ci-link'}); | ||
| visit(tree, {type: 'text', value: '\n'}, mergeNewlines); | ||
| }; | ||
| } | ||
| export { plugin as default }; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sources":["../src/badge-predicate.js","../src/referenced-badge-predicate.js","../src/merge-newlines-in-paragraph.js","../src/plugin.js"],"sourcesContent":["export default function () {\n return node => 'link' === node.type && node.url.startsWith('https://travis-ci.com');\n}\n","import {definitions} from 'mdast-util-definitions';\n\nexport default function (tree) {\n const getDefinitionByIdentifier = definitions(tree);\n\n return node => {\n if ('linkReference' === node.type) {\n const definition = getDefinitionByIdentifier(node.identifier);\n\n return !!definition.url && definition.url.startsWith('https://travis-ci.com');\n }\n\n return false;\n };\n}\n","function nodeIsLastChild(index, parent) {\n return index === parent.children.length - 1;\n}\n\nfunction nextSiblingIsNewline(nextSibling) {\n return 'text' === nextSibling?.type && '\\n' === nextSibling.value;\n}\n\nexport default function (node, index, parent) {\n if ('paragraph' === parent.type) {\n const nextSibling = parent.children[index + 1];\n\n if (nodeIsLastChild(index, parent) || nextSiblingIsNewline(nextSibling)) {\n parent.children.splice(index, 1);\n }\n }\n}\n","import {remove} from 'unist-util-remove';\nimport {visit} from 'unist-util-visit';\n\nimport createBadgePredicate from './badge-predicate.js';\nimport createReferencedBadgePredicate from './referenced-badge-predicate.js';\nimport mergeNewlines from './merge-newlines-in-paragraph.js';\n\nexport default function () {\n return function transformer(tree) {\n remove(tree, createBadgePredicate(tree));\n remove(tree, createReferencedBadgePredicate(tree));\n remove(tree, {type: 'definition', identifier: 'ci-badge'});\n remove(tree, {type: 'definition', identifier: 'ci-link'});\n visit(tree, {type: 'text', value: '\\n'}, mergeNewlines);\n };\n}\n"],"names":[],"mappings":";;;;AAAe,6BAAQ,IAAI;AAC3B,EAAE,OAAO,IAAI,IAAI,MAAM,KAAK,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AACtF;;ACAe,uCAAQ,EAAE,IAAI,EAAE;AAC/B,EAAE,MAAM,yBAAyB,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AACtD;AACA,EAAE,OAAO,IAAI,IAAI;AACjB,IAAI,IAAI,eAAe,KAAK,IAAI,CAAC,IAAI,EAAE;AACvC,MAAM,MAAM,UAAU,GAAG,yBAAyB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACpE;AACA,MAAM,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AACpF,KAAK;AACL;AACA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AAK,EAAE,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;AAC5D,GAAG,CAAC;AACJ;;;;"} |
+1
-1
| // remark-usage-ignore-next | ||
| /* eslint-disable-next-line no-unused-vars */ | ||
| import remarkRemoveTravisCiBadge from './lib/index.cjs'; | ||
| import remarkRemoveTravisCiBadge from './lib/index.js'; |
+44
-49
@@ -5,21 +5,18 @@ { | ||
| "license": "MIT", | ||
| "version": "2.0.2", | ||
| "version": "3.0.0", | ||
| "type": "module", | ||
| "engines": { | ||
| "node": ">=14.13.1" | ||
| "node": "^16.14 || >=18" | ||
| }, | ||
| "files": [ | ||
| "example.js", | ||
| "lib/" | ||
| "author": "Matt Travi <npm@travi.org> (https://matt.travi.org)", | ||
| "repository": "form8ion/remark-remove-travis-ci-badge", | ||
| "bugs": "https://github.com/form8ion/remark-remove-travis-ci-badge/issues", | ||
| "homepage": "https://npm.im/remark-remove-travis-ci-badge", | ||
| "keywords": [ | ||
| "remark-plugin" | ||
| ], | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "runkitExampleFilename": "./example.js", | ||
| "main": "lib/index.cjs.js", | ||
| "module": "lib/index.es.js", | ||
| "main": "./lib/index.js", | ||
| "exports": "./lib/index.js", | ||
| "sideEffects": false, | ||
| "repository": "form8ion/remark-remove-travis-ci-badge", | ||
| "bugs": "https://github.com/form8ion/remark-remove-travis-ci-badge/issues", | ||
| "homepage": "https://npm.im/remark-remove-travis-ci-badge", | ||
| "author": "Matt Travi <npm@travi.org> (https://matt.travi.org)", | ||
| "scripts": { | ||
@@ -35,5 +32,5 @@ "test": "npm-run-all --print-label build --parallel lint:* --parallel test:*", | ||
| "lint:gherkin": "gherkin-lint", | ||
| "pretest:integration": "preview", | ||
| "pretest:integration": "run-s build", | ||
| "test:integration": "run-s 'test:integration:base -- --profile noWip'", | ||
| "test:integration:base": "DEBUG=any cucumber-js test/integration --profile base", | ||
| "test:integration:base": "DEBUG=any cucumber-js test/integration", | ||
| "test:integration:debug": "DEBUG=test run-s test:integration", | ||
@@ -50,3 +47,3 @@ "test:integration:wip": "run-s 'test:integration:base -- --profile wip'", | ||
| "test:unit": "cross-env NODE_ENV=test c8 run-s test:unit:base", | ||
| "test:unit:base": "DEBUG=any mocha 'src/**/*-test.js'", | ||
| "test:unit:base": "DEBUG=any vitest run", | ||
| "lint:peer": "npm ls >/dev/null", | ||
@@ -56,43 +53,41 @@ "prepare": "husky install", | ||
| }, | ||
| "keywords": [ | ||
| "remark-plugin" | ||
| "files": [ | ||
| "example.js", | ||
| "lib/" | ||
| ], | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "mdast-util-definitions": "^5.1.2", | ||
| "unist-util-remove": "^3.1.1", | ||
| "unist-util-visit": "^4.1.2" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/register": "7.18.6", | ||
| "@cucumber/cucumber": "8.4.0", | ||
| "@form8ion/babel-preset": "1.6.92", | ||
| "@form8ion/commitlint-config": "1.0.36", | ||
| "@form8ion/eslint-config": "5.0.5", | ||
| "@cucumber/cucumber": "9.1.0", | ||
| "@form8ion/commitlint-config": "1.0.47", | ||
| "@form8ion/eslint-config": "5.0.29", | ||
| "@form8ion/eslint-config-cucumber": "1.4.1", | ||
| "@form8ion/eslint-config-mocha": "2.0.2", | ||
| "@form8ion/remark-lint-preset": "1.0.13", | ||
| "@travi/any": "2.1.5", | ||
| "babel-plugin-istanbul": "6.1.1", | ||
| "ban-sensitive-files": "1.9.18", | ||
| "c8": "7.11.3", | ||
| "chai": "4.3.6", | ||
| "@form8ion/remark-lint-preset": "5.0.0", | ||
| "@travi/any": "2.1.8", | ||
| "ban-sensitive-files": "1.9.19", | ||
| "c8": "7.13.0", | ||
| "chai": "4.3.7", | ||
| "cross-env": "7.0.3", | ||
| "cz-conventional-changelog": "3.3.0", | ||
| "gherkin-lint": "4.2.2", | ||
| "husky": "8.0.1", | ||
| "lockfile-lint": "4.7.5", | ||
| "ls-engines": "0.7.0", | ||
| "mocha": "10.0.0", | ||
| "husky": "8.0.3", | ||
| "jest-when": "3.5.2", | ||
| "lockfile-lint": "4.10.1", | ||
| "ls-engines": "0.9.0", | ||
| "npm-run-all": "4.1.5", | ||
| "package-preview": "4.0.0", | ||
| "remark": "13.0.0", | ||
| "remark-cli": "9.0.0", | ||
| "remark-toc": "7.2.0", | ||
| "remark-usage": "9.0.0", | ||
| "rimraf": "3.0.2", | ||
| "rollup": "2.75.7", | ||
| "remark": "14.0.2", | ||
| "remark-cli": "11.0.0", | ||
| "remark-toc": "8.0.1", | ||
| "remark-usage": "10.0.1", | ||
| "rimraf": "5.0.0", | ||
| "rollup": "3.20.2", | ||
| "rollup-plugin-auto-external": "2.0.0", | ||
| "rollup-plugin-babel": "4.4.0", | ||
| "sinon": "14.0.0" | ||
| }, | ||
| "dependencies": { | ||
| "mdast-util-definitions": "^4.0.0", | ||
| "unist-util-remove": "^2.0.1", | ||
| "unist-util-visit": "^2.0.3" | ||
| "vitest": "0.30.1" | ||
| } | ||
| } |
| 'use strict'; | ||
| var remove = require('unist-util-remove'); | ||
| var visit = require('unist-util-visit'); | ||
| var definitions = require('mdast-util-definitions'); | ||
| function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
| var remove__default = /*#__PURE__*/_interopDefaultLegacy(remove); | ||
| var visit__default = /*#__PURE__*/_interopDefaultLegacy(visit); | ||
| var definitions__default = /*#__PURE__*/_interopDefaultLegacy(definitions); | ||
| function createBadgePredicate () { | ||
| return node => 'link' === node.type && node.url.startsWith('https://travis-ci.com'); | ||
| } | ||
| function createReferencedBadgePredicate (tree) { | ||
| const getDefinitionByIdentifier = definitions__default["default"](tree); | ||
| return node => { | ||
| if ('linkReference' === node.type) { | ||
| const definition = getDefinitionByIdentifier(node.identifier); | ||
| return !!definition.url && definition.url.startsWith('https://travis-ci.com'); | ||
| } | ||
| return false; | ||
| }; | ||
| } | ||
| function nodeIsLastChild(index, parent) { | ||
| return index === parent.children.length - 1; | ||
| } | ||
| function nextSiblingIsNewline(nextSibling) { | ||
| return 'text' === (nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.type) && '\n' === nextSibling.value; | ||
| } | ||
| function mergeNewlines (node, index, parent) { | ||
| if ('paragraph' === parent.type) { | ||
| const nextSibling = parent.children[index + 1]; | ||
| if (nodeIsLastChild(index, parent) || nextSiblingIsNewline(nextSibling)) { | ||
| parent.children.splice(index, 1); | ||
| } | ||
| } | ||
| } | ||
| function plugin () { | ||
| return function transformer(tree) { | ||
| remove__default["default"](tree, createBadgePredicate()); | ||
| remove__default["default"](tree, createReferencedBadgePredicate(tree)); | ||
| remove__default["default"](tree, { | ||
| type: 'definition', | ||
| identifier: 'ci-badge' | ||
| }); | ||
| remove__default["default"](tree, { | ||
| type: 'definition', | ||
| identifier: 'ci-link' | ||
| }); | ||
| visit__default["default"](tree, { | ||
| type: 'text', | ||
| value: '\n' | ||
| }, mergeNewlines); | ||
| }; | ||
| } | ||
| module.exports = plugin; | ||
| //# sourceMappingURL=index.cjs.js.map |
| {"version":3,"file":"index.cjs.js","sources":["../src/badge-predicate.js","../src/referenced-badge-predicate.js","../src/merge-newlines-in-paragraph.js","../src/plugin.js"],"sourcesContent":["export default function () {\n return node => 'link' === node.type && node.url.startsWith('https://travis-ci.com');\n}\n","import definitions from '../thirdparty-wrappers/mdast-util-definitions';\n\nexport default function (tree) {\n const getDefinitionByIdentifier = definitions(tree);\n\n return node => {\n if ('linkReference' === node.type) {\n const definition = getDefinitionByIdentifier(node.identifier);\n\n return !!definition.url && definition.url.startsWith('https://travis-ci.com');\n }\n\n return false;\n };\n}\n","function nodeIsLastChild(index, parent) {\n return index === parent.children.length - 1;\n}\n\nfunction nextSiblingIsNewline(nextSibling) {\n return 'text' === nextSibling?.type && '\\n' === nextSibling.value;\n}\n\nexport default function (node, index, parent) {\n if ('paragraph' === parent.type) {\n const nextSibling = parent.children[index + 1];\n\n if (nodeIsLastChild(index, parent) || nextSiblingIsNewline(nextSibling)) {\n parent.children.splice(index, 1);\n }\n }\n}\n","import remove from '../thirdparty-wrappers/unist-util-remove';\nimport visit from '../thirdparty-wrappers/unist-util-visit';\nimport createBadgePredicate from './badge-predicate';\nimport createReferencedBadgePredicate from './referenced-badge-predicate';\nimport mergeNewlines from './merge-newlines-in-paragraph';\n\nexport default function () {\n return function transformer(tree) {\n remove(tree, createBadgePredicate(tree));\n remove(tree, createReferencedBadgePredicate(tree));\n remove(tree, {type: 'definition', identifier: 'ci-badge'});\n remove(tree, {type: 'definition', identifier: 'ci-link'});\n visit(tree, {type: 'text', value: '\\n'}, mergeNewlines);\n };\n}\n"],"names":["node","type","url","startsWith","tree","getDefinitionByIdentifier","definitions","definition","identifier","nodeIsLastChild","index","parent","children","length","nextSiblingIsNewline","nextSibling","value","splice","transformer","remove","createBadgePredicate","createReferencedBadgePredicate","visit","mergeNewlines"],"mappings":";;;;;;;;;;;;AAAe,6BAAY,IAAA;AACzB,EAAA,OAAOA,IAAI,IAAI,MAAWA,KAAAA,IAAI,CAACC,IAAhB,IAAwBD,IAAI,CAACE,GAAL,CAASC,UAAT,CAAoB,uBAApB,CAAvC,CAAA;AACD;;ACAc,uCAAA,EAAUC,IAAV,EAAgB;AAC7B,EAAA,MAAMC,yBAAyB,GAAGC,+BAAW,CAACF,IAAD,CAA7C,CAAA;AAEA,EAAA,OAAOJ,IAAI,IAAI;AACb,IAAA,IAAI,eAAoBA,KAAAA,IAAI,CAACC,IAA7B,EAAmC;AACjC,MAAA,MAAMM,UAAU,GAAGF,yBAAyB,CAACL,IAAI,CAACQ,UAAN,CAA5C,CAAA;AAEA,MAAA,OAAO,CAAC,CAACD,UAAU,CAACL,GAAb,IAAoBK,UAAU,CAACL,GAAX,CAAeC,UAAf,CAA0B,uBAA1B,CAA3B,CAAA;AACD,KAAA;;AAED,IAAA,OAAO,KAAP,CAAA;GAPF,CAAA;AASD;;ACdD,SAASM,eAAT,CAAyBC,KAAzB,EAAgCC,MAAhC,EAAwC;E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AAK,CAAClB,IAAD,EAAO;AAACH,MAAAA,IAAI,EAAE,MAAP;AAAee,MAAAA,KAAK,EAAE,IAAA;KAA7B,EAAoCO,aAApC,CAAL,CAAA;GALF,CAAA;AAOD;;;;"} |
| import remove from 'unist-util-remove'; | ||
| import visit from 'unist-util-visit'; | ||
| import definitions from 'mdast-util-definitions'; | ||
| function createBadgePredicate () { | ||
| return node => 'link' === node.type && node.url.startsWith('https://travis-ci.com'); | ||
| } | ||
| function createReferencedBadgePredicate (tree) { | ||
| const getDefinitionByIdentifier = definitions(tree); | ||
| return node => { | ||
| if ('linkReference' === node.type) { | ||
| const definition = getDefinitionByIdentifier(node.identifier); | ||
| return !!definition.url && definition.url.startsWith('https://travis-ci.com'); | ||
| } | ||
| return false; | ||
| }; | ||
| } | ||
| function nodeIsLastChild(index, parent) { | ||
| return index === parent.children.length - 1; | ||
| } | ||
| function nextSiblingIsNewline(nextSibling) { | ||
| return 'text' === (nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.type) && '\n' === nextSibling.value; | ||
| } | ||
| function mergeNewlines (node, index, parent) { | ||
| if ('paragraph' === parent.type) { | ||
| const nextSibling = parent.children[index + 1]; | ||
| if (nodeIsLastChild(index, parent) || nextSiblingIsNewline(nextSibling)) { | ||
| parent.children.splice(index, 1); | ||
| } | ||
| } | ||
| } | ||
| function plugin () { | ||
| return function transformer(tree) { | ||
| remove(tree, createBadgePredicate()); | ||
| remove(tree, createReferencedBadgePredicate(tree)); | ||
| remove(tree, { | ||
| type: 'definition', | ||
| identifier: 'ci-badge' | ||
| }); | ||
| remove(tree, { | ||
| type: 'definition', | ||
| identifier: 'ci-link' | ||
| }); | ||
| visit(tree, { | ||
| type: 'text', | ||
| value: '\n' | ||
| }, mergeNewlines); | ||
| }; | ||
| } | ||
| export { plugin as default }; | ||
| //# sourceMappingURL=index.es.js.map |
| {"version":3,"file":"index.es.js","sources":["../src/badge-predicate.js","../src/referenced-badge-predicate.js","../src/merge-newlines-in-paragraph.js","../src/plugin.js"],"sourcesContent":["export default function () {\n return node => 'link' === node.type && node.url.startsWith('https://travis-ci.com');\n}\n","import definitions from '../thirdparty-wrappers/mdast-util-definitions';\n\nexport default function (tree) {\n const getDefinitionByIdentifier = definitions(tree);\n\n return node => {\n if ('linkReference' === node.type) {\n const definition = getDefinitionByIdentifier(node.identifier);\n\n return !!definition.url && definition.url.startsWith('https://travis-ci.com');\n }\n\n return false;\n };\n}\n","function nodeIsLastChild(index, parent) {\n return index === parent.children.length - 1;\n}\n\nfunction nextSiblingIsNewline(nextSibling) {\n return 'text' === nextSibling?.type && '\\n' === nextSibling.value;\n}\n\nexport default function (node, index, parent) {\n if ('paragraph' === parent.type) {\n const nextSibling = parent.children[index + 1];\n\n if (nodeIsLastChild(index, parent) || nextSiblingIsNewline(nextSibling)) {\n parent.children.splice(index, 1);\n }\n }\n}\n","import remove from '../thirdparty-wrappers/unist-util-remove';\nimport visit from '../thirdparty-wrappers/unist-util-visit';\nimport createBadgePredicate from './badge-predicate';\nimport createReferencedBadgePredicate from './referenced-badge-predicate';\nimport mergeNewlines from './merge-newlines-in-paragraph';\n\nexport default function () {\n return function transformer(tree) {\n remove(tree, createBadgePredicate(tree));\n remove(tree, createReferencedBadgePredicate(tree));\n remove(tree, {type: 'definition', identifier: 'ci-badge'});\n remove(tree, {type: 'definition', identifier: 'ci-link'});\n visit(tree, {type: 'text', value: '\\n'}, mergeNewlines);\n };\n}\n"],"names":["node","type","url","startsWith","tree","getDefinitionByIdentifier","definitions","definition","identifier","nodeIsLastChild","index","parent","children","length","nextSiblingIsNewline","nextSibling","value","splice","transformer","remove","createBadgePredicate","createReferencedBadgePredicate","visit","mergeNewlines"],"mappings":";;;;AAAe,6BAAY,IAAA;AACzB,EAAA,OAAOA,IAAI,IAAI,MAAWA,KAAAA,IAAI,CAACC,IAAhB,IAAwBD,IAAI,CAACE,GAAL,CAASC,UAAT,CAAoB,uBAApB,CAAvC,CAAA;AACD;;ACAc,uCAAA,EAAUC,IAAV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