function isPrimitive (val: any): boolean {
    return val !== Object(val)
}