├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── examples ├── browser │ └── index.html └── node │ └── basic.js ├── package.json ├── sixpack.js └── test └── sixpack-test.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Node 2 | node_modules 3 | 4 | # Log files 5 | *.log 6 | 7 | *~ 8 | *#* 9 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /node_modules/ 3 | /test/ 4 | /.gitignore 5 | /.npmignore 6 | /npm-debug.log 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, SeatGeek, Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | Neither the name of the SeatGeek nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sixpack-client 2 | 3 | Node / browser client library for SeatGeek's [Sixpack](https://github.com/seatgeek/sixpack) A/B testing framework. 4 | 5 | ## Installation 6 | 7 | Include the "sixpack.js" script. The `sixpack` object will be added to your environment. In the browser do the following: 8 | 9 | ``` html 10 | 11 | ``` 12 | 13 | If you're using sixpack-client with node.js start by installing it with [npm](https://www.npmjs.com): 14 | 15 | ```sh 16 | npm install sixpack-client 17 | ``` 18 | 19 | then require the "sixpack-client" module: 20 | 21 | ``` javascript 22 | var sixpack = require('sixpack-client'); 23 | ``` 24 | 25 | ## Usage 26 | 27 | Check out the examples in the `examples` directory for some quick examples for how to use the library. Here's a very basic example in node: 28 | 29 | ```js 30 | var sixpack = require('sixpack-client'); 31 | 32 | var session = new sixpack.Session(); 33 | session.participate('test-exp', ['alt-one', 'alt-two'], function (err, res) { 34 | if (err) throw err; 35 | alt = res.alternative.name 36 | if (alt == 'alt-one') { 37 | console.log('default: ' + alt); 38 | } else { 39 | console.log(alt); 40 | } 41 | }); 42 | ``` 43 | 44 | When instantiating the session object you can pass optional params `client_id`, `base_url`, `ip_address`, `user_agent` 45 | 46 | ```js 47 | var sixpack = new sixpack.Session({ 48 | client_id: 12345, 49 | base_url: 'http://google.com/sixpack', 50 | ip_address: '1.2.2.1', 51 | user_agent: 'ChromeBot' 52 | }); 53 | ``` 54 | 55 | Client ID is a previously generated client id that you've previously stored. IP Address and User Agent are used for bot detection. 56 | 57 | ### Options 58 | 59 | A number of options can be passed to a sixpack `session`. A few are highlighted below. 60 | 61 | - `base_url`. Base URL of the sixpack-server. 62 | - `client_id`. ID of the specific client. 63 | - `ignore_alternates_warning`. Allow sixpack-js to send a `participate` request which contains no alternates. 64 | - `timeout`. Number of milliseconds to wait for a response from sixpack-server before returning a timeout response. 65 | 66 | ### Forcing an Alternative 67 | 68 | For debugging / design work it can be useful to force a page to load 69 | using a specific alternative. To force an alternative use the `force` 70 | parameter to `participate()`. If you're using sixpack.js in the 71 | browser you can also just include a query parameter, 72 | e.g. `/your-page?sixpack-force-EXPERIMENT_NAME=ALTERNATIVE_NAME`. 73 | 74 | ## Tests 75 | 76 | A number of _end-to-end_ tests are located in `./test/sixpack-test.js`. They use [mocha](https://mochajs.org) as the testing framework and [chai](http://chaijs.com) as the assertion library, and require a running [sixpack-server](https://github.com/seatgeek/sixpack#getting-started). 77 | 78 | Run the tests with: 79 | ```sh 80 | npm run test 81 | ``` 82 | 83 | ### Sixpack server location 84 | 85 | The tests assume the [sixpack-server](https://github.com/seatgeek/sixpack) server is running and located at `http://localhost:5000`. To use a different location, _e.g._ for a Docker [container](https://github.com/ainoya/docker-sixpack), run tests with the following pattern: 86 | ```sh 87 | SIXPACK_BASE_URL=http://docker:5000 npm run test 88 | ``` 89 | 90 | ## Contributing 91 | 92 | 1. Fork it 93 | 2. Create your feature branch (`git checkout -b my-new-feature`) 94 | 3. Write and run tests with `npm test` (see [Tests](#tests) above for more information) 95 | 4. Commit your changes (`git commit -am 'Added some feature'`) 96 | 5. Push to the branch (`git push -u origin my-new-feature`) 97 | 6. Create new pull request 98 | -------------------------------------------------------------------------------- /examples/browser/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 22 | 23 |

Sixpack

24 |

