Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
[typeEq ('list'), convertList],
[typeEq ('record'), convertRecord],
[typeEq ('constrainedType'), convertConstrainedType],
[typeEq ('typevar'), S.pipe ([convertTypevar, Reader.of])],
[typeEq ('thunk'), S.K (Reader.of (Thunk))],
[S.K (true), e => {
throw new Error
(`Don't know what to do with signature entry ${e.type}`);
}],
]) (entry));
// convertTypes :: Array SignatureEntry -> Reader (TypeMap (Array Type))
const convertTypes = memoize (S.pipe ([
S.map (convertType),
S.unchecked.sequence (Reader),
S.unchecked.map (S.reject (S.equals (Thunk))),
]));
// convertTypeConstructor :: SignatureEntry -> Reader (TypeMap Type)
const convertTypeConstructor = memoize (S.ifElse
(hasChildren)
(y => S.pipe ([
children,
convertTypes,
x => S.unchecked.lift2 (constructType) (x) (lookupType (y)),
]) (y))
(lookupType));
// convertList :: SignatureEntry -> Reader (TypeMap Type)
const convertList = memoize (S.pipe ([
firstChild,
convertType,
this._value(res => {
other._value(S.compose(resolve, S.equals(res)))
})
}
dotenv.config();
const dropboxPaperApi = got.extend({
method: 'POST',
baseUrl: 'https://api.dropbox.com/2/paper/',
json: true,
headers: {
Authorization: `Bearer ${process.env.DROPBOX_API_TOKEN}`,
},
});
const jsonToFrontmatter = json => `---\n${ JSON.stringify(json, null, 2) }\n---\n`;
const isDeletedDoc = pipe([
props(['metaData', 'status', '.tag']),
equals('deleted'),
]);
const {
fetchAllDocIds,
fetchDocFolders,
fetchDocContent,
fetchDocMetaData,
foldersToPath,
} = main(dropboxPaperApi);
const appendDocContent = docs => Promise.all(
docs.map(doc =>
promiseAllProps({
...doc,
content: fetchDocContent(doc.id),
})