Typecast the value.
TODO: Move the EDB hack into EDBML module somehow.
@param {object} value
@returns {object}
772012
function(value) {
		if (gui.Type.isString(value)) {
			if (gui.hasModule('edbml@wunderbyte.com') && value.startsWith('edbml.$get')) {
				value = window.edbml.$get(gui.KeyMaster.extractKey(value)[0]);
			} else {
				value = gui.Type.cast(value);
				if (gui.Type.isString(value)) {
					value = this._jsonvaluate(value);
				}
			}
		}
		return value;
	}
883978
@Override public Object transform(Object value) {
        if (value == null) {
            return value;
        } else if (value instanceof Boolean) {
            return value;
        } else if (value instanceof String) {
            return value;
        } else if (value instanceof Number) {
            return InternalUtils.toBigDecimal((Number)value);
        } else if (value instanceof byte[]) {
            return value;
        } else if (value instanceof ByteBuffer) {
            return copyBytesFrom((ByteBuffer)value);
        } else if (value instanceof Set) {
            @SuppressWarnings("unchecked")
            Set<Object> set = (Set<Object>) value;
            if (set.size() == 0)
                return value;
            Object element = set.iterator().next();
            if (element instanceof String) {
                return value;
            } else if (element instanceof BigDecimal) {
                return value;
            } else if (element instanceof Number) {
                @SuppressWarnings("unchecked")
                Set<Number> in = (Set<Number>) value;
                Set<BigDecimal> out = new LinkedHashSet<BigDecimal>(set.size());
                for (Number n : in)
                    out.add(InternalUtils.toBigDecimal(n));
                return out;
            } else if (element instanceof byte[]) {
                return value;
            } else if (element instanceof ByteBuffer) {
                @SuppressWarnings("unchecked")
                Set<ByteBuffer> bs = (Set<ByteBuffer>) value;
                Set<byte[]> out = new LinkedHashSet<byte[]>(bs.size());
                for (ByteBuffer bb: bs)
                    out.add(copyBytesFrom(bb));
                return out;
            } else {
                throw new UnsupportedOperationException("element type: "
                        + element.getClass());
            }
        } else if (value instanceof List) {
            @SuppressWarnings("unchecked")
            List<Object> in = (List<Object>) value;
            if (in.size() == 0)
                return in;
            List<Object> out = new ArrayList<Object>();
            for (Object v : in)
                out.add(transform(v));
            return out;
        } else if (value instanceof Map) {
            @SuppressWarnings("unchecked")
            Map<String, Object> in = (Map<String, Object>) value;
            if (in.size() == 0)
                return in;
            Map<String, Object> out = new LinkedHashMap<String, Object>(in.size());
            for (Map.Entry<String, Object> e : in.entrySet())
                out.put(e.getKey(), transform(e.getValue()));
            return out;
        } else {
            throw new UnsupportedOperationException("value type: "
                    + value.getClass());
        }
    }
938800
function type (value) {
  const proto = toString.call(value)
  return proto.substring(8, proto.length - 1)
}
1272659
function getter (value, properties) {
  // Most calculations happen within the typecast and the value passed is typically the value we want to use.
  // Typically, the getter just returns the value.
  // Modifications to the value within the getter are not written to the object.

  // Getter can transform value after typecast.
  if (properties.get) {
    value = properties.get.call(this, value)
  }

  return value
}
1304478
function typeOf(value) {
            var s = typeof value;
            if(s === 'object') {
                if(value) {
                    if(value instanceof Array) {
                        s = 'array';
                    }
                } else {
                    s = 'null';
                }
            }
            return s;
        }
