diff --git a/README.md b/README.md index eaae6fb..0a95759 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,8 @@ Provided an object containing an "id" property, brie evaluates the presence of t `Always` asks brie to "always" respond with the given input. Why? Code consistency, mainly. #### percentScale(object, opts) +The `object.id` is used to calculate a percentage, modified by the salt value. If the resulting, salted, number is within range, returns true; otherwise false. + ``` opts = { percentMin:[0-1], @@ -67,9 +69,10 @@ Provided an object containing an "id" property, brie evaluates the presence of t testPhase:[string] } ``` -"testPhase" is used for logging and debugging only, and does not impact the algorithm. -The `object.id` is used to calculate a percentage, modified by the salt value. If the resulting, salted, number is within range, returns true; otherwise false. +`testPhase` is used for logging and debugging only, and does not impact the algorithm. + +`salt` is used to allow the same `id` to map to a different boolean amongst the feature flags. Thus you can have one flag with the `{ percentMin: 0, percentMax: 50, salt:0.5 }` return true, and another with `{ percentMin: 0, percentMax: 50, salt: 0.9 }` return false. Conversely you can tie together a booleans using the same salt. #### has(test data [object], comparison data [object]) The most complex criteria mechanism, `has` will evaluate the test data (first argument) against the trait, comparator and value provided in the second argument. If the test data has the trait and the associated value evaluates properly considering the comparison value, then true is returned.