mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
f42336cf83
This PR moves the puppeteer source code into separate mono-repo packages: - `puppeteer` and `puppeteer-core` are now separated into their own packages. - `puppeteer-core` has a new exports called `puppeteer-core/internal` for internal usage. Tests and various tools have been updated to accommodate the migration.
28 lines
503 B
TypeScript
28 lines
503 B
TypeScript
/**
|
|
* @internal
|
|
*/
|
|
|
|
export interface ErrorLike extends Error {
|
|
name: string;
|
|
message: string;
|
|
}
|
|
/**
|
|
* @internal
|
|
*/
|
|
|
|
export function isErrorLike(obj: unknown): obj is ErrorLike {
|
|
return (
|
|
typeof obj === 'object' && obj !== null && 'name' in obj && 'message' in obj
|
|
);
|
|
}
|
|
/**
|
|
* @internal
|
|
*/
|
|
|
|
export function isErrnoException(obj: unknown): obj is NodeJS.ErrnoException {
|
|
return (
|
|
isErrorLike(obj) &&
|
|
('errno' in obj || 'code' in obj || 'path' in obj || 'syscall' in obj)
|
|
);
|
|
}
|