orgast-util-visit-ids
Advanced tools
Comparing version 0.4.5 to 0.5.0
@@ -1,10 +0,7 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.visitIds = void 0; | ||
const unist_util_visit_parents_1 = __importDefault(require("unist-util-visit-parents")); | ||
function visitIds(tree, f) { | ||
unist_util_visit_parents_1.default(tree, { type: 'node-property', key: 'ID' }, (property, ancestors) => { | ||
import { visitParents } from 'unist-util-visit-parents'; | ||
export function visitIds(tree, f) { | ||
// This issue does not seem fixed | ||
// 👀https://github.com/syntax-tree/unist-util-visit/issues/33 | ||
// @ts-ignore Incessantly deep type instantiation | ||
visitParents(tree, { type: 'node-property', key: 'ID' }, (property, ancestors) => { | ||
const id = property.value; | ||
@@ -22,3 +19,2 @@ let parent = ancestors.pop(); | ||
} | ||
exports.visitIds = visitIds; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "orgast-util-visit-ids", | ||
"version": "0.4.5", | ||
"version": "0.5.0", | ||
"type": "module", | ||
"description": "orgast (uniorg) utility to visit all nodes with ids", | ||
@@ -40,13 +41,13 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/jest": "^26.0.23", | ||
"@types/unist": "^2.0.3", | ||
"jest": "^26.6.3", | ||
"typescript": "^4.3.2", | ||
"uniorg": "^0.4.0", | ||
"uniorg-parse": "^0.4.5" | ||
"@types/jest": "27.4.1", | ||
"@types/unist": "2.0.6", | ||
"jest": "27.5.1", | ||
"typescript": "4.6.3", | ||
"uniorg": "^0.5.0", | ||
"uniorg-parse": "^0.5.0" | ||
}, | ||
"dependencies": { | ||
"unist-util-visit-parents": "^3.1.1" | ||
"unist-util-visit-parents": "5.1.0" | ||
}, | ||
"gitHead": "3d6bc077f2ee16eebf35d57e6b93d98022e0b65d" | ||
"gitHead": "e77afd8255895985eaa8b0cf15de8edab81a89b6" | ||
} |
@@ -11,13 +11,10 @@ # `orgast-util-visit-ids` | ||
## Use | ||
```js | ||
import unified from 'unified'; | ||
import { unified } from 'unified'; | ||
import uniorgParse from 'uniorg-parse'; | ||
import { visitIds } from 'orgast-util-visit-ids'; | ||
const tree = unified() | ||
.use(uniorgParse) | ||
.parse(` | ||
const tree = unified().use(uniorgParse).parse(` | ||
:PROPERTIES: | ||
@@ -45,6 +42,4 @@ :ID: id-org-data | ||
## API | ||
### `visitIds(node: OrgData, callback: (id: string, node: OrgData | Headline) => void)` | ||
@@ -51,0 +46,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Yes
38756
6
20
50
+ Addedunist-util-is@5.2.1(transitive)
+ Addedunist-util-visit-parents@5.1.0(transitive)
- Removedunist-util-is@4.1.0(transitive)
- Removedunist-util-visit-parents@3.1.1(transitive)