/*jshint -W053 */
import { MicroState } from 'ember-microstates';

export default MicroState.extend({

  initialValueFor([string]) {
    if (string === undefined || string === null) {
      return '';
    } else if (string && string.toString) {
      return string.toString();
    } else {
      return string;
    }
  },

  prototypeFor(value) {
    let wrapped = new String(value);

    Object.defineProperties(wrapped, {
      toString : {
        value() {
          return value;
        }
      },
      valueOf: {
        value() {
          return value;
        }
      }
    });

    return wrapped;
  }
});

@@ -121,16 +121,21 @@
 (%5Bstring
+ = ''
 %5D) %7B%0A   
@@ -152,33 +152,8 @@
 g ==
-= undefined %7C%7C string ===
  nul
@@ -189,84 +189,8 @@
 lse 
-if (string && string.toString) %7B%0A      return string.toString();%0A    %7D else 
 %7B%0A  
@@ -200,22 +200,30 @@
  return 
+String(
 string
+)
 ;%0A    %7D%0A

Simplified string coersion