Skip to content

Commit

Permalink
feat: add boolean value to identify (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyang1520 authored Dec 21, 2022
1 parent 2964dd5 commit b5eec9a
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ private Identify createIdentify(JSONObject userProperties) {
identify.append(key, userPropertiesObj.getJSONObject(key));
} else if ((Object)userPropertiesObj.get(key) instanceof JSONArray) {
identify.append(key, userPropertiesObj.getJSONArray(key));
} else if ((Object)userPropertiesObj.get(key) instanceof Boolean) {
identify.append(key, userPropertiesObj.getBoolean(key));
}
case "$prepend":
if ((Object)userPropertiesObj.get(key) instanceof Double){
Expand All @@ -485,6 +487,8 @@ private Identify createIdentify(JSONObject userProperties) {
identify.prepend(key, userPropertiesObj.getJSONObject(key));
} else if ((Object)userPropertiesObj.get(key) instanceof JSONArray) {
identify.prepend(key, userPropertiesObj.getJSONArray(key));
} else if ((Object)userPropertiesObj.get(key) instanceof Boolean) {
identify.prepend(key, userPropertiesObj.getBoolean(key));
}
case "$preInsert":
if ((Object)userPropertiesObj.get(key) instanceof Double){
Expand All @@ -499,6 +503,8 @@ private Identify createIdentify(JSONObject userProperties) {
identify.preInsert(key, userPropertiesObj.getJSONObject(key));
} else if ((Object)userPropertiesObj.get(key) instanceof JSONArray) {
identify.preInsert(key, userPropertiesObj.getJSONArray(key));
} else if ((Object)userPropertiesObj.get(key) instanceof Boolean) {
identify.preInsert(key, userPropertiesObj.getBoolean(key));
}
case "$postInsert":
if ((Object)userPropertiesObj.get(key) instanceof Double){
Expand All @@ -513,6 +519,8 @@ private Identify createIdentify(JSONObject userProperties) {
identify.postInsert(key, userPropertiesObj.getJSONObject(key));
} else if ((Object)userPropertiesObj.get(key) instanceof JSONArray) {
identify.postInsert(key, userPropertiesObj.getJSONArray(key));
} else if ((Object)userPropertiesObj.get(key) instanceof Boolean) {
identify.postInsert(key, userPropertiesObj.getBoolean(key));
}
case "$set":
if ((Object)userPropertiesObj.get(key) instanceof Double){
Expand All @@ -527,6 +535,8 @@ private Identify createIdentify(JSONObject userProperties) {
identify.set(key, userPropertiesObj.getJSONObject(key));
} else if ((Object)userPropertiesObj.get(key) instanceof JSONArray) {
identify.set(key, userPropertiesObj.getJSONArray(key));
} else if ((Object)userPropertiesObj.get(key) instanceof Boolean) {
identify.set(key, userPropertiesObj.getBoolean(key));
}
case "$setOnce":
if ((Object)userPropertiesObj.get(key) instanceof Double){
Expand All @@ -541,6 +551,8 @@ private Identify createIdentify(JSONObject userProperties) {
identify.setOnce(key, userPropertiesObj.getJSONObject(key));
} else if ((Object)userPropertiesObj.get(key) instanceof JSONArray) {
identify.setOnce(key, userPropertiesObj.getJSONArray(key));
} else if ((Object)userPropertiesObj.get(key) instanceof Boolean) {
identify.setOnce(key, userPropertiesObj.getBoolean(key));
}
case "$unset":
identify.unset(key); // value is default to `-`
Expand Down

0 comments on commit b5eec9a

Please sign in to comment.