/**
 * semantic-merge
 *
 * @author     Robert Rossmann <rr.rossmann@me.com>
 * @copyright  2015 Robert Rossmann
 * @license    http://choosealicense.com/licenses/bsd-3-clause  BSD-3-Clause License
 */

'use strict'

var Benchmark = require('benchmark')
  , merge = require('../lib/merger')
  , source
  , target

/*
 * Merging two objects
 */
new Benchmark.Suite()

.add('Object shallow merge', function () {
  merge(source).and(target).into({})
})

.add('Object deep merge', function () {
  merge(source).and(target).recursively.into({})
})

.on('start cycle', function () {
  source = { key: 'svalue', key2: 'svalue2', key3: { rkey1: 'rsvalue', rkey2: 'rsvalue2' } }
  target = { key: 'tvalue', key2: 'tvalue2', key3: { rkey1: 'rtvalue', rkey2: 'rtvalue2' } }
})

.on('cycle', logResult)

.run()

/*
 * Merging two arrays
 */
new Benchmark.Suite()

.add('Array shallow merge', function () {
  merge(source).and(target).into([])
})

.on('start cycle', function () {
  var shared = {}
  source = [ 'svalue', 'svalue2', { rkey1: 'rsvalue' }, shared ]
  target = [ 'tvalue', 'tvalue2', { rkey1: 'rtvalue' }, shared ]
})

.on('cycle', logResult)

.run()


function logResult (res) {
  console.log(res.target.toString())
}

@@ -210,19 +210,21 @@
 trict'%0A%0A
-var
+const
  Benchma
@@ -249,19 +249,21 @@
 hmark')%0A
-  ,
+const
  merge =
@@ -292,19 +292,20 @@
 r')%0A
-  ,
+%0Alet
  source%0A
   , 
@@ -304,11 +304,11 @@
 rce%0A
-  ,
+let
  tar
@@ -390,35 +390,29 @@
 low merge', 
-function ()
+() =%3E
  %7B%0A  merge(s
@@ -465,35 +465,29 @@
 eep merge', 
-function ()
+() =%3E
  %7B%0A  merge(s
@@ -545,35 +545,29 @@
 art cycle', 
-function ()
+() =%3E
  %7B%0A  source 
@@ -856,35 +856,29 @@
 low merge', 
-function ()
+() =%3E
  %7B%0A  merge(s
@@ -904,25 +904,24 @@
 into(%5B%5D)%0A%7D)%0A
-%0A
 .on('start c
@@ -931,27 +931,23 @@
 e', 
-function () %7B%0A  var
+() =%3E %7B%0A  const
  sha
@@ -955,16 +955,17 @@
 ed = %7B%7D%0A
+%0A
   source
@@ -968,17 +968,16 @@
 urce = %5B
- 
 'svalue'
@@ -1017,17 +1017,16 @@
 , shared
- 
 %5D%0A  targ
@@ -1031,17 +1031,16 @@
 rget = %5B
- 
 'tvalue'
@@ -1084,15 +1084,13 @@
 ared
- 
 %5D%0A%7D)%0A
-%0A
 .on(
@@ -1101,33 +1101,32 @@
 le', logResult)%0A
-%0A
 .run()%0A%0A%0Afunctio
@@ -1118,16 +1118,144 @@
 run()%0A%0A%0A
+/**%0A * Log the benchmark result to console%0A *%0A * @private%0A * @param     %7BObject%7D    res    Result data%0A * @return    %7Bvoid%7D%0A */%0A
 function
@@ -1268,17 +1268,16 @@
 sult
- 
 (res) %7B%0A
   co
@@ -1272,16 +1272,57 @@
 (res) %7B%0A
+  // eslint-disable-next-line no-console%0A
   consol

Fix benchmark coding style