'use strict';

/**
 * Determine information about the failed validation
 * check.
 *
 * @param {any} value
 * @param {Object} result The error object
 * @returns {String} Human readable error message
 */
export default function getErrorClue(value, result) {
    switch(result.type) {
        case 'wrapper.validator':
            return `Custom validator failed for value "${value}".`;
        case 'wrapper.equals':
            return `The given value "${value}" did not strictly equal "${result.info.expectedValue}".`;
        case 'nativetype':
            return `Expected${result.optional ? `optional ` : ``} ${result.info.expectedType}, got ${result.info.got}.`;
        case 'instanceof':
            return `Expected${result.optional ? `optional ` : ``} instance of ${result.info.expectedInstance}, got ${result.info.got}.`;
        case 'array-literal':
            return `Expected${result.optional ? `optional ` : ``} array, got ${result.info.got}.`;
        case 'object-literal':
            return `Expected${result.optional ? `optional ` : ``} object, got ${result.info.got}.`;
    }
};

@@ -586,32 +586,33 @@
 optional ? %60
+ 
 optional
  %60 : %60%60%7D $%7Br
@@ -591,33 +591,32 @@
 nal ? %60 optional
- 
 %60 : %60%60%7D $%7Bresult
@@ -734,32 +734,33 @@
 optional ? %60
+ 
 optional
  %60 : %60%60%7D ins
@@ -739,33 +739,32 @@
 nal ? %60 optional
- 
 %60 : %60%60%7D instance
@@ -901,32 +901,33 @@
 optional ? %60
+ 
 optional
  %60 : %60%60%7D arr
@@ -906,33 +906,32 @@
 nal ? %60 optional
- 
 %60 : %60%60%7D array, g
@@ -1035,24 +1035,25 @@
 onal ? %60
+ 
 optional
  %60 : %60%60%7D
@@ -1044,17 +1044,16 @@
 optional
- 
 %60 : %60%60%7D 

fix typos in error messages