flow( getLastRouteAction, ( x ) => x.path, pathToSection, getContextResults, ( x = [] ) => x )
/** * Remove referrering domain from spam * * @param {string} domain - domain * @param {Function} fn - callback function * @returns {Function} request handler */ statsReferrersSpamDelete( domain, fn ) { const path = `${ this.path }/stats/referrers/spam/delete`; return this.wpcom.req.post( path, { domain }, null, fn ); }
/** * Update site-settings * * @param {object} [query] - query object parameter * @param {object} body - body object parameter * @param {Function} fn - callback function * @returns {Function} request handler */ update( query, body, fn ) { return this.wpcom.req.put( this.path, query, body, fn ); }
list.forEach(function(item) { var url = item.isHttps ? item.path : item.url.replace(/\?.*$/, '').substring(0, 1024); if (urlList.indexOf(url) === -1) { urlList.push(url); } });
async function processAndRecur (html, opts, savedApps, mappings) { if (R.is(String, html)) { html = scriptData.parse(html); } const processedApps = appList.extract(mappings.apps, html); const apps = opts.fullDetail ? await processFullDetailApps(processedApps, opts) : processedApps; const token = R.path(mappings.token, html); return checkFinished(opts, [...savedApps, ...apps], token); }
// TODO: the path field should be a schema field instead test('set collection template with config', async () => { const api = await createPlugin('/', { templates: { Post: '/blog/:id' } }) const collection = api.store.addCollection('Post') const node = collection.addNode({ id: '1' }) expect(node.path).toEqual('/blog/1/') })
test('get page by path', async () => { const { errors, data } = await runQuery(` query { page(path:"/page-one") { path } } `) expect(errors).toBeUndefined() expect(data.page.path).toEqual('/page-one/') })
addToTableSchema(table) { const column = table.jsonb(this.path); if (this.isNotNullable) column.notNullable(); if (this.defaultTo) column.defaultTo(this.defaultTo); }
/** * Get post url path * * @returns {string} post path */ getPostPath() { return `${ this.path }/${ this._id }`; }
// Component const Logo = (props) => { const { ...others } = props return ( <Link to={home.home.path} {...others}> <span style={{ fontFamily: secondary, fontSize: '2em', color: 'white', textShadow: textLevel1 }}>Crate</span> </Link> ) }
orderingConditions(dbPath, f = identity) { return { [`${this.path}_lt`]: value => b => b.where(dbPath, '<', f(value)), [`${this.path}_lte`]: value => b => b.where(dbPath, '<=', f(value)), [`${this.path}_gt`]: value => b => b.where(dbPath, '>', f(value)), [`${this.path}_gte`]: value => b => b.where(dbPath, '>=', f(value)), }; }
test('get page by path', async () => { const { errors, data } = await runQuery(` query { page(path:"/page-one") { path } } `) expect(errors).toBeUndefined() expect(data.page.path).toEqual('/page-one/') })