Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var extend = require('extend'),
param = require('querystring').stringify,
striptags = require('striptags');
if (typeof document !== 'undefined') {
var INBROWSER = true,
$ = require('jquery'),
ga = DJANGO_VARS.ga;
require('jquery.cookie');
} else {
var INBROWSER = false,
$ = require("cheerio"),
ga = function() {}; // Fail gracefully if we reach one of these methods server side
$.ajax = function() {}; // ditto
$.getJSON = function() {}; // ditto
}
var Sefaria = Sefaria || {
_dataLoaded: false,
toc: [],
books: [],
booksDict: {},
recentlyViewed: []
};
Sefaria = extend(Sefaria, {
_parseRef: {}, // cache for results of local ref parsing
parseRef: function(q) {
// Client side ref parsing without depending on book index data.