Skip to content

Commit 88a911a

Browse files
gkelloggdavidlehn
authored andcommitted
Minor cleanup.
1 parent d23b1df commit 88a911a

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

lib/context.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ api.createTermDefinition = (activeCtx, localCtx, term, defined) => {
413413

414414
// JSON-LD 1.1 support
415415
if(api.processingMode(activeCtx, 1.1)) {
416-
// TODO: @id and @type
417416
validContainers.push('@graph', '@id', '@type');
418417

419418
// check container length
@@ -547,13 +546,10 @@ api.createTermDefinition = (activeCtx, localCtx, term, defined) => {
547546
*/
548547
api.expandIri = (activeCtx, value, relativeTo, localCtx, defined) => {
549548
// already expanded
550-
if(value === null || api.isKeyword(value)) {
549+
if(value === null || !_isString(value) || api.isKeyword(value)) {
551550
return value;
552551
}
553552

554-
// ensure value is interpreted as a string
555-
value = String(value);
556-
557553
// define term dependency if not defined
558554
if(localCtx && value in localCtx && defined[value] !== true) {
559555
api.createTermDefinition(activeCtx, localCtx, value, defined);
@@ -865,7 +861,7 @@ api.getAllContexts = async (input, options) => {
865861
* Processing Mode check.
866862
*
867863
* @param activeCtx the current active context.
868-
* @param version the or numeric version to check.
864+
* @param version the string or numeric version to check.
869865
*
870866
* @return boolean.
871867
*/

lib/expand.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ function _expandObject({
533533
} else if(container.includes('@type') && _isObject(value)) {
534534
// handle type container (skip if value is not an object)
535535
expandedValue = _expandIndexMap({
536-
activeCtx,
536+
activeCtx: termCtx,
537537
options,
538538
activeProperty: key,
539539
value,

0 commit comments

Comments
 (0)