Skip to content

Commit f1113fc

Browse files
committed
Merge branch 'master' into disable-improve-eslint-rules
2 parents 57f62c7 + 2671813 commit f1113fc

154 files changed

Lines changed: 1739 additions & 1425 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@
668668
/types/bristol/ @eheikes @ElliottCampbellJHA
669669
/types/bristol-sentry/ @ElliottCampbellJHA
670670
/types/bro-fs/ @ffflorian
671+
/types/broccoli-merge-trees/ @KonradPerlicki
671672
/types/broken-link-checker/ @Haizzz
672673
/types/brorand/ @chrootsu
673674
/types/brotli/ @arturovt
@@ -1701,6 +1702,7 @@
17011702
/types/easy-speech/ @RJWadley
17021703
/types/easy-xapi/ @DeadAlready
17031704
/types/easy-xapi-utils/ @DeadAlready
1705+
/types/easycaptchajs/ @HichemTab-tech
17041706
/types/easydate/ @satyarohith
17051707
/types/ebay-oauth-nodejs-client/ @JeremyMoeglich
17061708
/types/ebml/ @AppLover69
@@ -4014,7 +4016,7 @@
40144016
/types/jwa/ @dhritzkiv
40154017
/types/jweixin/ @taoqf @gomydodo
40164018
/types/jwk-to-pem/ @esilkensen
4017-
/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bebebebebe @djcsdy @drewwyatt @zetagame @esetnik
4019+
/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bebebebebe @djcsdy @drewwyatt @zetagame @esetnik @nlhiorth
40184020
/types/jws/ @JustinBeckwith @dolsem
40194021
/types/jwt-client/ @timoteoponce
40204022
/types/jwt-encode/ @turisap
@@ -4914,7 +4916,7 @@
49144916
/types/merge2/ @tkrotoff @smac89 @winston01
49154917
/types/mergerino/ @fivitti
49164918
/types/merkle/ @kerol2r20
4917-
/types/mersenne-twister/ @KentarouTakeda
4919+
/types/mersenne-twister/ @KentarouTakeda @Shinigami92
49184920
/types/mersennetwister/ @krofdrakula
49194921
/types/mertasan__tailwindcss-variables/ @LiamMartens
49204922
/types/meshblu/ @fnipo
@@ -7852,7 +7854,7 @@
78527854
/types/stubby/ @dex4er
78537855
/types/style-inject/ @leonzalion
78547856
/types/style-search/ @peterblazejewicz
7855-
/types/styled-components/ @Igorbek @Igmat @Jessidhia @jkillian @eps1lon @wagerfield @Lazyuki @lifeiscontent
7857+
/types/styled-components/ @Igorbek @Igmat @Jessidhia @jkillian @eps1lon @wagerfield @Lazyuki @lifeiscontent @acdr
78567858
/types/styled-components/v3/ @Igorbek @Igmat
78577859
/types/styled-components-react-native/ @Methuselah96
78587860
/types/styled-react-modal/ @gperl27

types/adm-zip/adm-zip-tests.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ import util = require('adm-zip/util');
33
const { Constants } = util;
44

