diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a9ca4a6..479d3041 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 16 + - run: npm install - run: npm run check-format build: runs-on: ubuntu-latest diff --git a/src/api/plugin-api.ts b/src/api/plugin-api.ts index e467c84d..ba2ecec6 100644 --- a/src/api/plugin-api.ts +++ b/src/api/plugin-api.ts @@ -358,25 +358,19 @@ export class DataviewApi { * execution via `result.successful` and obtain `result.value` or `result.error` resultingly. If * you'd rather this method throw on an error, use `dv.tryEvaluate`. */ - public evaluate( - expression: string, - context?: DataObject, - originFile?: string): Result { + public evaluate(expression: string, context?: DataObject, originFile?: string): Result { let field = EXPRESSION.field.parse(expression); if (!field.status) return Result.failure(`Failed to parse expression "${expression}"`); let evaluationContext = originFile ? new Context(defaultLinkHandler(this.index, originFile), this.settings) - : this.evaluationContext + : this.evaluationContext; return evaluationContext.evaluate(field.value, context); } /** Error-throwing version of `dv.evaluate`. */ - public tryEvaluate( - expression: string, - context?: DataObject, - originFile?: string): Literal { + public tryEvaluate(expression: string, context?: DataObject, originFile?: string): Literal { return this.evaluate(expression, context, originFile).orElseThrow(); }