hast-util-to-nlcst
Advanced tools
Comparing version 1.0.0 to 1.1.0
22
index.js
@@ -1,9 +0,1 @@ | ||
/** | ||
* @author Titus Wormer | ||
* @copyright 2016 Titus Wormer | ||
* @license MIT | ||
* @module hast:to-nlcst | ||
* @fileoverview Transform HAST to NLCST. | ||
*/ | ||
'use strict'; | ||
@@ -56,11 +48,3 @@ | ||
/** | ||
* Transform `tree` into `nlcst`. | ||
* | ||
* @param {Node} tree - HAST node. | ||
* @param {File} file - Virtual file. | ||
* @param {Parser|Function} Parser - (Instance of) NLCST | ||
* parser. | ||
* @return {NLCSTNode} - NLCST. | ||
*/ | ||
/* Transform `tree` to `nlcst`. */ | ||
function toNLCST(tree, file, Parser) { | ||
@@ -105,3 +89,3 @@ var parser; | ||
return { | ||
type: 'root', | ||
type: 'RootNode', | ||
children: results, | ||
@@ -166,3 +150,3 @@ position: { | ||
if (result.length) { | ||
if (result.length !== 0) { | ||
results.push(parser.tokenizeParagraph(result)); | ||
@@ -169,0 +153,0 @@ } |
{ | ||
"name": "hast-util-to-nlcst", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Transform HAST to NLCST", | ||
@@ -48,3 +48,3 @@ "license": "MIT", | ||
"vfile": "^2.0.0", | ||
"xo": "^0.16.0" | ||
"xo": "^0.17.0" | ||
}, | ||
@@ -51,0 +51,0 @@ "scripts": { |
@@ -45,3 +45,3 @@ # hast-util-to-nlcst [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
```txt | ||
root[2] (1:1-6:1, 0-134) | ||
RootNode[2] (1:1-6:1, 0-134) | ||
├─ ParagraphNode[3] (1:10-3:3, 9-24) | ||
@@ -48,0 +48,0 @@ │ ├─ WhiteSpaceNode: "\n " (1:10-2:3, 9-12) |
12214
226