Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function handler(event, context, callback) {
const text = event.queryStringParameters.q;
const urls = getUrl(text);
// Return if there is no urls in text
if (!urls.size) {
return callback(null, {
statusCode: 200,
body: JSON.stringify({
text: text,
meta: null,
error: ["Empty url in text"]
})
});
}
// Retrieve first URL in text - urls are already normalized
const url = [...urls][0];
const options = { url };
export function getLinksFromJob(job: JobType) {
// Clean up returns, newlines, tabs, and misc symbols...
// ...and search for application links in the text
return [
...getUrls(job.description),
...getUrls(job.comments),
...getUrls(job.skills),
]
}
export function getLinksFromJob(job: JobType) {
// Clean up returns, newlines, tabs, and misc symbols...
// ...and search for application links in the text
return [
...getUrls(job.description),
...getUrls(job.comments),
...getUrls(job.skills),
]
}
export function getLinksFromJob(job: JobType) {
// Clean up returns, newlines, tabs, and misc symbols...
// ...and search for application links in the text
return [
...getUrls(job.description),
...getUrls(job.comments),
...getUrls(job.skills),
]
}
export function process() {
getUrls(text);
}
const getEmbeds = (text: string): Embed[] => {
const embeds = [];
for (const urlString of getUrls(text)) {
const url = new URL(urlString);
const parser = embedHosts.get(url.hostname);
const embed = (parser && parser(url)) || imageEmbedParser(url);
if (embed) {
embeds.push(embed);
}
}
return embeds;
};
return this.props.tasks.map((task, index) => {
const dateStr = moment(task.due).format('Do MMM');
const className =
task.dirty && task.error === undefined
? 'flex task task-dirty'
: 'flex task';
let links = [];
const linkset = getUrls(task.notes);
linkset.forEach(link => {
if (links.length > 2) return;
const linkitem = (
<span data-tip="{link}">
this.onLinkClicked(link)}
/>
</span>
);
links.push(linkitem);
});
let actionsForTaskUnderMouse = null;
if (this.state.taskUnderMouse === task.id && !task.dirty) {
actionsForTaskUnderMouse = (