Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { ErrorResponse, OAuthOptions, Response, StatusesHomeTimelineQueryT } from './types';
export const createErrorResponse = (errorResponse: ErrorResponse): Response =>
either.left(errorResponse);
export const typecheck = <a>(a: A) => a;
// Defaults
export const defaultOAuthOptions: Pick<
OAuthOptions,
'callback' | 'verifier' | 'token' | 'tokenSecret'
> = {
callback: option.none,
verifier: option.none,
token: option.none,
tokenSecret: option.none,
};
export const defaultStatusesHomeTimelineQuery: Pick<
StatusesHomeTimelineQueryT,
'count' | 'max_id'
> = {
count: option.none,
max_id: option.none,
};
</a>
export function runFromQueue(
op: Ops,
callback: (r: E.Either>) => void
): () => void {
switch (op._tag) {
case "error":
callback(E.left(op.e));
// this will never be called
/* istanbul ignore next */
// tslint:disable-next-line: no-empty
return () => {};
case "complete":
callback(E.right(O.none));
// tslint:disable-next-line: no-empty
return () => {};
case "offer":
callback(E.right(O.some(op.a)));
// tslint:disable-next-line: no-empty
return () => {};
}
}
const BookmarkForm: FC = (props) => {
const firstInputRef = useRef(null);
const [bookmarkInput, setBookmarkInput] = useState({
id: O.none,
title: '',
desc: '',
url: '',
tags: [],
});
const setInputBookmarkPartial = (partialBookmark: Partial): void => {
setBookmarkInput({ ...bookmarkInput, ...partialBookmark });
};
const [tagInput, setTagInput] = useState('');
useEffect(() => {
// Copy bookmark props into state
if (O.isSome(props.bookmark)) {
// Ensure not to copy unwanted properties into state
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const createErrorResponse = (errorResponse: ErrorResponse): Response =>
either.left(errorResponse);
export const typecheck = <a>(a: A) => a;
// Defaults
export const defaultOAuthOptions: Pick<
OAuthOptions,
'callback' | 'verifier' | 'token' | 'tokenSecret'
> = {
callback: option.none,
verifier: option.none,
token: option.none,
tokenSecret: option.none,
};
export const defaultStatusesHomeTimelineQuery: Pick<
StatusesHomeTimelineQueryT,
'count' | 'max_id'
> = {
count: option.none,
max_id: option.none,
};
</a>
// tslint:disable-next-line no-duplicate-imports
import { ErrorResponse, OAuthOptions, Response, StatusesHomeTimelineQueryT } from './types';
export const createErrorResponse = (errorResponse: ErrorResponse): Response =>
either.left(errorResponse);
export const typecheck = <a>(a: A) => a;
// Defaults
export const defaultOAuthOptions: Pick<
OAuthOptions,
'callback' | 'verifier' | 'token' | 'tokenSecret'
> = {
callback: option.none,
verifier: option.none,
token: option.none,
tokenSecret: option.none,
};
export const defaultStatusesHomeTimelineQuery: Pick<
StatusesHomeTimelineQueryT,
'count' | 'max_id'
> = {
count: option.none,
max_id: option.none,
};
</a>
it('validates positively against schema', () => {
assertRight(
httpQueryValidator.validate({ param: 'abc' }, [
{
name: 'param',
style: HttpParamStyles.Form,
schema: { type: 'string' },
},
])
);
expect(validateAgainstSchemaModule.validateAgainstSchema).toReturnWith(O.none);
});
});
const lastIndexOf = (big: string, small: string) => {
const i = big.lastIndexOf(small)
return i !== -1 ? O.some(i) : O.none
}
const getDomainParameterName = (type: M.Type): O.Option => {
switch (type.kind) {
case 'Ref':
return O.some(getFirstLetterLowerCase(type.name))
case 'Tuple':
return O.some('tuple')
case 'Fun':
return O.some('f')
case 'Unit':
return O.none
}
}
var lastIndexOf = function (big, small) {
var i = big.lastIndexOf(small);
return i !== -1 ? Option_1.some(i) : Option_1.none;
};
function getFunctionVariableDeclarationSignature(vd) {
get: (): Promise => Promise.resolve({ theme: O.some(activeTheme), badgeDisplay: O.none }),
},