Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ca5e committed Mar 31, 2024
1 parent 6eba001 commit c468642
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion mrg-import/src/Interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ export async function initialize({ scopedir, prune }: { scopedir: string; prune:
mrg.terminology.scopedir = scope.scopedir
mrg.terminology.scopetag = scope.scopetag
for (const entry of mrg.entries) {
entry.scopetag = scope.scopetag
// // for every property in the entry
// for (const [property, value] of Object.entries(entry)) {
// // if the property is a string
// if (typeof value === "string") {
// const matches: RegExpMatchArray[] = Array.from(value.matchAll(mrg.terminology.interpreter))
// }
// }
}

// write the contents to {my-scopedir}/{my-glossarydir}/mrg.{import-scopetag}.{import-vsntag}.yaml
Expand Down
2 changes: 1 addition & 1 deletion utils/src/classes/Interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface Reference {
/**
* The Interpreter class handles the interpretation of a reference.
* This interpretation happens according to a string that is supplied in `regex`.
* An reference is interpreted by calling the `interpret` method with the corresponding match.
* A reference is interpreted by calling the `interpret` method with the corresponding match.
* The `interpret` method returns a Reference object.
*/
export abstract class Interpreter {
Expand Down
1 change: 1 addition & 0 deletions utils/src/classes/MRG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface Terminology {
curatedir: string
vsntag: string
altvsntags: string[]
interpreter: RegExp
[key: string]: unknown
}

Expand Down
1 change: 1 addition & 0 deletions utils/src/classes/SAF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface Scope {
statuses?: string[]
macros?: Record<string, string[]>
localscopedir: string
interpreter?: RegExp | string
}

export interface Scopes {
Expand Down

0 comments on commit c468642

Please sign in to comment.