Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[archiver_v2.x.x] Convert ESM to CommonJS #3292

Merged
merged 1 commit into from May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions definitions/npm/archiver_v2.x.x/flow_v0.54.x-/archiver_v2.x.x.js
@@ -1,23 +1,23 @@
declare module "archiver" {
import type { Stats } from "fs";

declare type Format = "zip" | "tar";
declare export type Format = "zip" | "tar";

declare type EntryData = {
declare export type EntryData = {
name?: string,
prefix?: string,
stats?: Stats,
date?: Date | string,
mode?: number
};

declare type EntryDataFunction = (entry: EntryData) => false | EntryData;
declare export type EntryDataFunction = (entry: EntryData) => false | EntryData;

declare type CoreOptions = {|
declare export type CoreOptions = {|
statConcurrency?: number
|};

declare type TransformOptions = {|
declare export type TransformOptions = {|
allowHalfOpen?: boolean,
readableObjectMode?: boolean,
writeableObjectMode?: boolean,
Expand All @@ -27,20 +27,20 @@ declare module "archiver" {
objectmode?: boolean
|};

declare type ZipOptions = {|
declare export type ZipOptions = {|
comment?: string,
forceLocalTime?: boolean,
forceZip64?: boolean,
store?: boolean,
zlib?: zlib$options
|};

declare type TarOptions = {|
declare export type TarOptions = {|
gzip?: boolean,
gzipOptions?: zlib$options
|};

declare type GlobOptions = {|
declare export type GlobOptions = {|
cwd?: string,
root?: string,
dot?: boolean,
Expand Down Expand Up @@ -71,7 +71,7 @@ declare module "archiver" {
absolute?: boolean
|};

declare type ArchiverOptions = {|
declare export type ArchiverOptions = {|
...CoreOptions,
...TransformOptions,
...ZipOptions,
Expand All @@ -90,17 +90,17 @@ declare module "archiver" {
glob(pattern: string, options?: GlobOptions, data?: EntryData): this;
finalize(): Promise<void>;
setFormat(format: string): this;
setModule(module: Function): this;
setModule(module: (...a: any) => mixed): this;
pointer(): number;
use(plugin: Function): this;
use(plugin: (...a: any) => mixed): this;
symlink(filepath: string, target: string): this;
}

declare type Vending = {
declare export type Vending = {
(format: Format, options?: ArchiverOptions): Archiver,
create(format: string, options?: ArchiverOptions): Archiver,
registerFormat(format: string, module: Function): void
registerFormat(format: string, module: (...a: any) => mixed): void
};

declare export default Vending;
declare module.exports: Vending;
}
@@ -1,4 +1,4 @@
import Archiver from "archiver";
const Archiver = require("archiver");

// $ExpectError (must pass in a format)
Archiver();
Expand Down