Skip to content

Commit 10ec5f7

Browse files
committed
Refactor comment-style
1 parent 77b9434 commit 10ec5f7

File tree

2 files changed

+15
-32
lines changed

2 files changed

+15
-32
lines changed

index.js

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
/* Dependencies. */
43
var assert = require('assert')
54
var array = require('x-is-array')
65
var object = require('x-is-object')
@@ -10,11 +9,8 @@ var inspect
109
try {
1110
// eslint-disable-next-line no-useless-concat
1211
inspect = require('ut' + 'il').inspect
13-
} catch (error) {
14-
/* Empty. */
15-
}
12+
} catch (error) {}
1613

17-
/* Expose. */
1814
exports = wrap(unist)
1915
module.exports = exports
2016

@@ -23,14 +19,14 @@ exports.text = wrap(text)
2319
exports.void = wrap(empty)
2420
exports.wrap = wrap
2521

26-
/* Identifier to check if a value is seen. */
22+
// Identifier to check if a value is seen.
2723
var ID = '__unist__'
2824

29-
/* List of specced properties. */
25+
// List of specced properties.
3026
var defined = ['type', 'value', 'children', 'position']
3127

32-
/* Wrapper around `Node` which adds the current node
33-
* (and parent, if available), to the message. */
28+
// Wrapper around `Node` which adds the current node (and parent, if available),
29+
// to the message.
3430
function wrap(fn) {
3531
return wrapped
3632

@@ -53,7 +49,7 @@ function wrap(fn) {
5349
}
5450
}
5551

56-
/* Assert. */
52+
// Assert.
5753
function unist(node) {
5854
var type
5955
var children
@@ -95,8 +91,8 @@ function unist(node) {
9591
}
9692
}
9793

98-
/* Assert `value` (which lives at `key`) can be stringified
99-
* and re-parsed to the same (deep) value. */
94+
// Assert `value` (which lives at `key`) can be stringified and re-parsed to the
95+
// same (deep) value.
10096
function vanilla(key, value) {
10197
try {
10298
assert.deepStrictEqual(value, JSON.parse(JSON.stringify(value)))
@@ -105,9 +101,8 @@ function vanilla(key, value) {
105101
}
106102
}
107103

108-
/* Stringify a value to inspect it. Tries `JSON.stringify()`,
109-
* and if that fails uses `String()` instead. If `stringify()`
110-
* works. */
104+
// Stringify a value to inspect it.
105+
// Tries `JSON.stringify()`, and if that fails uses `String()` instead.
111106
function view(value) {
112107
try {
113108
/* eslint-disable no-else-return */
@@ -124,15 +119,15 @@ function view(value) {
124119
}
125120
}
126121

127-
/* Assert `node` is a parent node. */
122+
// Assert `node` is a parent node.
128123
function parent(node) {
129124
unist(node)
130125

131126
assert.strictEqual('value' in node, false, 'parent should not have `value`')
132127
assert.ok('children' in node, 'parent should have `children`')
133128
}
134129

135-
/* Assert `node` is a text node. */
130+
// Assert `node` is a text node.
136131
function text(node) {
137132
unist(node)
138133

@@ -144,8 +139,7 @@ function text(node) {
144139
assert.ok('value' in node, 'text should have `value`')
145140
}
146141

147-
/* Assert `node` is a Unist node, but neither parent nor
148-
* text. */
142+
// Assert `node` is a Unist node, but neither parent nor text.
149143
function empty(node) {
150144
unist(node)
151145

@@ -157,7 +151,7 @@ function empty(node) {
157151
)
158152
}
159153

160-
/* Assert `location` is a Unist Location. */
154+
// Assert `location` is a Unist Location.
161155
function location(location) {
162156
if (location != null) {
163157
assert.ok(object(location), '`position` should be an object')
@@ -167,7 +161,7 @@ function location(location) {
167161
}
168162
}
169163

170-
/* Assert `location` is a Unist Location. */
164+
// Assert `location` is a Unist Location.
171165
function position(position, name) {
172166
if (position != null) {
173167
assert.ok(object(position), '`' + name + '` should be an object')

test/void.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
/**
2-
* @author Titus Wormer
3-
* @copyright 2016 Titus Wormer
4-
* @license MIT
5-
* @module unist-util-assert
6-
* @fileoverview Test suite for `unist-util-assert`.
7-
*/
8-
91
'use strict'
102

11-
/* eslint-env node */
12-
13-
/* Dependencies. */
143
var test = require('tape')
154
var assert = require('..')
165

0 commit comments

Comments
 (0)