Skip to content

Commit 1139f1d

Browse files
committed
Export as ESM
1 parent 1ba386f commit 1139f1d

6 files changed

Lines changed: 8 additions & 10 deletions

File tree

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "basic-auth",
33
"version": "2.0.1",
4-
"description": "node.js basic auth parser",
4+
"description": "Basic auth parser",
55
"keywords": [
66
"basic",
77
"auth",
@@ -10,10 +10,8 @@
1010
],
1111
"repository": "jshttp/basic-auth",
1212
"license": "MIT",
13-
"type": "commonjs",
13+
"type": "module",
1414
"exports": "./dist/index.js",
15-
"main": "./dist/index.js",
16-
"types": "./dist/index.d.ts",
1715
"files": [
1816
"dist/"
1917
],

src/format.bench.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { bench, describe } from 'vitest';
2-
import { format } from './index';
2+
import { format } from './index.js';
33

44
describe('format', () => {
55
bench('format with simple credentials', () => {

src/format.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, assert } from 'vitest';
2-
import { format } from './index';
2+
import { format } from './index.js';
33

44
describe('format(credentials)', function () {
55
describe('arguments', function () {

src/parse.bench.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, bench } from 'vitest';
2-
import { parse } from './index';
2+
import { parse } from './index.js';
33

44
describe('parse', () => {
55
bench('basic auth header', () => {

src/parse.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, assert } from 'vitest';
2-
import { parse } from './index';
2+
import { parse } from './index.js';
33

44
describe('parse(string)', function () {
55
describe('with undefined string', function () {

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"extends": "@borderless/ts-scripts/configs/tsconfig.json",
33
"compilerOptions": {
4-
"target": "ES2022",
5-
"lib": ["ES2023"],
4+
"target": "es2023",
5+
"lib": ["es2023"],
66
"rootDir": "src",
77
"outDir": "dist",
88
"module": "nodenext",

0 commit comments

Comments
 (0)