stalniy/casl

View on GitHub
packages/casl-prisma/src/errors/ParsingQueryError.ts

Summary

Maintainability
A
0 mins
Test Coverage
export class ParsingQueryError extends Error {
  static invalidArgument(operatorName: string, value: unknown, expectValueType: string) {
    const valueType = `${typeof value}(${JSON.stringify(value, null, 2)})`;
    return new this(
      `"${operatorName}" expects to receive ${expectValueType} but instead got "${valueType}"`
    );
  }
}