Skip to content

Commit

Permalink
Fix to export separate identifiers
Browse files Browse the repository at this point in the history
Closes GH-19.
  • Loading branch information
wooorm committed Jul 16, 2021
1 parent 5713fac commit a2b7b6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @typedef {import('./lib/index.js').WriteOptions} WriteOptions
*/

export {toVFile} from './lib/index.js'
export {toVFile, read, readSync, write, writeSync} from './lib/index.js'
10 changes: 9 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path'
import {fileURLToPath, URL} from 'url'
import test from 'tape'
import buffer from 'is-buffer'
import {toVFile} from './index.js'
import {toVFile, read, readSync, write, writeSync} from './index.js'

var join = path.join

Expand Down Expand Up @@ -69,6 +69,8 @@ test('toVFile()', function (t) {
})

test('toVFile.readSync', function (t) {
t.equal(toVFile.readSync, readSync, 'should export as an identifier')

t.test('should fail without path', function (st) {
st.throws(function () {
// @ts-ignore runtime.
Expand Down Expand Up @@ -137,6 +139,8 @@ test('toVFile.readSync', function (t) {
})

test('toVFile.read', function (t) {
t.equal(toVFile.read, read, 'should export as an identifier')

t.test('should pass an error without path', function (st) {
st.plan(1)

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

t.equal(toVFile.writeSync, writeSync, 'should export as an identifier')

t.test('should fail without path', function (st) {
st.throws(function () {
// @ts-ignore runtime.
Expand Down Expand Up @@ -283,6 +289,8 @@ test('toVFile.write', function (t) {
var filePath = 'fixture.txt'
var invalidFilePath = join('invalid', 'path', 'to', 'fixture.txt')

t.equal(toVFile.write, write, 'should export as an identifier')

t.test('should pass an error without path', function (st) {
st.plan(1)

Expand Down

0 comments on commit a2b7b6d

Please sign in to comment.