Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Add support for anonymous built-in, and add toggle method #5

Merged
merged 1 commit into from
Mar 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ var new_client = function(api_key, config) {
});

client.get_flag = function(key, user, default_val, fn) {
client.toggle(key, user, default_val, fn);
}

client.toggle = function(key, user, default_val, fn) {
var cb = fn || noop;

if (this.offline) {
Expand Down Expand Up @@ -195,7 +199,7 @@ function param_for_user(feature, user) {
return result
}

var builtins = ['key', 'ip', 'country', 'email', 'firstName', 'lastName', 'avatar', 'name'];
var builtins = ['key', 'ip', 'country', 'email', 'firstName', 'lastName', 'avatar', 'name', 'anonymous'];

function match_target(target, user) {
var uValue;
Expand Down