saveRecording(recordingId, data) { /* Pass the data through the base persister's stringify method so the output will be consistent with the rest of the persisters. */ this.api.saveRecording(recordingId, parse(this.stringify(data))); }
jsonBody() { return parse(this.body); }
export function url(url, config, req) { let parsedUrl = parseUrl(url, true); if (isFunction(config)) { parsedUrl = parseUrl(config(url, req), true); } else { // Remove any url properties that have been disabled via the config keys(config || {}).forEach(key => { if (isFunction(config[key])) { parsedUrl.set(key, config[key](parsedUrl[key], req)); } else if (!config[key]) { parsedUrl.set(key, ''); } }); } // Sort Query Params if (isObjectLike(parsedUrl.query)) { parsedUrl.set('query', parse(stringify(parsedUrl.query))); } return parsedUrl.href; }
get db() { const items = this.localStorage.getItem(this.options.key); return items ? parse(items) : {}; }
/** * Compile a string to a template function for the path. * * @param {string} str * @param {Object=} options * @return {!function(Object=, Object=)} */ function compile (str, options) { return tokensToFunction(parse(str, options)) }
/** * Create a path regexp from string input. * * @param {string} path * @param {!Array} keys * @param {!Object} options * @return {!RegExp} */ function stringToRegexp (path, keys, options) { return tokensToRegExp(parse(path, options), keys, options) }
saveRecording(recordingId, data) { /* Pass the data through the base persister's stringify method so the output will be consistent with the rest of the persisters. */ this.api.saveRecording(recordingId, parse(this.stringify(data))); }
get db() { const items = this.localStorage.getItem(this.options.key); return items ? parse(items) : {}; }
jsonBody() { return parse(this.body); }
export function url(url, config, req) { let parsedUrl = parseUrl(url, true); if (isFunction(config)) { parsedUrl = parseUrl(config(url, req), true); } else { // Remove any url properties that have been disabled via the config keys(config || {}).forEach(key => { if (isFunction(config[key])) { parsedUrl.set(key, config[key](parsedUrl[key], req)); } else if (!config[key]) { parsedUrl.set(key, ''); } }); } // Sort Query Params if (isObjectLike(parsedUrl.query)) { parsedUrl.set('query', parse(stringify(parsedUrl.query))); } return parsedUrl.href; }
/** * Compile a string to a template function for the path. * * @param {string} str * @param {Object=} options * @return {!function(Object=, Object=)} */ function compile (str, options) { return tokensToFunction(parse(str, options)) }
/** * Create a path regexp from string input. * * @param {string} path * @param {Array=} keys * @param {Object=} options * @return {!RegExp} */ function stringToRegexp (path, keys, options) { return tokensToRegExp(parse(path, options), keys, options) }
/** * Compile a string to a template function for the path. * * @param {string} str * @param {Object=} options * @return {!function(Object=, Object=)} */ function compile (str, options) { return tokensToFunction(parse(str, options)) }