Skip to content

Commit e558cee

Browse files
committed
added support to call with validate=true on more cases
1 parent 952df70 commit e558cee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/data/model/HashedObject.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,22 +436,22 @@ abstract class HashedObject {
436436
}
437437

438438

439-
static fromLiteralContext(literalContext: LiteralContext, hash?: Hash) : HashedObject {
439+
static fromLiteralContext(literalContext: LiteralContext, hash?: Hash, validate=false) : HashedObject {
440440

441441
let context = new Context();
442442
context.fromLiteralContext(literalContext);
443443

444-
return HashedObject.fromContext(context, hash);
444+
return HashedObject.fromContext(context, hash, validate);
445445
}
446446

447447

448-
static fromLiteral(literal: Literal) : HashedObject {
448+
static fromLiteral(literal: Literal, validate=false) : HashedObject {
449449

450450
let context = new Context();
451451
context.rootHashes.push(literal.hash);
452452
context.literals.set(literal.hash, literal);
453453

454-
return HashedObject.fromContext(context);
454+
return HashedObject.fromContext(context, undefined, validate);
455455

456456
}
457457

0 commit comments

Comments
 (0)