Skip to content

Commit

Permalink
Add URL imports for Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
yumauri committed Nov 30, 2021
1 parent 97d6934 commit 9a5a0f3
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
"path": "pkg/dist-node/index.js",
"webpack": false,
"limit": "4216 B"
"limit": "4229 B"
}
],
"@pika/pack": {
Expand Down
1 change: 1 addition & 0 deletions src/_types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL } from 'url' // tslint:disable-line no-circular-imports
import FormData from 'form-data'

////////////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/client/node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import http from 'http'
import https from 'https'
import FormData from 'form-data'
import { URL } from 'url'
import { GotenbergClientFunction } from '../_types'

/**
Expand Down
1 change: 1 addition & 0 deletions src/gotenberg.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL } from 'url' // tslint:disable-line no-circular-imports
import { client as native } from './client/node'
import {
GotenbergClient,
Expand Down
1 change: 1 addition & 0 deletions src/internal/source-checkers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL } from 'url' // tslint:disable-line no-circular-imports
import { Readable } from 'stream'
import { FileURI, ObjectSource, PlainSource, Source, TupleSource } from '../_types'

Expand Down
2 changes: 1 addition & 1 deletion src/url.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request, RequestType, UrlRequest } from './_types'
import { isString, isURL } from './internal/source-checkers'
import { isString, isURL } from './internal/source-checkers' // tslint:disable-line no-circular-imports
import { pipe } from './tools/pipe'
import { fields } from './internal/fields'
import { path } from './internal/path'
Expand Down
1 change: 1 addition & 0 deletions test/internal/source-checkers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL } from 'url'
import { Readable } from 'stream'
import {
isBuffer,
Expand Down
1 change: 1 addition & 0 deletions test/internal/source-converters.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL } from 'url'
import { Readable } from 'stream'
import { basename } from 'path'
import { createReadStream, ReadStream } from 'fs'
Expand Down
1 change: 1 addition & 0 deletions test/merge.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL } from 'url'
import { merge, Request, RequestType } from '../src'

// dumb object to test purity
Expand Down
1 change: 1 addition & 0 deletions test/url.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { URL } from 'url'
import { Request, RequestType, url } from '../src'

// dumb object to test purity
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "es2020",
"module": "esnext",
// "lib": [], // there is problem with URL, when empty :( https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34960
"lib": [], // there is problem with URL, when empty :( https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34960
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
Expand Down

0 comments on commit 9a5a0f3

Please sign in to comment.