Skip to content

Commit 22a74dc

Browse files
authored
Fix circular dependency in imports, Closes #63
1 parent 2f69837 commit 22a74dc

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

lib/ContextParser.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {ERROR_CODES, ErrorCoded} from "./ErrorCoded";
44
import {FetchDocumentLoader} from "./FetchDocumentLoader";
55
import {IDocumentLoader} from "./IDocumentLoader";
66
import {IJsonLdContext, IJsonLdContextNormalizedRaw, IPrefixValue, JsonLdContext} from "./JsonLdContext";
7-
import {JsonLdContextNormalized} from "./JsonLdContextNormalized";
7+
import {JsonLdContextNormalized, defaultExpandOptions, IExpandOptions} from "./JsonLdContextNormalized";
88
import {Util} from "./Util";
99

1010
// tslint:disable-next-line:no-var-requires
@@ -981,24 +981,3 @@ export interface IParseOptions {
981981
ignoreScopedContexts?: boolean;
982982
}
983983

984-
export interface IExpandOptions {
985-
/**
986-
* If compact IRI prefixes can end with any kind of character in simple term definitions,
987-
* instead of only the default gen-delim characters (:,/,?,#,[,],@).
988-
*/
989-
allowPrefixNonGenDelims: boolean;
990-
/**
991-
* If compact IRI prefixes ending with a non-gen-delim character
992-
* can be forced as a prefix using @prefix: true.
993-
*/
994-
allowPrefixForcing: boolean;
995-
/**
996-
* If @vocab values are allowed contain IRIs relative to @base.
997-
*/
998-
allowVocabRelativeToBase: boolean;
999-
}
1000-
export const defaultExpandOptions: IExpandOptions = {
1001-
allowPrefixForcing: true,
1002-
allowPrefixNonGenDelims: false,
1003-
allowVocabRelativeToBase: true,
1004-
};

lib/JsonLdContextNormalized.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {resolve} from "relative-to-absolute-iri";
2-
import {defaultExpandOptions, IExpandOptions} from "./ContextParser";
32
import {ERROR_CODES, ErrorCoded} from "./ErrorCoded";
43
import {IJsonLdContextNormalizedRaw} from "./JsonLdContext";
54
import {Util} from "./Util";
@@ -176,3 +175,25 @@ export class JsonLdContextNormalized {
176175
}
177176

178177
}
178+
179+
export interface IExpandOptions {
180+
/**
181+
* If compact IRI prefixes can end with any kind of character in simple term definitions,
182+
* instead of only the default gen-delim characters (:,/,?,#,[,],@).
183+
*/
184+
allowPrefixNonGenDelims: boolean;
185+
/**
186+
* If compact IRI prefixes ending with a non-gen-delim character
187+
* can be forced as a prefix using @prefix: true.
188+
*/
189+
allowPrefixForcing: boolean;
190+
/**
191+
* If @vocab values are allowed contain IRIs relative to @base.
192+
*/
193+
allowVocabRelativeToBase: boolean;
194+
}
195+
export const defaultExpandOptions: IExpandOptions = {
196+
allowPrefixForcing: true,
197+
allowPrefixNonGenDelims: false,
198+
allowVocabRelativeToBase: true,
199+
};

lib/Util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {IExpandOptions} from "./ContextParser";
1+
import {IExpandOptions} from "./JsonLdContextNormalized";
22
import {IJsonLdContextNormalizedRaw, JsonLdContext} from "./JsonLdContext";
33

44
export class Util {

test/JsonLdContextNormalized-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {defaultExpandOptions} from "../lib/ContextParser";
1+
import {defaultExpandOptions} from "../lib/JsonLdContextNormalized";
22
import {ERROR_CODES, ErrorCoded} from "../lib/ErrorCoded";
33
import {JsonLdContextNormalized} from "../lib/JsonLdContextNormalized";
44

0 commit comments

Comments
 (0)