Skip to content

Commit a2b7b6d

Browse files
committed
Fix to export separate identifiers
Closes GH-19.
1 parent 5713fac commit a2b7b6d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
* @typedef {import('./lib/index.js').WriteOptions} WriteOptions
88
*/
99

10-
export {toVFile} from './lib/index.js'
10+
export {toVFile, read, readSync, write, writeSync} from './lib/index.js'

test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path'
33
import {fileURLToPath, URL} from 'url'
44
import test from 'tape'
55
import buffer from 'is-buffer'
6-
import {toVFile} from './index.js'
6+
import {toVFile, read, readSync, write, writeSync} from './index.js'
77

88
var join = path.join
99

@@ -69,6 +69,8 @@ test('toVFile()', function (t) {
6969
})
7070

7171
test('toVFile.readSync', function (t) {
72+
t.equal(toVFile.readSync, readSync, 'should export as an identifier')
73+
7274
t.test('should fail without path', function (st) {
7375
st.throws(function () {
7476
// @ts-ignore runtime.
@@ -137,6 +139,8 @@ test('toVFile.readSync', function (t) {
137139
})
138140

139141
test('toVFile.read', function (t) {
142+
t.equal(toVFile.read, read, 'should export as an identifier')
143+
140144
t.test('should pass an error without path', function (st) {
141145
st.plan(1)
142146

@@ -229,6 +233,8 @@ test('toVFile.writeSync', function (t) {
229233
var filePath = 'fixture.txt'
230234
var invalidFilePath = join('invalid', 'path', 'to', 'fixture.txt')
231235

236+
t.equal(toVFile.writeSync, writeSync, 'should export as an identifier')
237+
232238
t.test('should fail without path', function (st) {
233239
st.throws(function () {
234240
// @ts-ignore runtime.
@@ -283,6 +289,8 @@ test('toVFile.write', function (t) {
283289
var filePath = 'fixture.txt'
284290
var invalidFilePath = join('invalid', 'path', 'to', 'fixture.txt')
285291

292+
t.equal(toVFile.write, write, 'should export as an identifier')
293+
286294
t.test('should pass an error without path', function (st) {
287295
st.plan(1)
288296

0 commit comments

Comments
 (0)