diff --git a/.aegir.js b/.aegir.js index ccabddb..f3feeae 100644 --- a/.aegir.js +++ b/.aegir.js @@ -1,16 +1,22 @@ -'use strict'; +import EchoServer from 'aegir/echo-server' +import { format } from 'iso-url' +import url from 'url' +import { createRequire } from 'module' -const EchoServer = require('aegir/utils/echo-server') -const { format } =require('iso-url') +const require = createRequire(import.meta.url) /** @type {import('aegir').Options["build"]["config"]} */ const esbuild = { + format: 'esm', plugins: [ { name: 'node built ins', setup (build) { build.onResolve({ filter: /^stream$/ }, () => { - return { path: require.resolve('readable-stream') } + return { path: require.resolve('readable-stream') } + }) + build.onResolve({filter: /^url$/}, () => { + return { path: require.resolve('url/') } }) } } @@ -18,7 +24,7 @@ const esbuild = { } /** @type {import('aegir').PartialOptions} */ -module.exports = { +export default { build: { config: esbuild }, diff --git a/package.json b/package.json index a72c73e..2b61bed 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,16 @@ "url": "https://github.com/ipfs/js-ipfs-utils/issues" }, "engines": { - "node": ">=16.0.0", + "node": ">=16.8.0", "npm": ">=7.0.0" }, - "main": "src/index.js", + "type": "module", + "exports": { + ".": { + "types": "./dist/src/index.d.ts", + "import": "./dist/src/index.js" + } + }, "types": "dist/src/index.d.ts", "typesVersions": { "*": { @@ -39,7 +45,11 @@ "eslintConfig": { "extends": "ipfs", "env": { - "worker": true + "worker": true, + "es6": true + }, + "parserOptions": { + "sourceType": "module" } }, "release": { @@ -155,14 +165,16 @@ "it-to-stream": "^1.0.0", "merge-options": "^3.0.4", "nanoid": "^3.1.20", - "native-fetch": "^3.0.0", + "native-fetch": "^4.0.2", "node-fetch": "^2.6.8", "react-native-fetch-api": "^3.0.0", - "stream-to-it": "^0.2.2" + "stream-to-it": "^0.2.2", + "undici": "^5.21.0" }, "devDependencies": { - "aegir": "^36.1.1", + "aegir": "^38.1.7", "delay": "^5.0.0", + "eslint-plugin-n": "^15.6.1", "events": "^3.3.0", "ipfs-unixfs": "^6.0.4", "it-drain": "^1.0.3", @@ -171,6 +183,7 @@ "react-native-polyfill-globals": "^3.0.0", "readable-stream": "^4.3.0", "uint8arrays": "^3.0.0", + "url": "^0.11.0", "util": "^0.12.3" }, "browser": { diff --git a/rn-test.config.js b/rn-test.config.js index 6e94e80..1fb3326 100644 --- a/rn-test.config.js +++ b/rn-test.config.js @@ -1,4 +1,3 @@ -'use strict' module.exports = { require: require.resolve('./rn-test.require.js'), diff --git a/rn-test.require.js b/rn-test.require.js index 9a37889..a42b4ba 100644 --- a/rn-test.require.js +++ b/rn-test.require.js @@ -1,4 +1,3 @@ -'use strict' const { polyfill: polyfillReadableStream } = require('react-native-polyfill-globals/src/readable-stream') const { polyfill: polyfillURL } = require('react-native-polyfill-globals/src/url') diff --git a/src/env.js b/src/env.js index c89a1b0..07bebb4 100644 --- a/src/env.js +++ b/src/env.js @@ -1,29 +1,22 @@ -'use strict' -const isElectron = require('is-electron') - -const IS_ENV_WITH_DOM = typeof window === 'object' && typeof document === 'object' && document.nodeType === 9 -// @ts-ignore -const IS_ELECTRON = isElectron() -const IS_BROWSER = IS_ENV_WITH_DOM && !IS_ELECTRON -const IS_ELECTRON_MAIN = IS_ELECTRON && !IS_ENV_WITH_DOM -const IS_ELECTRON_RENDERER = IS_ELECTRON && IS_ENV_WITH_DOM -const IS_NODE = typeof require === 'function' && typeof process !== 'undefined' && typeof process.release !== 'undefined' && process.release.name === 'node' && !IS_ELECTRON +import isElectronFn from 'is-electron' +const isEnvWithDom = typeof window === 'object' && typeof document === 'object' && document.nodeType === 9 +const isElectron = isElectronFn() +const isBrowser = isEnvWithDom && !isElectron +const isElectronMain = isElectron && !isEnvWithDom +const isElectronRenderer = isElectron && isEnvWithDom +const isNode = typeof process !== 'undefined' && typeof process.release !== 'undefined' && process.release.name === 'node' && !isElectron // @ts-ignore - we either ignore worker scope or dom scope -const IS_WEBWORKER = typeof importScripts === 'function' && typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope -const IS_TEST = typeof process !== 'undefined' && typeof process.env !== 'undefined' && process.env.NODE_ENV === 'test' -const IS_REACT_NATIVE = typeof navigator !== 'undefined' && navigator.product === 'ReactNative' - -module.exports = { - isTest: IS_TEST, - isElectron: IS_ELECTRON, - isElectronMain: IS_ELECTRON_MAIN, - isElectronRenderer: IS_ELECTRON_RENDERER, - isNode: IS_NODE, +const isWebWorker = typeof importScripts === 'function' && typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope +const isTest = typeof process !== 'undefined' && typeof process.env !== 'undefined' && process.env.NODE_ENV === 'test' +const isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative' +export { + isTest, isElectron, isElectronMain, isElectronRenderer, isNode, /** * Detects browser main thread **NOT** web worker or service worker */ - isBrowser: IS_BROWSER, - isWebWorker: IS_WEBWORKER, - isEnvWithDom: IS_ENV_WITH_DOM, - isReactNative: IS_REACT_NATIVE + isBrowser, isWebWorker, isEnvWithDom, isReactNative +} + +export default { + isTest, isElectron, isElectronMain, isElectronRenderer, isNode, isBrowser, isWebWorker, isEnvWithDom, isReactNative } diff --git a/src/fetch.browser.js b/src/fetch.browser.js index 57b8c79..d6016d0 100644 --- a/src/fetch.browser.js +++ b/src/fetch.browser.js @@ -1,4 +1,3 @@ -'use strict' /** * @typedef {globalThis.Headers} Headers @@ -6,5 +5,8 @@ * @typedef {globalThis.Response} Response */ +import { fetch, Request, Response, Headers } from 'native-fetch' + // use window.fetch if it is available, fall back to node-fetch if not -module.exports = require('native-fetch') +export default fetch +export { Request, Response, Headers } diff --git a/src/fetch.js b/src/fetch.js index a941d92..7935376 100644 --- a/src/fetch.js +++ b/src/fetch.js @@ -1,13 +1,10 @@ -'use strict' - /** * @typedef {globalThis.Headers} Headers * @typedef {globalThis.Request} Request * @typedef {globalThis.Response} Response */ -const { isElectronMain } = require('./env') - +import { isElectronMain } from './env.js' // use window.fetch if it is available, fall back to node-fetch if not let impl = 'native-fetch' @@ -15,4 +12,11 @@ if (isElectronMain) { impl = 'electron-fetch' } -module.exports = require(impl) +const fetchImpl = await import(impl) + +export const fetch = fetchImpl.fetch +export const Request = fetchImpl.Request +export const Response = fetchImpl.Response +export const Headers = fetchImpl.Headers + +export default fetch diff --git a/src/fetch.rn.js b/src/fetch.rn.js index 54688ed..0bf08ae 100644 --- a/src/fetch.rn.js +++ b/src/fetch.rn.js @@ -1,7 +1,5 @@ -// @ts-nocheck -'use strict' // @ts-ignore -const { Headers, Request, Response, fetch } = require('react-native-fetch-api') +import { Headers, Request, Response, fetch } from 'react-native-fetch-api' /** @type {import('electron-fetch').default} */ const rnFetch = fetch @@ -11,8 +9,5 @@ const rnHeaders = Headers const rnRequest = Request /** @type {import('electron-fetch').Response} */ const rnResponse = Response -module.exports = rnFetch -module.exports.Headers = rnHeaders -module.exports.Request = rnRequest -module.exports.Response = rnResponse -module.exports.default = rnFetch +export default rnFetch +export { rnHeaders as Headers, rnRequest as Request, rnResponse as Response } diff --git a/src/files/glob-source.js b/src/files/glob-source.js index 49c114c..d640548 100644 --- a/src/files/glob-source.js +++ b/src/files/glob-source.js @@ -1,10 +1,8 @@ -'use strict' - -const fsp = require('fs').promises -const fs = require('fs') -const glob = require('it-glob') -const Path = require('path') -const errCode = require('err-code') +import fsp from 'fs/promises' +import fs from 'fs' +import glob from 'it-glob' +import Path from 'path' +import errCode from 'err-code' /** * Create an async iterator that yields paths that match requested glob pattern @@ -14,7 +12,7 @@ const errCode = require('err-code') * @param {import('../types').GlobSourceOptions} [options] - Optional options * @returns {AsyncGenerator} File objects that match glob */ -module.exports = async function * globSource (cwd, pattern, options) { +export default async function * globSource (cwd, pattern, options) { options = options || {} if (typeof pattern !== 'string') { diff --git a/src/files/url-source.js b/src/files/url-source.js index 87fe284..e37b760 100644 --- a/src/files/url-source.js +++ b/src/files/url-source.js @@ -1,6 +1,4 @@ -'use strict' - -const HTTP = require('../http') +import HTTP from '../http.js' /** * @@ -28,4 +26,4 @@ async function * readURLContent (url, options) { yield * response.iterator() } -module.exports = urlSource +export default urlSource diff --git a/src/http.js b/src/http.js index 59bc296..f4a6390 100644 --- a/src/http.js +++ b/src/http.js @@ -1,14 +1,21 @@ +/** + * DO NOT EDIT THIS FILE DIRECTLY. + * This file is generated following the conversion of + * + * @see [./src/http.js]{@link ./src/http.js} + * + **/ +import { fetch, Request, Headers } from './http/fetch.js' +import { TimeoutError, HTTPError } from './http/error.js' +import _toesmTemp1 from 'merge-options' +import { URL, URLSearchParams } from 'iso-url' +import anySignal from 'any-signal' +import browserReableStreamToIt from 'browser-readablestream-to-it' +import { isBrowser, isWebWorker } from './env.js' +import all from 'it-all' /* eslint-disable no-undef */ -'use strict' -const { fetch, Request, Headers } = require('./http/fetch') -const { TimeoutError, HTTPError } = require('./http/error') -const merge = require('merge-options').bind({ ignoreUndefined: true }) -const { URL, URLSearchParams } = require('iso-url') -const anySignal = require('any-signal') -const browserReableStreamToIt = require('browser-readablestream-to-it') -const { isBrowser, isWebWorker } = require('./env') -const all = require('it-all') +const merge = _toesmTemp1.bind({ ignoreUndefined: true }) /** * @typedef {import('stream').Readable} NodeReadableStream @@ -94,7 +101,7 @@ class HTTP { async fetch (resource, options = {}) { /** @type {HTTPOptions} */ const opts = merge(this.opts, options) - // @ts-expect-error + // @ts-ignore const headers = new Headers(opts.headers) // validate resource type @@ -372,4 +379,4 @@ HTTP.delete = (resource, options) => new HTTP(options).delete(resource, options) */ HTTP.options = (resource, options) => new HTTP(options).options(resource, options) -module.exports = HTTP +export default HTTP diff --git a/src/http/error.js b/src/http/error.js index d839809..6e3ab67 100644 --- a/src/http/error.js +++ b/src/http/error.js @@ -1,22 +1,18 @@ -'use strict' - -class TimeoutError extends Error { +export class TimeoutError extends Error { constructor (message = 'Request timed out') { super(message) this.name = 'TimeoutError' } } -exports.TimeoutError = TimeoutError -class AbortError extends Error { +export class AbortError extends Error { constructor (message = 'The operation was aborted.') { super(message) this.name = 'AbortError' } } -exports.AbortError = AbortError -class HTTPError extends Error { +export class HTTPError extends Error { /** * @param {Response} response */ @@ -26,4 +22,3 @@ class HTTPError extends Error { this.response = response } } -exports.HTTPError = HTTPError diff --git a/src/http/fetch.browser.js b/src/http/fetch.browser.js index 61b78cc..5592588 100644 --- a/src/http/fetch.browser.js +++ b/src/http/fetch.browser.js @@ -1,8 +1,5 @@ -'use strict' - -const { TimeoutError, AbortError } = require('./error') -// @ts-expect-error -const { Response, Request, Headers, default: fetch } = require('../fetch') +import { TimeoutError, AbortError } from './error.js' +import fetch, { Response, Request, Headers } from '../fetch.js' /** * @typedef {import('../types').FetchOptions} FetchOptions @@ -102,9 +99,8 @@ const fetchWithStreaming = fetch * @param {FetchOptions} options */ const fetchWith = (url, options = {}) => - (options.onUploadProgress != null) - ? fetchWithProgress(url, options) - : fetchWithStreaming(url, options) +// @ts-ignore native-fetch uses different types for Request and RequestInit + options.onUploadProgress != null ? fetchWithProgress(url, options) : fetchWithStreaming(url, options) /** * Parse Headers from a XMLHttpRequest @@ -136,8 +132,8 @@ class ResponseWithURL extends Response { } } -module.exports = { - fetch: fetchWith, +export { + fetchWith as fetch, Request, Headers } diff --git a/src/http/fetch.js b/src/http/fetch.js index 1a27129..0f85153 100644 --- a/src/http/fetch.js +++ b/src/http/fetch.js @@ -1,5 +1,3 @@ -'use strict' - /** * @typedef {object} fetchImpl * @property {globalThis.fetch} fetchImpl.fetch @@ -8,15 +6,20 @@ * @property {globalThis.Headers} fetchImpl.Headers */ -let implName = './fetch.node' +let implName = './fetch.node.js' if (typeof XMLHttpRequest === 'function') { // Electron has `XMLHttpRequest` and should get the browser implementation // instead of node. - implName = './fetch.browser' + implName = './fetch.browser.js' } /** @type {fetchImpl} */ -const fetch = require(implName) +const fetchImpl = await import(implName).then(m => m.default) + +export const fetch = fetchImpl.fetch +export const Request = fetchImpl.Request +export const Response = fetchImpl.Response +export const Headers = fetchImpl.Headers -module.exports = fetch +export default fetch diff --git a/src/http/fetch.node.js b/src/http/fetch.node.js index ef5fcb3..4d0a8d2 100644 --- a/src/http/fetch.node.js +++ b/src/http/fetch.node.js @@ -1,9 +1,15 @@ -'use strict' -// @ts-expect-error Request, Response and Headers are global types but concrete in implementations -const { Request, Response, Headers, default: defaultFetch, fetch: fetchFetch } = require('../fetch') +/** + * DO NOT EDIT THIS FILE DIRECTLY. + * This file is generated following the conversion of + * + * @see [./src/http/fetch.node.js]{@link ./src/http/fetch.node.js} + * + **/ +// @ts-ignore +import toStream from 'it-to-stream' +import { Buffer } from 'buffer' +import defaultFetch, { Request, Response, Headers, fetch as fetchFetch } from '../fetch.js' // @ts-ignore -const toStream = require('it-to-stream') -const { Buffer } = require('buffer') /** * @typedef {import('stream').Readable} NodeReadableStream * @@ -37,9 +43,7 @@ const withUploadProgress = (options) => { // and `ArrayBuffer`s to strings. const content = normalizeBody(body) - // @ts-expect-error this is node-fetch const rsp = new Response(content) - // @ts-expect-error this is node-fetch const source = iterateBodyWithProgress(/** @type {NodeReadableStream} */(rsp.body), onUploadProgress) return { ...options, @@ -93,7 +97,7 @@ const iterateBodyWithProgress = async function * (body, onUploadProgress) { } } -module.exports = { +export default { fetch, Request, Headers diff --git a/src/http/fetch.rn.js b/src/http/fetch.rn.js index da7735c..9eb49b0 100644 --- a/src/http/fetch.rn.js +++ b/src/http/fetch.rn.js @@ -1,8 +1,7 @@ // @ts-nocheck -'use strict' -const { TimeoutError, AbortError } = require('./error') -const { Response, Request, Headers, default: fetch } = require('../fetch') +import { TimeoutError, AbortError } from './error.js' +import fetch, { Response, Request, Headers } from '../fetch.js' /** * @typedef {import('../types').FetchOptions} FetchOptions diff --git a/src/index.js b/src/index.js index b4d1ea2..5d270d0 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,2 @@ -'use strict' // just a empty entry point to avoid errors from aegir -module.exports = {} +export default {} diff --git a/src/path-join.browser.js b/src/path-join.browser.js index a274ca4..3784d5d 100644 --- a/src/path-join.browser.js +++ b/src/path-join.browser.js @@ -1,14 +1,11 @@ -'use strict' /** * @param {string[]} args */ -function join (...args) { +export default function join (...args) { if (args.length === 0) { return '.' } return args.join('/') } - -module.exports = join diff --git a/src/path-join.js b/src/path-join.js index aa8409e..a10f3f3 100644 --- a/src/path-join.js +++ b/src/path-join.js @@ -1,3 +1 @@ -'use strict' -const { join } = require('path') -module.exports = join +export { join } from 'path' diff --git a/src/supports.js b/src/supports.js index cadc86f..04d4861 100644 --- a/src/supports.js +++ b/src/supports.js @@ -1,9 +1,11 @@ -'use strict' +// in React Native: global === window === self +export const supportsFileReader = typeof self !== 'undefined' && 'FileReader' in self -module.exports = { - // in React Native: global === window === self - supportsFileReader: typeof self !== 'undefined' && 'FileReader' in self, - supportsWebRTC: 'RTCPeerConnection' in globalThis && - (typeof navigator !== 'undefined' && typeof navigator.mediaDevices !== 'undefined' && 'getUserMedia' in navigator.mediaDevices), - supportsWebRTCDataChannels: 'RTCPeerConnection' in globalThis +export const supportsWebRTC = 'RTCPeerConnection' in globalThis && +(typeof navigator !== 'undefined' && typeof navigator.mediaDevices !== 'undefined' && 'getUserMedia' in navigator.mediaDevices) + +export const supportsWebRTCDataChannels = 'RTCPeerConnection' in globalThis + +export default { + supportsFileReader, supportsWebRTC, supportsWebRTCDataChannels } diff --git a/src/temp-dir.browser.js b/src/temp-dir.browser.js index b10a5ae..262ec2d 100644 --- a/src/temp-dir.browser.js +++ b/src/temp-dir.browser.js @@ -1,6 +1,11 @@ -'use strict' - -const { nanoid } = require('nanoid') +/** + * DO NOT EDIT THIS FILE DIRECTLY. + * This file is generated following the conversion of + * + * @see [./src/temp-dir.browser.js]{@link ./src/temp-dir.browser.js} + * + **/ +import { nanoid } from 'nanoid' /** * Temporary folder @@ -12,4 +17,4 @@ const tempdir = (transform = d => d) => { return transform(nanoid()) } -module.exports = tempdir +export default tempdir diff --git a/src/temp-dir.js b/src/temp-dir.js index 86f35af..4962bd0 100644 --- a/src/temp-dir.js +++ b/src/temp-dir.js @@ -1,9 +1,14 @@ -'use strict' - -const fs = require('fs') -const os = require('os') -const path = require('path') -const { nanoid } = require('nanoid') +/** + * DO NOT EDIT THIS FILE DIRECTLY. + * This file is generated following the conversion of + * + * @see [./src/temp-dir.js]{@link ./src/temp-dir.js} + * + **/ +import fs from 'fs' +import os from 'os' +import path from 'path' +import { nanoid } from 'nanoid' /** * Temporary folder @@ -16,4 +21,4 @@ const tempdir = (transform = d => d) => { return path.join(osTmpDir, transform(nanoid())) } -module.exports = tempdir +export default tempdir diff --git a/test/env.spec.js b/test/env.spec.js index 13d5352..528fbb3 100644 --- a/test/env.spec.js +++ b/test/env.spec.js @@ -1,8 +1,7 @@ -'use strict' /* eslint-env mocha */ -const { expect } = require('aegir/utils/chai') -const env = require('../src/env') +import { expect } from 'aegir/chai' +import * as env from '../src/env.js' describe('env', function () { it('isElectron should have the correct value in each env', function () { diff --git a/test/files/glob-source.spec.js b/test/files/glob-source.spec.js index fea6867..50a99d2 100644 --- a/test/files/glob-source.spec.js +++ b/test/files/glob-source.spec.js @@ -1,14 +1,14 @@ -'use strict' /* eslint-env mocha */ -const { expect } = require('aegir/utils/chai') -const globSource = require('../../src/files/glob-source') -const all = require('it-all') -const path = require('path') -const { - isNode -} = require('../../src/env') -const fs = require('fs') +import { expect } from 'aegir/chai' +import globSource from '../../src/files/glob-source.js' +import all from 'it-all' +import path from 'path' +import { isNode } from '../../src/env.js' +import fs from 'fs' +import { fileURLToPath } from 'url' + +const __dirname = path.dirname(fileURLToPath(import.meta.url)) function fixtureDir () { return path.resolve(path.join(__dirname, '..', 'fixtures')) diff --git a/test/files/url-source.spec.js b/test/files/url-source.spec.js index 79a3635..89db22c 100644 --- a/test/files/url-source.spec.js +++ b/test/files/url-source.spec.js @@ -1,12 +1,16 @@ -'use strict' - +/** + * DO NOT EDIT THIS FILE DIRECTLY. + * This file is generated following the conversion of + * + * @see [./test/files/url-source.spec.js]{@link ./test/files/url-source.spec.js} + * + **/ +import { expect } from 'aegir/chai' +import all from 'it-all' +import urlSource from '../../src/files/url-source.js' +import { Buffer } from 'buffer' /* eslint-env mocha */ -const { expect } = require('aegir/utils/chai') -const all = require('it-all') -const urlSource = require('../../src/files/url-source') -const { Buffer } = require('buffer') - describe('url-source', function () { it('can get url content', async function () { const content = 'foo' diff --git a/test/http.spec.js b/test/http.spec.js index 9978ea6..38f2781 100644 --- a/test/http.spec.js +++ b/test/http.spec.js @@ -1,20 +1,25 @@ -'use strict' - +/** + * DO NOT EDIT THIS FILE DIRECTLY. + * This file is generated following the conversion of + * + * @see [./test/http.spec.js]{@link ./test/http.spec.js} + * + **/ /* eslint-env mocha */ -const { expect } = require('aegir/utils/chai') -const HTTP = require('../src/http') +import { expect } from 'aegir/chai' +import HTTP from '../src/http.js' // @ts-ignore -const toStream = require('it-to-stream') -const delay = require('delay') -const drain = require('it-drain') -const all = require('it-all') -const { isBrowser, isWebWorker, isReactNative } = require('../src/env') -const { Buffer } = require('buffer') -const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string') -const { toString: uint8ArrayToString } = require('uint8arrays/to-string') -const { equals: uint8ArrayEquals } = require('uint8arrays/equals') -const { concat: uint8ArrayConcat } = require('uint8arrays/concat') -const toBuffer = require('it-to-buffer') +import toStream from 'it-to-stream' +import delay from 'delay' +import drain from 'it-drain' +import all from 'it-all' +import { isBrowser, isWebWorker, isReactNative } from '../src/env.js' +import { Buffer } from 'buffer' +import toBuffer from 'it-to-buffer' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { equals as uint8ArrayEquals } from 'uint8arrays/equals' +import { concat as uint8ArrayConcat } from 'uint8arrays/concat' const ECHO_SERVER = process.env.ECHO_SERVER || '' diff --git a/test/supports.spec.js b/test/supports.spec.js index b0070a8..43512a0 100644 --- a/test/supports.spec.js +++ b/test/supports.spec.js @@ -1,9 +1,8 @@ -'use strict' /* eslint-env mocha */ -const { expect } = require('aegir/utils/chai') -const supports = require('../src/supports') -const env = require('../src/env') +import supports from '../src/supports.js' +import { expect } from 'aegir/chai' +import env from '../src/env.js' describe('supports', function () { it('supportsFileReader should return false in node', function () { diff --git a/tsconfig.json b/tsconfig.json index 5ffe9eb..2666cbd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,9 @@ "extends": "aegir/src/config/tsconfig.aegir.json", "compilerOptions": { "outDir": "dist", - "emitDeclarationOnly": true + "emitDeclarationOnly": true, + "module": "ES2022", + "target":"ES2020" }, "include": [ "test",