e22m4u 2 лет назад
Родитель
Сommit
1dc9f1d886

+ 1 - 1
src/adapter/decorator/data-sanitizing-decorator.js

@@ -15,7 +15,7 @@ export class DataSanitizingDecorator extends Service {
   decorate(adapter) {
     if (!adapter || !(adapter instanceof Adapter))
       throw new InvalidArgumentError(
-        'A first argument of DataSanitizingDecorator.decorate should be ' +
+        'The first argument of DataSanitizingDecorator.decorate should be ' +
           'an Adapter instance, but %v given.',
         adapter,
       );

+ 1 - 1
src/adapter/decorator/data-validation-decorator.js

@@ -15,7 +15,7 @@ export class DataValidationDecorator extends Service {
   decorate(adapter) {
     if (!adapter || !(adapter instanceof Adapter))
       throw new InvalidArgumentError(
-        'A first argument of DataValidationDecorator.decorate should be ' +
+        'The first argument of DataValidationDecorator.decorate should be ' +
           'an Adapter instance, but %v given.',
         adapter,
       );

+ 1 - 1
src/adapter/decorator/default-values-decorator.js

@@ -15,7 +15,7 @@ export class DefaultValuesDecorator extends Service {
   decorate(adapter) {
     if (!adapter || !(adapter instanceof Adapter))
       throw new InvalidArgumentError(
-        'A first argument of DefaultValuesDecorator.decorate should be ' +
+        'The first argument of DefaultValuesDecorator.decorate should be ' +
           'an Adapter instance, but %v given.',
         adapter,
       );

+ 1 - 1
src/adapter/decorator/fields-filtering-decorator.js

@@ -15,7 +15,7 @@ export class FieldsFilteringDecorator extends Service {
   decorate(adapter) {
     if (!adapter || !(adapter instanceof Adapter))
       throw new InvalidArgumentError(
-        'A first argument of FieldsFilteringDecorator.decorate should be ' +
+        'The first argument of FieldsFilteringDecorator.decorate should be ' +
           'an Adapter instance, but %v given.',
         adapter,
       );

+ 1 - 1
src/adapter/decorator/inclusion-decorator.js

@@ -15,7 +15,7 @@ export class InclusionDecorator extends Service {
   decorate(adapter) {
     if (!adapter || !(adapter instanceof Adapter))
       throw new InvalidArgumentError(
-        'A first argument of InclusionDecorator.decorate should be ' +
+        'The first argument of InclusionDecorator.decorate should be ' +
           'an Adapter instance, but %v given.',
         adapter,
       );

+ 1 - 1
src/definition/model/properties/default-values-definition-validator.js

@@ -15,7 +15,7 @@ export class DefaultValuesDefinitionValidator extends Service {
   validate(modelName, propDefs) {
     if (!modelName || typeof modelName !== 'string')
       throw new InvalidArgumentError(
-        'A first argument of DefaultValuesDefinitionValidator.validate ' +
+        'The first argument of DefaultValuesDefinitionValidator.validate ' +
           'should be a non-empty String, but %v given.',
         modelName,
       );

+ 1 - 1
src/definition/model/properties/default-values-definition-validator.spec.js

@@ -11,7 +11,7 @@ describe('DefaultValuesDefinitionValidator', function () {
       const validate = v => () => S.validate(v, {});
       const error = v =>
         format(
-          'A first argument of DefaultValuesDefinitionValidator.validate ' +
+          'The first argument of DefaultValuesDefinitionValidator.validate ' +
             'should be a non-empty String, but %s given.',
           v,
         );

+ 2 - 2
src/definition/model/properties/properties-definition-validator.js

@@ -17,7 +17,7 @@ export class PropertiesDefinitionValidator extends Service {
   validate(modelName, propDefs) {
     if (!modelName || typeof modelName !== 'string')
       throw new InvalidArgumentError(
-        'A first argument of PropertiesDefinitionValidator.validate ' +
+        'The first argument of PropertiesDefinitionValidator.validate ' +
           'should be a non-empty String, but %v given.',
         modelName,
       );
@@ -54,7 +54,7 @@ export class PropertiesDefinitionValidator extends Service {
   _validateProperty(modelName, propName, propDef) {
     if (!modelName || typeof modelName !== 'string')
       throw new InvalidArgumentError(
-        'A first argument of PropertiesDefinitionValidator._validateProperty ' +
+        'The first argument of PropertiesDefinitionValidator._validateProperty ' +
           'should be a non-empty String, but %v given.',
         modelName,
       );

+ 1 - 1
src/definition/model/properties/properties-definition-validator.spec.js

@@ -19,7 +19,7 @@ describe('PropertiesDefinitionValidator', function () {
       const validate = v => () => S.validate(v, {});
       const error = v =>
         format(
-          'A first argument of PropertiesDefinitionValidator.validate ' +
+          'The first argument of PropertiesDefinitionValidator.validate ' +
             'should be a non-empty String, but %s given.',
           v,
         );

+ 2 - 2
src/definition/model/relations/relations-definition-validator.js

@@ -16,7 +16,7 @@ export class RelationsDefinitionValidator extends Service {
   validate(modelName, relDefs) {
     if (!modelName || typeof modelName !== 'string')
       throw new InvalidArgumentError(
-        'A first argument of RelationsDefinitionValidator.validate ' +
+        'The first argument of RelationsDefinitionValidator.validate ' +
           'should be a non-empty String, but %v given.',
         modelName,
       );
@@ -44,7 +44,7 @@ export class RelationsDefinitionValidator extends Service {
   _validateRelation(modelName, relName, relDef) {
     if (!modelName || typeof modelName !== 'string')
       throw new InvalidArgumentError(
-        'A first argument of RelationsDefinitionValidator._validateRelation ' +
+        'The first argument of RelationsDefinitionValidator._validateRelation ' +
           'should be a non-empty String, but %v given.',
         modelName,
       );

+ 1 - 1
src/definition/model/relations/relations-definition-validator.spec.js

@@ -11,7 +11,7 @@ describe('RelationsDefinitionValidator', function () {
       const validate = v => () => S.validate(v, {});
       const error = v =>
         format(
-          'A first argument of RelationsDefinitionValidator.validate ' +
+          'The first argument of RelationsDefinitionValidator.validate ' +
             'should be a non-empty String, but %s given.',
           v,
         );

+ 12 - 12
src/filter/operator-clause-tool.js

@@ -58,7 +58,7 @@ export class OperatorClauseTool extends Service {
   testAll(clause, value) {
     if (!clause || typeof clause !== 'object' || Array.isArray(clause))
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testAll ' +
+        'The first argument of OperatorUtils.testAll ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -136,7 +136,7 @@ export class OperatorClauseTool extends Service {
   testEqNeq(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testEqNeq ' +
+        'The first argument of OperatorUtils.testEqNeq ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -182,7 +182,7 @@ export class OperatorClauseTool extends Service {
   testGtLt(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testGtLt ' +
+        'The first argument of OperatorUtils.testGtLt ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -209,7 +209,7 @@ export class OperatorClauseTool extends Service {
   testInq(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testInq ' +
+        'The first argument of OperatorUtils.testInq ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -245,7 +245,7 @@ export class OperatorClauseTool extends Service {
   testNin(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testNin ' +
+        'The first argument of OperatorUtils.testNin ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -281,7 +281,7 @@ export class OperatorClauseTool extends Service {
   testBetween(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testBetween ' +
+        'The first argument of OperatorUtils.testBetween ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -317,7 +317,7 @@ export class OperatorClauseTool extends Service {
   testExists(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testExists ' +
+        'The first argument of OperatorUtils.testExists ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -350,7 +350,7 @@ export class OperatorClauseTool extends Service {
   testLike(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testLike ' +
+        'The first argument of OperatorUtils.testLike ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -378,7 +378,7 @@ export class OperatorClauseTool extends Service {
   testNlike(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testNlike ' +
+        'The first argument of OperatorUtils.testNlike ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -410,7 +410,7 @@ export class OperatorClauseTool extends Service {
   testIlike(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testIlike ' +
+        'The first argument of OperatorUtils.testIlike ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -442,7 +442,7 @@ export class OperatorClauseTool extends Service {
   testNilike(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testNilike ' +
+        'The first argument of OperatorUtils.testNilike ' +
           'should be an Object, but %v given.',
         clause,
       );
@@ -486,7 +486,7 @@ export class OperatorClauseTool extends Service {
   testRegexp(clause, value) {
     if (!clause || typeof clause !== 'object')
       throw new InvalidArgumentError(
-        'A first argument of OperatorUtils.testRegexp ' +
+        'The first argument of OperatorUtils.testRegexp ' +
           'should be an Object, but %v given.',
         clause,
       );

+ 12 - 12
src/filter/operator-clause-tool.spec.js

@@ -115,7 +115,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testAll(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testAll ' +
+        'The first argument of OperatorUtils.testAll ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -130,7 +130,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testEqNeq(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testEqNeq ' +
+        'The first argument of OperatorUtils.testEqNeq ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -215,7 +215,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testGtLt(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testGtLt ' +
+        'The first argument of OperatorUtils.testGtLt ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -390,7 +390,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testInq(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testInq ' +
+        'The first argument of OperatorUtils.testInq ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -445,7 +445,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testNin(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testNin ' +
+        'The first argument of OperatorUtils.testNin ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -514,7 +514,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testBetween(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testBetween ' +
+        'The first argument of OperatorUtils.testBetween ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -571,7 +571,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testExists(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testExists ' +
+        'The first argument of OperatorUtils.testExists ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -694,7 +694,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testLike(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testLike ' +
+        'The first argument of OperatorUtils.testLike ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -773,7 +773,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testNlike(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testNlike ' +
+        'The first argument of OperatorUtils.testNlike ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -852,7 +852,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testIlike(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testIlike ' +
+        'The first argument of OperatorUtils.testIlike ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -931,7 +931,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testNilike(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testNilike ' +
+        'The first argument of OperatorUtils.testNilike ' +
           'should be an Object, but 10 given.',
       );
     });
@@ -1022,7 +1022,7 @@ describe('OperatorClauseTool', function () {
     it('throws an error if a first argument is not an object', function () {
       const throwable = () => S.testRegexp(10);
       expect(throwable).to.throw(
-        'A first argument of OperatorUtils.testRegexp ' +
+        'The first argument of OperatorUtils.testRegexp ' +
           'should be an Object, but 10 given.',
       );
     });

+ 1 - 1
src/filter/slice-clause-tool.js

@@ -16,7 +16,7 @@ export class SliceClauseTool extends Service {
   slice(entities, skip = undefined, limit = undefined) {
     if (!Array.isArray(entities))
       throw new InvalidArgumentError(
-        'A first argument of SliceClauseTool.slice ' +
+        'The first argument of SliceClauseTool.slice ' +
           'should be an Array, but %v given.',
         entities,
       );

+ 1 - 1
src/filter/slice-clause-tool.spec.js

@@ -55,7 +55,7 @@ describe('SliceClauseTool', function () {
     it('throws an error if a first argument is not an array', function () {
       const throwable = () => S.slice(10);
       expect(throwable).to.throw(
-        'A first argument of SliceClauseTool.slice ' +
+        'The first argument of SliceClauseTool.slice ' +
           'should be an Array, but 10 given.',
       );
     });

+ 3 - 3
src/utils/select-object-keys.js

@@ -10,20 +10,20 @@ import {InvalidArgumentError} from '../errors/index.js';
 export function selectObjectKeys(obj, keys) {
   if (!obj || typeof obj !== 'object' || Array.isArray(obj))
     throw new InvalidArgumentError(
-      'A first argument of selectObjectKeys ' +
+      'The first argument of selectObjectKeys ' +
         'should be an Object, but %v given.',
       obj,
     );
   if (!Array.isArray(keys))
     throw new InvalidArgumentError(
-      'A second argument of selectObjectKeys ' +
+      'The second argument of selectObjectKeys ' +
         'should be an Array of String, but %v given.',
       keys,
     );
   keys.forEach(key => {
     if (typeof key !== 'string')
       throw new InvalidArgumentError(
-        'A second argument of selectObjectKeys ' +
+        'The second argument of selectObjectKeys ' +
           'should be an Array of String, but %v given.',
         key,
       );

+ 3 - 3
src/utils/select-object-keys.spec.js

@@ -17,7 +17,7 @@ describe('selectObjectKeys', function () {
   it('throws an error if a given value is not an Object', function () {
     const throwable = () => selectObjectKeys(10, ['key']);
     expect(throwable).to.throw(
-      'A first argument of selectObjectKeys ' +
+      'The first argument of selectObjectKeys ' +
         'should be an Object, but 10 given.',
     );
   });
@@ -25,7 +25,7 @@ describe('selectObjectKeys', function () {
   it('throws an error if a given keys is not an Array', function () {
     const throwable = () => selectObjectKeys({});
     expect(throwable).to.throw(
-      'A second argument of selectObjectKeys ' +
+      'The second argument of selectObjectKeys ' +
         'should be an Array of String, but undefined given.',
     );
   });
@@ -33,7 +33,7 @@ describe('selectObjectKeys', function () {
   it('throws an error if a given keys is not an String', function () {
     const throwable = () => selectObjectKeys({}, [10]);
     expect(throwable).to.throw(
-      'A second argument of selectObjectKeys ' +
+      'The second argument of selectObjectKeys ' +
         'should be an Array of String, but 10 given.',
     );
   });