Skip to content

Commit 5594a5c

Browse files
committed
minor adjustments
1 parent f333eaf commit 5594a5c

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

apps/roam/src/utils/createReifiedBlock.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { getSetting } from "~/utils/extensionSettings";
55

66
export const DISCOURSE_GRAPH_PROP_NAME = "discourse-graph";
77

8-
const SANE_ROLE_NAME_RE = new RegExp(/^[a-zA-Z][a-zA-Z0-9_-]*$/);
8+
const SANE_ROLE_NAME_RE = new RegExp(/^[\w\-]*$/);
99

1010
const strictQueryForReifiedBlocks = async (
1111
parameterUids: Record<string, string>,
1212
): Promise<string | null> => {
1313
const paramsAsSeq = Object.entries(parameterUids);
14-
// sanitize parameter names
14+
// validate parameter names
1515
if (
1616
Object.keys(parameterUids).filter((k) => !k.match(SANE_ROLE_NAME_RE)).length
1717
)
@@ -81,7 +81,7 @@ const createReifiedBlock = async ({
8181
const RELATION_PAGE_TITLE = "roam/js/discourse-graph/relations";
8282
let relationPageUid: string | undefined = undefined;
8383

84-
export const getOrCreateRelationPageUid = async (): Promise<string> => {
84+
const getOrCreateRelationPageUid = async (): Promise<string> => {
8585
if (relationPageUid === undefined) {
8686
relationPageUid = getPageUidByPageTitle(RELATION_PAGE_TITLE);
8787
if (relationPageUid === "") {

apps/roam/src/utils/registerDiscourseDatalogTranslators.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ const registerDiscourseDatalogTranslators = () => {
423423
});
424424
if (!filteredRelations.length && !ANY_RELATION_REGEX.test(label))
425425
return [];
426-
console.log("source", source, "target", target);
427426
const typeOfValue = (value: string): ValueType => {
428427
const possibleNodeType = nodeTypeByLabel[value?.toLowerCase()];
429428
if (possibleNodeType) {
@@ -575,12 +574,6 @@ const registerDiscourseDatalogTranslators = () => {
575574
const clauses: DatalogClause[] = [...relClauseBasis];
576575

577576
// todo: It could be a title or a node type.
578-
console.log(
579-
"typeOfSource",
580-
typeOfSource,
581-
"typeOfTarget",
582-
typeOfTarget,
583-
);
584577
if (
585578
!(
586579
typeOfSource <= ValueType.nodeType ||
@@ -603,12 +596,6 @@ const registerDiscourseDatalogTranslators = () => {
603596
),
604597
)
605598
.filter((x) => x !== undefined);
606-
console.log(
607-
"sourceTriples",
608-
sourceTriples,
609-
"targetTriples",
610-
targetTriples,
611-
);
612599
if (typeOfSource === ValueType.uid) {
613600
if (sourceTriples.length)
614601
clauses.push(

0 commit comments

Comments
 (0)