Skip to content

Commit 1c4c12a

Browse files
committed
Refactor internal terminology
1 parent 10ec5f7 commit 1c4c12a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

index.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function unist(node) {
7272
assert.strictEqual(typeof value, 'string', '`value` should be a string')
7373
}
7474

75-
location(node.position)
75+
position(node.position)
7676

7777
for (key in node) {
7878
if (defined.indexOf(key) === -1) {
@@ -139,7 +139,7 @@ function text(node) {
139139
assert.ok('value' in node, 'text should have `value`')
140140
}
141141

142-
// Assert `node` is a Unist node, but neither parent nor text.
142+
// Assert `node` is a unist node, but neither parent nor text.
143143
function empty(node) {
144144
unist(node)
145145

@@ -151,32 +151,32 @@ function empty(node) {
151151
)
152152
}
153153

154-
// Assert `location` is a Unist Location.
155-
function location(location) {
156-
if (location != null) {
157-
assert.ok(object(location), '`position` should be an object')
154+
// Assert `position` is a unist position.
155+
function position(position) {
156+
if (position != null) {
157+
assert.ok(object(position), '`position` should be an object')
158158

159-
position(location.start, 'position.start')
160-
position(location.end, 'position.end')
159+
point(position.start, 'position.start')
160+
point(position.end, 'position.end')
161161
}
162162
}
163163

164-
// Assert `location` is a Unist Location.
165-
function position(position, name) {
166-
if (position != null) {
167-
assert.ok(object(position), '`' + name + '` should be an object')
164+
// Assert `point` is a unist point.
165+
function point(point, name) {
166+
if (point != null) {
167+
assert.ok(object(point), '`' + name + '` should be an object')
168168

169-
if (position.line != null) {
170-
assert.ok('line' in position, '`' + name + '` should have numeric `line`')
171-
assert.ok(position.line >= 1, '`' + name + '.line` should be gte `1`')
169+
if (point.line != null) {
170+
assert.ok('line' in point, '`' + name + '` should have numeric `line`')
171+
assert.ok(point.line >= 1, '`' + name + '.line` should be gte `1`')
172172
}
173173

174-
if (position.column != null) {
174+
if (point.column != null) {
175175
assert.ok(
176-
'column' in position,
176+
'column' in point,
177177
'`' + name + '` should have numeric `column`'
178178
)
179-
assert.ok(position.column >= 1, '`' + name + '.column` should be gte `1`')
179+
assert.ok(point.column >= 1, '`' + name + '.column` should be gte `1`')
180180
}
181181
}
182182
}

0 commit comments

Comments
 (0)