Skip to content

Commit

Permalink
remove a bunch of code that wasn't in use
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored and timgl committed Apr 9, 2020
1 parent afd8ea4 commit b6b39a9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 875 deletions.
83 changes: 0 additions & 83 deletions src/api-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import { _ } from './utils';

/** @const */ var SET_ACTION = '$set';
/** @const */ var SET_ONCE_ACTION = '$set_once';
/** @const */ var UNSET_ACTION = '$unset';
/** @const */ var ADD_ACTION = '$add';
/** @const */ var APPEND_ACTION = '$append';
/** @const */ var UNION_ACTION = '$union';
/** @const */ var REMOVE_ACTION = '$remove';
/** @const */ var DELETE_ACTION = '$delete';

// Common internal methods for posthog.people and posthog.group APIs.
// These methods shouldn't involve network I/O.
Expand All @@ -31,23 +25,6 @@ var apiActions = {
return data;
},

unset_action: function(prop) {
var data = {};
var $unset = [];
if (!_.isArray(prop)) {
prop = [prop];
}

_.each(prop, function(k) {
if (!this._is_reserved_property(k)) {
$unset.push(k);
}
}, this);

data[UNSET_ACTION] = $unset;
return data;
},

set_once_action: function(prop, to) {
var data = {};
var $set_once = {};
Expand All @@ -62,71 +39,11 @@ var apiActions = {
}
data[SET_ONCE_ACTION] = $set_once;
return data;
},

union_action: function(list_name, values) {
var data = {};
var $union = {};
if (_.isObject(list_name)) {
_.each(list_name, function(v, k) {
if (!this._is_reserved_property(k)) {
$union[k] = _.isArray(v) ? v : [v];
}
}, this);
} else {
$union[list_name] = _.isArray(values) ? values : [values];
}
data[UNION_ACTION] = $union;
return data;
},

append_action: function(list_name, value) {
var data = {};
var $append = {};
if (_.isObject(list_name)) {
_.each(list_name, function(v, k) {
if (!this._is_reserved_property(k)) {
$append[k] = v;
}
}, this);
} else {
$append[list_name] = value;
}
data[APPEND_ACTION] = $append;
return data;
},

remove_action: function(list_name, value) {
var data = {};
var $remove = {};
if (_.isObject(list_name)) {
_.each(list_name, function(v, k) {
if (!this._is_reserved_property(k)) {
$remove[k] = v;
}
}, this);
} else {
$remove[list_name] = value;
}
data[REMOVE_ACTION] = $remove;
return data;
},

delete_action: function() {
var data = {};
data[DELETE_ACTION] = '';
return data;
}
};

export {
SET_ACTION,
SET_ONCE_ACTION,
UNSET_ACTION,
ADD_ACTION,
APPEND_ACTION,
UNION_ACTION,
REMOVE_ACTION,
DELETE_ACTION,
apiActions
};
Loading

0 comments on commit b6b39a9

Please sign in to comment.