UNPKG

raptor

Version:

RaptorJS provides an AMD module loader that works in Node, Rhino and the web browser. It also includes various sub-modules to support building optimized web applications.

21 lines (18 loc) 716 B
define('raptor/cookies', function(require, exports, module) { "use strict"; var CookieManager = require('raptor/cookies/CookieManager'), CONTEXT_KEY = 'raptor/cookies/CookieManager'; return { getCookieManager: function(context, options) { if (!context) { throw new Error('"context" is a required argument'); } var attributes = context.attributes; var cookieManager = attributes[CONTEXT_KEY]; if (!cookieManager) { cookieManager = attributes[CONTEXT_KEY] = new CookieManager(attributes.raptorContext || context, options); } return cookieManager; } }; });