forked from shioju/crawlee-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validators.js
26 lines (26 loc) · 1.32 KB
/
validators.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validators = void 0;
const tslib_1 = require("tslib");
const ow_1 = tslib_1.__importDefault(require("ow"));
/** @internal */
exports.validators = {
// Naming it browser page for future proofing with Playwright
browserPage: (value) => ({
validator: ow_1.default.isValid(value, ow_1.default.object.hasKeys('goto', 'evaluate', '$', 'on')),
message: (label) => `Expected argument '${label}' to be a Puppeteer Page, got something else.`,
}),
proxyConfiguration: (value) => ({
validator: ow_1.default.isValid(value, ow_1.default.object.hasKeys('newUrl', 'newProxyInfo')),
message: (label) => `Expected argument '${label}' to be a ProxyConfiguration, got something else.`,
}),
requestList: (value) => ({
validator: ow_1.default.isValid(value, ow_1.default.object.hasKeys('fetchNextRequest', 'persistState')),
message: (label) => `Expected argument '${label}' to be a RequestList, got something else.`,
}),
requestQueue: (value) => ({
validator: ow_1.default.isValid(value, ow_1.default.object.hasKeys('fetchNextRequest', 'addRequest')),
message: (label) => `Expected argument '${label}' to be a RequestQueue, got something else.`,
}),
};
//# sourceMappingURL=validators.js.map