functional-google-cloud
Version:
Google Cloud Utilities functions in Functional Programming Style
22 lines • 913 B
JavaScript
import * as Stub from './Stubs';
import * as fc from 'fast-check';
const nonEmptyString = () => fc.hexaString(2, 16);
const fileType = () => fc.constantFrom('pdf', 'excel', 'json');
export const config = () => fc.record({
file_type: fileType(),
expires_in: fc.nat(),
});
export const error = () => nonEmptyString().map((message) => new Error(message));
export const path = () => fc.record({
bucket: nonEmptyString(),
filename: nonEmptyString(),
});
export const buffer = () => fc.asciiString(8, 1024).map((content) => Buffer.from(content, 'ascii'));
export const returnValues = () => fc.record({
url: fc.webUrl(),
buffer: buffer(),
});
export const file = () => returnValues().map(Stub.file);
export const bucket = () => returnValues().map(Stub.bucket);
export const storage = (arb) => (arb || returnValues()).map(Stub.storage);
//# sourceMappingURL=Arbitraries.js.map