'use strict';

const { addAllErrorHandlers } = require('./error');

const addOperator = {
  check (opVal) {
    if (opVal !== 2) { return; }

    return 'value cannot be equal to 2';
  },

  attribute: ['string'],

  argument: ['string', 'integer[]', 'boolean[]', 'null[]'],
};

// All patch operators
const operators = {
  _add: addOperator,
};

const OPERATORS = addAllErrorHandlers({ operators });

module.exports = {
  OPERATORS,
};

@@ -197,22 +197,33 @@
 bute: %5B'
-string
+integer', 'number
 '%5D,%0A%0A  a
@@ -236,26 +236,16 @@
 t: %5B
-'string', 
 'integer
 %5B%5D',
@@ -244,35 +244,136 @@
 eger
-%5B%5D
 ', '
-boolean%5B%5D', 'null%5B%5D'%5D
+number', 'null'%5D,%0A%0A  apply (attrVal, opVal) %7B%0A    const opValA = opVal == null ? 0 : opVal;%0A    return attrVal + opValA;%0A  %7D
 ,%0A%7D;

Improve _add operator