Skip to content

Commit ae9af82

Browse files
committedJul 18, 2020
Meta tweaks
1 parent f7fc51f commit ae9af82

File tree

5 files changed

+27
-20
lines changed

5 files changed

+27
-20
lines changed
 

‎.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: node_js
22
node_js:
3+
- '14'
34
- '12'
45
- '10'

‎index.d.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ import {MergeExclusive, TypedArray} from 'type-fest';
33

44
declare namespace tempy {
55
type FileOptions = MergeExclusive<
6-
{
7-
/**
6+
{
7+
/**
88
File extension.
99
1010
Mutually exclusive with the `name` option.
1111
1212
_You usually won't need this option. Specify it only when actually needed._
1313
*/
14-
readonly extension?: string;
15-
},
16-
{
17-
/**
14+
readonly extension?: string;
15+
},
16+
{
17+
/**
1818
Filename.
1919
2020
Mutually exclusive with the `extension` option.
2121
2222
_You usually won't need this option. Specify it only when actually needed._
2323
*/
24-
readonly name?: string;
25-
}
24+
readonly name?: string;
25+
}
2626
>;
2727

2828
type DirectoryOptions = {
@@ -34,7 +34,7 @@ declare namespace tempy {
3434
Useful for testing by making it easier to identify cache directories that are created.
3535
*/
3636
readonly prefix?: string;
37-
}
37+
};
3838
}
3939

4040
declare const tempy: {
@@ -58,7 +58,7 @@ declare const tempy: {
5858
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T/2f3d094aec2cb1b93bb0f4cffce5ebd6'
5959
```
6060
*/
61-
file(options?: tempy.FileOptions): string;
61+
file: (options?: tempy.FileOptions) => string;
6262

6363
/**
6464
Get a temporary directory path. The directory is created for you.
@@ -74,7 +74,7 @@ declare const tempy: {
7474
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T/name_3c085674ad31223b9653c88f725d6b41'
7575
```
7676
*/
77-
directory(options?: tempy.DirectoryOptions): string;
77+
directory: (options?: tempy.DirectoryOptions) => string;
7878

7979
/**
8080
Write data to a random temp file.
@@ -87,7 +87,7 @@ declare const tempy: {
8787
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T/2f3d094aec2cb1b93bb0f4cffce5ebd6'
8888
```
8989
*/
90-
write(fileContent: string | Buffer | TypedArray | DataView | NodeJS.ReadableStream, options?: tempy.FileOptions): Promise<string>;
90+
write: (fileContent: string | Buffer | TypedArray | DataView | NodeJS.ReadableStream, options?: tempy.FileOptions) => Promise<string>;
9191

9292
/**
9393
Synchronously write data to a random temp file.
@@ -100,7 +100,7 @@ declare const tempy: {
100100
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T/2f3d094aec2cb1b93bb0f4cffce5ebd6'
101101
```
102102
*/
103-
writeSync(fileContent: string | Buffer | TypedArray | DataView, options?: tempy.FileOptions): string;
103+
writeSync: (fileContent: string | Buffer | TypedArray | DataView, options?: tempy.FileOptions) => string;
104104

105105
/**
106106
Get the root temporary directory path.

‎index.test-d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {expectType, expectError} from 'tsd';
22
import tempy = require('.');
33

4-
const options: tempy.FileOptions = {};
4+
const options: tempy.FileOptions = {}; // eslint-disable-line @typescript-eslint/no-unused-vars
55
expectType<string>(tempy.directory());
66
expectType<string>(tempy.directory({prefix: 'name_'}));
77
expectType<string>(tempy.file());

‎package.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,17 @@
3737
"dependencies": {
3838
"is-stream": "^2.0.0",
3939
"temp-dir": "^2.0.0",
40-
"type-fest": "^0.12.0",
40+
"type-fest": "^0.16.0",
4141
"unique-string": "^2.0.0"
4242
},
4343
"devDependencies": {
44-
"ava": "^1.4.1",
45-
"tsd": "^0.11.0",
46-
"xo": "^0.25.4"
44+
"ava": "^2.4.0",
45+
"tsd": "^0.13.1",
46+
"xo": "^0.32.1"
47+
},
48+
"xo": {
49+
"rules": {
50+
"node/no-unsupported-features/node-builtins": "off"
51+
}
4752
}
4853
}

‎readme.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# tempy [![Build Status](https://travis-ci.org/sindresorhus/tempy.svg?branch=master)](https://travis-ci.org/sindresorhus/tempy)
1+
# tempy [![Build Status](https://travis-ci.com/sindresorhus/tempy.svg?branch=master)](https://travis-ci.com/github/sindresorhus/tempy)
22

33
> Get a random temporary file or directory path
44
@@ -63,14 +63,15 @@ Type: `Object`
6363

6464
##### prefix
6565

66-
_You usually won't need this option. Specify it only when actually needed._
6766

6867
Type: `string`
6968

7069
Directory prefix.
7170

7271
Useful for testing by making it easier to identify cache directories that are created.
7372

73+
*You usually won't need this option. Specify it only when actually needed.*
74+
7475
### tempy.write(fileContent, options?)
7576

7677
Write data to a random temp file.

0 commit comments

Comments
 (0)
Please sign in to comment.