Comparing version 0.0.14 to 0.0.15
29
index.js
@@ -37,3 +37,3 @@ ;(() => { | ||
module.exports = { | ||
aim: (n, a = 0, cb, vrs) => { | ||
aim: (n, a = 0, cb, vrs, t) => { | ||
if (!n) return np | ||
@@ -45,3 +45,11 @@ if (!S.e(pr + n)) { | ||
cb && | ||
cb({ experiment: n, allocation: a, variant: v, variants: vs, anonymousId: S.g(anon)[0] }) | ||
cb({ | ||
type: 'aim', | ||
experiment: n, | ||
allocation: a, | ||
variant: v, | ||
variants: vs, | ||
anonymousId: S.g(anon)[0], | ||
traits: t | ||
}) | ||
S.s(pr + n, s + ',' + v) | ||
@@ -52,9 +60,20 @@ } | ||
}, | ||
launch: (n, cb) => { | ||
launch: (n, cb, t) => { | ||
if (!S.e(pr + n)) return | ||
let [s, v] = S.g(pr + n) | ||
return s > 0 && cb && cb({ experiment: n, variant: v, anonymousId: S.g(anon)[0] }) | ||
return ( | ||
s > 0 && | ||
cb && | ||
cb({ type: 'launch', experiment: n, variant: v, anonymousId: S.g(anon)[0], traits: t })) | ||
}, | ||
hit: (n, cb) => cb && cb({ experiment: n, variant: S.g(pr + n)[1], anonymousId: S.g(anon)[0] }) | ||
hit: (n, cb, t) => | ||
cb && | ||
cb({ | ||
type: 'hit', | ||
experiment: n, | ||
variant: S.g(pr + n)[1], | ||
anonymousId: S.g(anon)[0], | ||
traits: t | ||
}) | ||
} | ||
})() |
{ | ||
"name": "couillard", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "Couillard is a small trebuchet, you aim, and launch at your users.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,3 +22,3 @@ ![](https://badgen.net/bundlephobia/minzip/couillard) | ||
```javascript | ||
// Your metrics store, can be Segment, Amplitude, SQL, mongo, or what ever you like. | ||
// Your metrics store, can be Segment, Amplitude, SQL, mongo, or whatever you like. | ||
const saveMetrics = metrics => | ||
@@ -25,0 +25,0 @@ fetch('...', { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5454
74