Response for participate:

25 |
26 |

Response for convert:

27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/node/basic.js: -------------------------------------------------------------------------------- 1 | var sixpack = require('../../'); 2 | 3 | var session = new sixpack.Session(); 4 | session.participate("test-exp", ["alt-one", "alt-two"], function (err, res) { 5 | if (err) return console.log(err); 6 | console.log(res); 7 | }); 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sixpack-client", 3 | "version": "2.1.0", 4 | "description": "JS client for SeatGeek's Sixpack AB testing framework.", 5 | "main": "sixpack.js", 6 | "scripts": { 7 | "test": "mocha" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git://github.com/seatgeek/sixpack-js.git" 12 | }, 13 | "author": "SeatGeek", 14 | "license": "MIT", 15 | "readmeFilename": "README.md", 16 | "gitHead": "442fafd22f38396e4cba7030cc18dbc93dd1d018", 17 | "devDependencies": { 18 | "mocha": "~8.1.1", 19 | "chai": "~4.2.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sixpack.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | // Object.assign polyfill from https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill 3 | Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"use strict";if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),t=1;ta;a++){var i=o[a],b=Object.getOwnPropertyDescriptor(n,i);void 0!==b&&b.enumerable&&(r[i]=n[i])}}}return r}}); 4 | 5 | var sixpack = { 6 | base_url: "http://localhost:5000", 7 | ip_address: null, 8 | user_agent: null, 9 | timeout: 1000, 10 | persist: true, 11 | cookie_name: "sixpack_client_id", 12 | cookie_domain: null, 13 | ignore_alternates_warning: null 14 | }; 15 | 16 | // check if on node, else expose on browser's global window object 17 | var on_node = false; 18 | if (typeof window === "undefined") { 19 | on_node = true; 20 | } else { 21 | window["sixpack"] = sixpack; 22 | } 23 | 24 | sixpack.generate_client_id = function () { 25 | // from http://stackoverflow.com/questions/105034 26 | var client_id = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { 27 | var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); 28 | return v.toString(16); 29 | }); 30 | if (!on_node && this.persist) { 31 | var cookie_value = this.cookie_name + "=" + client_id + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"; 32 | if (this.cookie_domain) { 33 | cookie_value += '; domain=' + this.cookie_domain; 34 | } 35 | document.cookie = cookie_value; 36 | } 37 | return client_id; 38 | }; 39 | 40 | sixpack.persisted_client_id = function() { 41 | // http://stackoverflow.com/questions/5639346/shortest-function-for-reading-a-cookie-in-javascript 42 | var result; 43 | return (result = new RegExp('(?:^|; )' + encodeURIComponent(this.cookie_name) + '=([^;]*)').exec(document.cookie)) ? (result[1]) : null; 44 | } 45 | 46 | sixpack.Session = function (options) { 47 | Object.assign(this, sixpack, options); 48 | 49 | if (!this.client_id) { 50 | if (this.persist && !on_node) { 51 | var persisted_id = this.persisted_client_id(); 52 | this.client_id = persisted_id !== null ? persisted_id : this.generate_client_id(); 53 | } else { 54 | this.client_id = this.generate_client_id(); 55 | } 56 | } 57 | if (!on_node) { 58 | this.user_agent = this.user_agent || (window && window.navigator && window.navigator.userAgent); 59 | } 60 | }; 61 | 62 | sixpack.Session.prototype = { 63 | participate: function(experiment_name, alternatives, traffic_fraction, force, callback) { 64 | if (typeof traffic_fraction === "function") { 65 | callback = traffic_fraction; 66 | traffic_fraction = null; 67 | force = null; 68 | } 69 | else if (typeof traffic_fraction === "string") { 70 | callback = force; 71 | force = traffic_fraction; 72 | traffic_fraction = null; 73 | } 74 | if (typeof force === "function") { 75 | callback = force; 76 | force = null; 77 | } 78 | 79 | if (!callback) { 80 | throw new Error("Callback is not specified"); 81 | } 82 | 83 | if (!experiment_name || !(/^[a-z0-9][a-z0-9\-_ ]*$/).test(experiment_name)) { 84 | return callback(new Error("Bad experiment_name")); 85 | } 86 | 87 | if (alternatives.length < 2 && this.ignore_alternates_warning !== true) { 88 | return callback(new Error("Must specify at least 2 alternatives")); 89 | } 90 | 91 | for (var i = 0; i < alternatives.length; i += 1) { 92 | if (!(/^[a-z0-9][a-z0-9\-_ ]*$/).test(alternatives[i])) { 93 | return callback(new Error("Bad alternative name: " + alternatives[i])); 94 | } 95 | } 96 | var params = {client_id: this.client_id, 97 | experiment: experiment_name, 98 | alternatives: alternatives}; 99 | if (!on_node && force == null) { 100 | var regex = new RegExp("[\\?&]sixpack-force-" + experiment_name + "=([^&#]*)"); 101 | var results = regex.exec(window.location.search); 102 | if(results != null) { 103 | force = decodeURIComponent(results[1].replace(/\+/g, " ")); 104 | } 105 | } 106 | if (traffic_fraction !== null && !isNaN(traffic_fraction)) { 107 | params.traffic_fraction = traffic_fraction; 108 | } 109 | if (force != null && _in_array(alternatives, force)) { 110 | return callback(null, {"status": "ok", "alternative": {"name": force}, "experiment": {"version": 0, "name": experiment_name}, "client_id": this.client_id}); 111 | } 112 | if (this.ip_address) { 113 | params.ip_address = this.ip_address; 114 | } 115 | if (this.user_agent) { 116 | params.user_agent = this.user_agent; 117 | } 118 | return _request(this.base_url + "/participate", params, this.timeout, function(err, res) { 119 | if (err) { 120 | res = {status: "failed", 121 | error: err, 122 | alternative: {name: alternatives[0]}}; 123 | } 124 | return callback(null, res); 125 | }); 126 | }, 127 | convert: function(experiment_name, kpi, callback) { 128 | if (typeof kpi === 'function') { 129 | callback = kpi; 130 | kpi = null; 131 | } 132 | 133 | if (!callback) { 134 | callback = function(err) { 135 | if (err && console && console.error) { 136 | console.error(err); 137 | } 138 | } 139 | } 140 | 141 | if (!experiment_name || !(/^[a-z0-9][a-z0-9\-_ ]*$/).test(experiment_name)) { 142 | return callback(new Error("Bad experiment_name")); 143 | } 144 | 145 | var params = {client_id: this.client_id, 146 | experiment: experiment_name}; 147 | if (this.ip_address) { 148 | params.ip_address = this.ip_address; 149 | } 150 | if (this.user_agent) { 151 | params.user_agent = this.user_agent; 152 | } 153 | if (kpi) { 154 | params.kpi = kpi; 155 | } 156 | return _request(this.base_url + "/convert", params, this.timeout, function(err, res) { 157 | if (err) { 158 | res = {status: "failed", 159 | error: err}; 160 | } 161 | return callback(null, res); 162 | }); 163 | } 164 | }; 165 | 166 | var counter = 0; 167 | 168 | var _request = function(uri, params, timeout, callback) { 169 | var timed_out = false; 170 | var timeout_handle = setTimeout(function () { 171 | timed_out = true; 172 | return callback(new Error("request timed out")); 173 | }, timeout); 174 | 175 | if (!on_node) { 176 | var cb = "callback" + (++counter); 177 | params.callback = "sixpack." + cb 178 | sixpack[cb] = function (res) { 179 | if (!timed_out) { 180 | clearTimeout(timeout_handle); 181 | return callback(null, res); 182 | } 183 | } 184 | } 185 | var url = _request_uri(uri, params); 186 | if (!on_node) { 187 | script = document.createElement('script'); 188 | script.type = 'text/javascript'; 189 | script.src = url; 190 | script.async = true; 191 | document.body.appendChild(script); 192 | } else { 193 | 194 | if (url.indexOf('https') === 0) { 195 | var http = require('https'); 196 | } else { 197 | var http = require('http'); 198 | } 199 | 200 | var req = http.get(url, function(res) { 201 | var body = ""; 202 | res.on('data', function(chunk) { 203 | return body += chunk; 204 | }); 205 | return res.on('end', function() { 206 | var data; 207 | if (res.statusCode == 500) { 208 | data = {status: "failed", response: body}; 209 | } else { 210 | data = JSON.parse(body); 211 | } 212 | if (!timed_out) { 213 | clearTimeout(timeout_handle); 214 | return callback(null, data); 215 | } 216 | }); 217 | }); 218 | req.on('error', function(err) { 219 | if (!timed_out) { 220 | clearTimeout(timeout_handle); 221 | return callback(err); 222 | } 223 | }); 224 | } 225 | }; 226 | 227 | var _request_uri = function(endpoint, params) { 228 | var query_string = []; 229 | var e = encodeURIComponent; 230 | for (var key in params) { 231 | if (params.hasOwnProperty(key)) { 232 | var vals = params[key]; 233 | if (Object.prototype.toString.call(vals) !== '[object Array]') { 234 | vals = [vals]; 235 | } 236 | for (var i = 0; i < vals.length; i += 1) { 237 | query_string.push(e(key) + '=' + e(vals[i])); 238 | } 239 | } 240 | } 241 | if (query_string.length) { 242 | endpoint += '?' + query_string.join('&'); 243 | } 244 | return endpoint; 245 | }; 246 | 247 | var _in_array = function(a, v) { 248 | for(var i = 0; i < a.length; i++) { 249 | if(a[i] === v) { 250 | return true; 251 | } 252 | } 253 | return false; 254 | }; 255 | 256 | // export module for node or environments with module loaders, such as webpack 257 | if (typeof module !== "undefined" && typeof require !== "undefined") { 258 | module.exports = sixpack; 259 | } 260 | })(); 261 | -------------------------------------------------------------------------------- /test/sixpack-test.js: -------------------------------------------------------------------------------- 1 | var mocha = require('mocha'); 2 | var assert = require('chai').assert; 3 | var expect = require('chai').expect; 4 | 5 | describe("Sixpack", function () { 6 | var sixpack; 7 | var session; 8 | 9 | beforeEach( () => { 10 | sixpack = require('../'); 11 | session = new sixpack.Session(); 12 | 13 | // Override default base_url when the SIXPACK_BASE_URL 14 | // environment variable is found. 15 | if (process.env.SIXPACK_BASE_URL) { 16 | session.base_url = process.env.SIXPACK_BASE_URL; 17 | } 18 | }); 19 | 20 | it("should return an alternative for participate", function (done) { 21 | session.participate("show-bieber", ["trolled", "not-trolled"], function(err, resp) { 22 | if (err) throw err; 23 | expect(resp.alternative.name).to.match(/trolled/); 24 | done(); 25 | }); 26 | }); 27 | 28 | it("should return ok for participate with traffic_fraction", function (done) { 29 | session.participate("show-bieber-fraction", ["trolled", "not-trolled"], 0.1, function(err, resp) { 30 | if (err) throw err; 31 | expect(resp.status).to.equal("ok"); 32 | done(); 33 | }); 34 | }); 35 | 36 | it("should return forced alternative for participate with force", function (done) { 37 | session.participate("show-bieber", ["trolled", "not-trolled"], "trolled", function(err, resp) { 38 | if (err) throw err; 39 | expect(resp.alternative.name).to.equal("trolled"); 40 | session.participate("show-bieber", ["trolled", "not-trolled"], "not-trolled", function(err, resp) { 41 | if (err) throw err; 42 | expect(resp.alternative.name).to.equal("not-trolled"); 43 | done(); 44 | }); 45 | }); 46 | }); 47 | 48 | it("should return ok and forced alternative for participate with traffic_fraction and force", function (done) { 49 | session.participate("show-bieber-fraction", ["trolled", "not-trolled"], 0.1, "trolled", function(err, resp) { 50 | if (err) throw err; 51 | expect(resp.status).to.equal("ok"); 52 | expect(resp.alternative.name).to.equal("trolled"); 53 | session.participate("show-bieber-fraction", ["trolled", "not-trolled"], 0.1, "not-trolled", function(err, resp) { 54 | if (err) throw err; 55 | expect(resp.status).to.equal("ok"); 56 | expect(resp.alternative.name).to.equal("not-trolled"); 57 | done(); 58 | }); 59 | }); 60 | }); 61 | 62 | it("should auto generate a client_id", function (done) { 63 | expect(session.client_id.length).to.equal(36); 64 | done(); 65 | }); 66 | 67 | it("should return ok for convert", function (done) { 68 | session.client_id = "mike"; 69 | session.participate("show-bieber", ["trolled", "not-trolled"], function(err, resp) { 70 | if (err) throw err; 71 | session.convert("show-bieber", function(err, resp) { 72 | if (err) throw err; 73 | expect(resp.status).to.equal("ok"); 74 | done(); 75 | }); 76 | }); 77 | }); 78 | 79 | it("should return ok for multiple converts", function (done) { 80 | session.client_id = "mike"; 81 | session.participate("show-bieber", ["trolled", "not-trolled"], function(err, alt) { 82 | if (err) throw err; 83 | session.convert("show-bieber", function(err, resp) { 84 | if (err) throw err; 85 | expect(resp.status).to.equal("ok"); 86 | session.convert("show-bieber", function(err, alt) { 87 | if (err) throw err; 88 | expect(resp.status).to.equal("ok"); 89 | done(); 90 | }); 91 | }); 92 | }); 93 | }); 94 | 95 | it("should not return ok for convert with new client_id", function (done) { 96 | session.client_id = "unknown_idizzle"; 97 | session.convert("show-bieber", function(err, resp) { 98 | if (err) throw err; 99 | expect(resp.status).to.equal("failed"); 100 | done(); 101 | }); 102 | }); 103 | 104 | it("should not return ok for convert with new experiment", function (done) { 105 | var sixpack = require('../'); 106 | var session = new sixpack.Session({client_id: "mike"}); 107 | session.convert("show-blieber", function(err, resp) { 108 | // TODO should this be an err? 109 | if (err) throw err; 110 | expect(resp.status).to.equal("failed"); 111 | done(); 112 | }); 113 | }); 114 | 115 | it("should return ok for convert with kpi", function (done) { 116 | session.client_id = "mike"; 117 | session.convert("show-bieber", "justin-shown", function(err, resp) { 118 | if (err) throw err; 119 | expect(resp.status).to.equal("ok"); 120 | done(); 121 | }); 122 | }); 123 | 124 | it("should not allow bad experiment names", function (done) { 125 | session.participate("%%", ["trolled", "not-trolled"], function(err, alt) { 126 | assert.equal(alt, null); 127 | expect(err).instanceof(Error); 128 | done(); 129 | }); 130 | }); 131 | 132 | it("should not allow bad alternative names", function (done) { 133 | session.participate("show-bieber", ["trolled"], function(err, alt) { 134 | assert.equal(alt, null); 135 | expect(err).instanceof(Error); 136 | 137 | session.participate("show-bieber", ["trolled", "%%"], function(err, alt) { 138 | assert.equal(alt, null); 139 | expect(err).instanceof(Error); 140 | done(); 141 | }); 142 | }); 143 | }); 144 | 145 | it("should work without using the simple methods", function (done) { 146 | session.convert("testing", function(err, res) { 147 | if (err) throw err; 148 | expect(res.status).equal("failed"); 149 | 150 | session.participate("testing", ["one", "two"], function(err, res) { 151 | if (err) throw err; 152 | var alt1 = res.alternative.name; 153 | var old_id = session.client_id; 154 | session.client_id = sixpack.generate_client_id(); 155 | 156 | session.convert("testing", function(err, res) { 157 | if (err) throw err; 158 | expect(res.status).equal("failed"); 159 | 160 | session.participate("testing", ["one", "two"], function(err, res) { 161 | if (err) throw err; 162 | session.client_id = old_id; 163 | 164 | session.participate("testing", ["one", "two"], function(err, res) { 165 | if (err) throw err; 166 | expect(res.alternative.name).to.equal(alt1); 167 | done(); 168 | }); 169 | }); 170 | }); 171 | }); 172 | }); 173 | }); 174 | 175 | it("should return an error when experiment_name is incorrect", function (done) { 176 | session.client_id = "mike"; 177 | session.participate(undefined, ["trolled", "not-trolled"], function(err, resp) { 178 | expect(err).to.be.an.instanceof(Error); 179 | expect(err.message).to.equal("Bad experiment_name"); 180 | 181 | session.convert(undefined, function(err, resp) { 182 | expect(err).to.be.an.instanceof(Error); 183 | expect(err.message).to.equal("Bad experiment_name"); 184 | done(); 185 | }); 186 | }); 187 | }); 188 | 189 | it("should throw an error when callback is undefined", function (done) { 190 | session.client_id = "mike"; 191 | expect(function() { 192 | session.participate("show-bieber", ["trolled", "not-trolled"]); 193 | }).to.throw( 194 | Error, /^Callback is not specified$/ 195 | ); 196 | 197 | done(); 198 | }); 199 | 200 | it("should not throw an error if the alternates warning is overridden", function (done) { 201 | session.ignore_alternates_warning = true; 202 | session.participate("testing", [], function(err, resp) { 203 | expect(err).to.be.null; 204 | done(); 205 | }); 206 | }); 207 | 208 | it("should throw an error if the alternates warning is not overridden", function (done) { 209 | session.participate("testing", [], function(err, resp) { 210 | expect(err.message).to.match(/^Must specify at least 2 alternatives$/); 211 | done(); 212 | }); 213 | }); 214 | }); 215 | --------------------------------------------------------------------------------