55
// reading archives
6+
// reading archive causes error
7+
try {
8+
const zip = new AdmZip('./my_file.zip');
9+
} catch (e: unknown) {
10+
const error = e as Error;
11+
switch (error.message) {
12+
case util.Errors.INVALID_FORMAT:
13+
// handle specific error
14+
throw new Error('Invalid zip format');
15+
default:
16+
// handle other errors
17+
throw error;
18+
}
19+
}
20+
// reading archive successfully
621
const zip = new AdmZip('./my_file.zip');
722
if (!zip.test()) {
823
throw new Error('invalid zip?');
@@ -25,7 +40,12 @@ zip.extractEntryTo(/*entry name*/ 'some_folder/my_file.txt', /*target path*/ '/h
2540
// extracts everything
2641
zip.extractAllTo(/*target path*/ '/home/me/zipcontent/', /*overwrite*/ true);
2742
// extracts everything and calls callback -> async extracction
28-
zip.extractAllToAsync(/*target path*/ '/home/me/zipcontent/', /*overwrite*/ true, /*keepOriginalPermission*/ false, /*callback*/ (error?: Error) => {});
43+
zip.extractAllToAsync(
44+
/*target path*/ '/home/me/zipcontent/',
45+
/*overwrite*/ true,
46+
/*keepOriginalPermission*/ false,
47+
/*callback*/ (error?: Error) => {},
48+
);
2949

3050
// creating archives
3151
new AdmZip();

types/adm-zip/index.d.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ declare class AdmZip {
4747
readAsTextAsync(
4848
fileName: string | AdmZip.IZipEntry,
4949
callback: (data: string, err: string) => void,
50-
encoding?: string
50+
encoding?: string,
5151
): void;
5252
/**
5353
* Remove the entry from the file or the entry and all its nested directories
@@ -115,7 +115,7 @@ declare class AdmZip {
115115
localPath: string,
116116
callback: (success?: boolean, err?: string) => void,
117117
zipPath?: string,
118-
filter?: RegExp | ((filename: string) => boolean)
118+
filter?: RegExp | ((filename: string) => boolean),
119119
): void;
120120
/**
121121
*
@@ -126,7 +126,7 @@ declare class AdmZip {
126126
*/
127127
addLocalFolderPromise(
128128
localPath: string,
129-
props: { zipPath?: string, filter?: RegExp | ((filename: string) => boolean) }
129+
props: { zipPath?: string; filter?: RegExp | ((filename: string) => boolean) },
130130
): Promise<void>;
131131
/**
132132
* Allows you to create a entry (file or directory) in the zip file.
@@ -203,7 +203,7 @@ declare class AdmZip {
203203
targetPath: string,
204204
overwrite?: boolean,
205205
keepOriginalPermission?: boolean,
206-
password?: string | Buffer
206+
password?: string | Buffer,
207207
): void;
208208
/**
209209
* Extracts the entire archive to the given location.
@@ -231,10 +231,7 @@ declare class AdmZip {
231231
* if a zip was opened and no `targetFileName` is provided, it will
232232
* overwrite the opened zip.
233233
*/
234-
writeZipPromise(
235-
targetFileName?: string,
236-
props?: { overwrite?: boolean, perm?: number }
237-
): Promise<boolean>;
234+
writeZipPromise(targetFileName?: string, props?: { overwrite?: boolean; perm?: number }): Promise<boolean>;
238235
/**
239236
* Returns the content of the entire zip file.
240237
*/
@@ -371,7 +368,7 @@ declare namespace AdmZip {
371368
/* Read entries during load (initial loading may be slower) */
372369
readEntries: boolean;
373370
/* Read method */
374-
method: typeof Constants[keyof typeof Constants] | number;
371+
method: (typeof Constants)[keyof typeof Constants] | number;
375372
/* file system */
376373
fs: null | typeof FS;
377374
}

types/adm-zip/util.d.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,39 @@ export const Constants: {
140140
EF_ZIP64_RHO: 16;
141141
EF_ZIP64_DSN: 24;
142142
};
143+
144+
export const Errors: {
145+
/* Header error messages */
146+
INVALID_LOC: 'Invalid LOC header (bad signature)';
147+
INVALID_CEN: 'Invalid CEN header (bad signature)';
148+
INVALID_END: 'Invalid END header (bad signature)';
149+
150+
/* ZipEntry error messages */
151+
NO_DATA: 'Nothing to decompress';
152+
BAD_CRC: 'CRC32 checksum failed';
153+
FILE_IN_THE_WAY: 'There is a file in the way: %s';
154+
UNKNOWN_METHOD: 'Invalid/unsupported compression method';
155+
156+
/* Inflater error messages */
157+
AVAIL_DATA: 'inflate::Available inflate data did not terminate';
158+
INVALID_DISTANCE: 'inflate::Invalid literal/length or distance code in fixed or dynamic block';
159+
TO_MANY_CODES: 'inflate::Dynamic block code description: too many length or distance codes';
160+
INVALID_REPEAT_LEN: 'inflate::Dynamic block code description: repeat more than specified lengths';
161+
INVALID_REPEAT_FIRST: 'inflate::Dynamic block code description: repeat lengths with no first length';
162+
INCOMPLETE_CODES: 'inflate::Dynamic block code description: code lengths codes incomplete';
163+
INVALID_DYN_DISTANCE: 'inflate::Dynamic block code description: invalid distance code lengths';
164+
INVALID_CODES_LEN: 'inflate::Dynamic block code description: invalid literal/length code lengths';
165+
INVALID_STORE_BLOCK: "inflate::Stored block length did not match one's complement";
166+
INVALID_BLOCK_TYPE: 'inflate::Invalid block type (type == 3)';
167+
168+
/* ADM-ZIP error messages */
169+
CANT_EXTRACT_FILE: 'Could not extract the file';
170+
CANT_OVERRIDE: 'Target file already exists';
171+
NO_ZIP: 'No zip file was loaded';
172+
NO_ENTRY: "Entry doesn't exist";
173+
DIRECTORY_CONTENT_ERROR: 'A directory cannot have content';
174+
FILE_NOT_FOUND: 'File not found: %s';
175+
NOT_IMPLEMENTED: 'Not implemented';
176+
INVALID_FILENAME: 'Invalid filename';
177+
INVALID_FORMAT: 'Invalid or unsupported zip format. No END header found';
178+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import broccoliMergeTrees = require('broccoli-merge-trees');
2+
3+
// $ExpectType MergeTrees
4+
broccoliMergeTrees(['public', 'scripts']);
5+
6+
// $ExpectType MergeTrees
7+
broccoliMergeTrees(['public', 'scripts'], { overwrite: true, destDir: 'assets', annotation: 'annotation' });
8+
9+
import { MergeTrees } from 'broccoli-merge-trees';
10+
11+
// $ExpectType MergeTrees
12+
new MergeTrees(['public', 'scripts']);
13+
14+
new MergeTrees(['public', 'scripts'], { overwrite: true, destDir: 'assets', annotation: 'annotation' });
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Type definitions for broccoli-merge-trees 4.2
2+
// Project: https://github.com/broccolijs/broccoli-merge-trees#readme
3+
// Definitions by: Konrad Perlicki <https://github.com/KonradPerlicki>
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
6+
import { InputNode } from 'broccoli-node-api';
7+
import Plugin = require('broccoli-plugin');
8+
9+
export = broccoliMergeTrees;
10+
11+
/**
12+
*
13+
* @param inputNodes An array of nodes, whose contents will be merged
14+
* @param options A hash of options
15+
*/
16+
declare function broccoliMergeTrees(
17+
inputNodes: InputNode[],
18+
options?: broccoliMergeTrees.Options,
19+
): broccoliMergeTrees.MergeTrees;
20+
21+
declare namespace broccoliMergeTrees {
22+
class MergeTrees extends Plugin {
23+
constructor(inputNodes: InputNode[], options?: Options);
24+
25+
build(): void | never;
26+
}
27+
28+
interface Options {
29+
/**
30+
* A descriptive annotation. Useful for debugging, to tell multiple instances of the same plugin apart.
31+
*/
32+
annotation?: string;
33+
34+
/**
35+
* A string representing the destination path that merged files will be copied to.
36+
*/
37+
destDir?: string;
38+
39+
/**
40+
* By default, broccoli-merge-trees throws an error when a file exists in multiple nodes.
41+
* If you pass `{ overwrite: true }`, the output will contain the version of the file
42+
* as it exists in the last input node that contains it.
43+
*/
44+
overwrite?: boolean;
45+
}
46+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"private": true,
3+
"dependencies": {
4+
"broccoli-plugin": "^4.0.7"
5+
}
6+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": [
5+
"es6"
6+
],
7+
"noImplicitAny": true,
8+
"noImplicitThis": true,
9+
"strictFunctionTypes": true,
10+
"strictNullChecks": true,
11+
"baseUrl": "../",
12+
"typeRoots": [
13+
"../"
14+
],
15+
"types": [],
16+
"noEmit": true,
17+
"forceConsistentCasingInFileNames": true
18+
},
19+
"files": [
20+
"index.d.ts",
21+
"broccoli-merge-trees-tests.ts"
22+
]
23+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": "@definitelytyped/dtslint/dt.json" }

types/ffprobe/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ declare namespace getInfo {
301301
time_base: string;
302302
start_pts?: number | undefined;
303303
start_time?: number | undefined;
304-
duration_ts?: string | undefined;
305-
duration?: number | undefined;
304+
duration_ts?: number | undefined;
305+
duration?: string | undefined;
306306
bit_rate?: number | undefined;
307307
max_bit_rate?: number | undefined;
308308
bits_per_raw_sample?: number | undefined;

0 commit comments

Comments
 (0)