319792
function(value)
	{
		var result = null;
		value = this.trim(value);

		if ( 0 == value.length )
		{
			return '';
		}

		switch ( value.charAt(0) )
		{
			case '[':
				result = this.parseSequence(value);
				break;
			case '{':
				result = this.parseMapping(value);
				break;
			default:
				result = this.parseScalar(value);
		}

		// some comment can end the scalar
		if ( value.substr(this.i+1).replace(/^\s*#.*$/, '') != '' ) {
		    console.log("oups "+value.substr(this.i+1));
			throw new YamlParseException('Unexpected characters near "'+value.substr(this.i)+'".');
		}

		return result;
	}
614172
function serializeValue(value) {

    var type;
    if ( _.isNull(value) ) {
        type = ColumnType.Object;
    } else if ( _.isNumber(value) ) {
        type = ColumnType.Real;
    } else if ( _.isDate(value) ) {
        type = ColumnType.Date;
    } else if ( _.isBool(value) ) {
        type = ColumnType.Boolean;
    } else if ( _.isString(value) ) {
        type = ColumnType.String;
    } else if ( _.isArray(value) ) {
        type = ColumnType.Array;
    } else if ( _.isObject(value) ) {
        type = ColumnType.Object;
    } else {
        type = ColumnType.Object;
    }

    return serializeMember(value, type);
}
243652
function (value) {
		if (value === null) {
			return '';
		}
		if (value === undefined) {
			return '';
		}
		switch (typeof value) {
			case 'object' :
				if (value instanceof Blob) {
					return value;
				} else {
					return JSON.stringify(value);
				}
				break;
			case 'string':
				return value;
			default :
				return value;
		}
	}
1322947
function castProperty(type, value) {
  // Some special handling is needed for some properties as they may be delivered
  // as strings HTML delivers attributes as strings.
  switch (type) {
    // Translate strings into booleans
    case Boolean:
      if (['false', '0', 'null', 'undefined'].indexOf(value) !== -1) {
        return false;
      } else {
        return Boolean(value);
      }

    case Number:
      return Number(value);

    // Translate strings into functions
    case Function:
      /* eslint-disable-next-line */
      return typeof value === 'string' ? eval('(' + value + ')') : value;
    case Object:
      if (value && typeof value === 'string') {
        try {
          return JSON.parse(value);
        } catch (e) {
          // no-op
        }
      }
  }
  return value;
}
50028
public static TypedValue untypedValue(Object value) {
    if (value instanceof TypedValue) {
      return untypedValue(value, ((TypedValue) value).isTransient());
    }
    else return untypedValue(value, false);
  }
531180
protected Object cast(Object value) {
        switch (type) {
            case STRING :
               return valueFactories.getStringFactory().create(value);
            case LONG :
                return valueFactories.getLongFactory().create(value);
            case NAME :
                return valueFactories.getNameFactory().create(value);
            case PATH :
                return valueFactories.getPathFactory().create(value);
            case DATE :
                return valueFactories.getDateFactory().create(value);
            case BOOLEAN :
                return valueFactories.getBooleanFactory().create(value);
            case URI :
                return valueFactories.getUriFactory().create(value);
            case REFERENCE :
                return valueFactories.getReferenceFactory().create(value);
            case SIMPLEREFERENCE :
                return valueFactories.getSimpleReferenceFactory().create(value);
            case WEAKREFERENCE :
                return valueFactories.getWeakReferenceFactory().create(value);
            default :
                return value;
        }
    }
586690
function fromExtra(value, type) {
    const t = (type + '').toLowerCase();
    switch (t) {

        case 'number':
            return toNumberOrUndefined(value);
            break;

        case 'boolean':
            return toTrueOrUndefined(value);
            break;

        case 'objectarray':
            return toObjectArrayOrUndefined(value);
            break;

        case 'date':
            return toDate(value);
            break;

        case 'array':
            return toArrayOrUndefined(value);
            break;

        case 'object':
            return toObjectOrUndefined(value);
            break;

        case 'string':
        default:
            return toStringOrUndefined(value);
            break;
    }
}
1005156
def __type2js(cls, value):
        
        if value is None:
            return 'null'
        elif isinstance(value, bool):
            return 'false' if not value else 'true'
        elif isinstance(value, (int, float)):
            return '%s' % value
        elif isinstance(value, dict):
            return json.dumps(dict)
        return '"%s"' % value
69181
def _cast_to_type(self, value):
        
        if isinstance(value, datetime.datetime):
            return value.date()
        if isinstance(value, datetime.date):
            return value
        try:
            value = date_parser(value)
            return value.date()
        except ValueError:
            self.fail('invalid', value=value)
621296
public static String typeof(Object value)
    {
        if (value == null)
            return "object";
        if (value == Undefined.instance)
            return "undefined";
        if (value instanceof ScriptableObject)
            return ((ScriptableObject) value).getTypeOf();
        if (value instanceof Scriptable)
            return (value instanceof Callable) ? "function" : "object";
        if (value instanceof CharSequence)
            return "string";
        if (value instanceof Number)
            return "number";
        if (value instanceof Boolean)
            return "boolean";
        throw errorWithClassName("msg.invalid.type", value);
    }
132714
protected static Object coerceToSupportedType(Object value) {
        if (value == null) {
            return ""; // # empty string rather than null
        } else if (value instanceof Map) {
            Map valueAsMap = ((Map) value);
            if (valueAsMap.containsKey("*")) {
                return valueAsMap.get("*");
            } else if (valueAsMap.containsKey("__default__")) {
                return valueAsMap.get("__default__");
            } else {
                return s_gson.toJson(valueAsMap);
            }
        } else if (value instanceof Float) {
            return new BigDecimal((float) value);
        } else if (value instanceof Double) {
            return new BigDecimal((double) value);
        } else if (value instanceof Long) {
            return new BigDecimal((long) value);
        } else {
            return value;
        }
    }
809312
function(value) {
      switch (typeof value) {
        case 'undefined':
          return this.undefined;
        case 'string':
          return this.string;
        case 'number':
          if (value % 1 === 0) {
            return this.integer;
          } else {
            return this.double;
          }
          break;
        case 'boolean':
          return this.boolean;
        case 'function':
          return this["function"];
        default:
          if (value === null) {
            return this["null"];
          } else if (value instanceof Date) {
            return this.datetime;
          } else if (value instanceof Array) {
            return this.array;
          } else if (Buffer.isBuffer(value)) {
            throw new TypeError("Value cannot be a buffer");
          } else if (value instanceof Object) {
            return this.object;
          } else {
            throw new TypeError('Value must either be a string, integer, double, boolean, date, array, object or function');
          }
      }
    }