Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (d && d.end) { metadata.end = d.end }
const absolutePath = `${orgFileNode.fileAbsolutePath}::*${title}`
return {
metadata,
getAST: () => ast.parent, // we need the secion of the headline
absolutePath,
}
})
} else { // root
const metadata = {
export_file_name: orgFileNode.fileName,
...ast.meta }
metadata.title = metadata.title || 'Untitled'
const absolutePath = `${orgFileNode.fileAbsolutePath}`
const d = parseTimestamp(metadata.date) ||
parseTimestamp(metadata.export_date)
if (d && d.date) { metadata.date = d.date }
content = [ {
metadata,
getAST: () => ast,
absolutePath,
} ]
}
content.forEach((node, index) => {
const id = `${orgFileNode.id} >>> OrgContent[${index}]`
const ast = node.getAST()
const contentDigest =
crypto.createHash(`md5`)
.update(JSON.stringify(ast, getCircularReplacer()))
.digest(`hex`)
const absolutePath = `${orgFileNode.fileAbsolutePath}::*${title}`
return {
metadata,
getAST: () => ast.parent, // we need the secion of the headline
absolutePath,
}
})
} else { // root
const metadata = {
export_file_name: orgFileNode.fileName,
...ast.meta }
metadata.title = metadata.title || 'Untitled'
const absolutePath = `${orgFileNode.fileAbsolutePath}`
const d = parseTimestamp(metadata.date) ||
parseTimestamp(metadata.export_date)
if (d && d.date) { metadata.date = d.date }
content = [ {
metadata,
getAST: () => ast,
absolutePath,
} ]
}
content.forEach((node, index) => {
const id = `${orgFileNode.id} >>> OrgContent[${index}]`
const ast = node.getAST()
const contentDigest =
crypto.createHash(`md5`)
.update(JSON.stringify(ast, getCircularReplacer()))
.digest(`hex`)
const n = {
.map(ast => {
const { date, export_date, export_title, ...properties } = getProperties(ast)
const title = export_title || select(`text`, ast).value
const d = parseTimestamp(date) ||
parseTimestamp(export_date) ||
select(`timestamp`, ast) ||
select(`planning[keyword=CLOSED]`, ast)
const metadata = {
title,
export_file_name: sanitise(title),
category: category || orgFileNode.fileName,
keyword: ast.keyword,
tags: ast.tags,
...properties,
}
if (d && d.date) { metadata.date = d.date }
if (d && d.end) { metadata.end = d.end }
.map(ast => {
const { date, export_date, export_title, ...properties } = getProperties(ast)
const title = export_title || select(`text`, ast).value
const d = parseTimestamp(date) ||
parseTimestamp(export_date) ||
select(`timestamp`, ast) ||
select(`planning[keyword=CLOSED]`, ast)
const metadata = {
title,
export_file_name: sanitise(title),
category: category || orgFileNode.fileName,
keyword: ast.keyword,
tags: ast.tags,
...properties,
}
if (d && d.date) { metadata.date = d.date }
if (d && d.end) { metadata.end = d.end }
const absolutePath = `${orgFileNode.fileAbsolutePath}::*${title}`