const moveData = (migration, left, tableName, near, far, _pluralize) => migration ? `db.collection('${_pluralize(left.listKey)}').find({}).forEach(function(doc){ (doc.${ left.path } || []).forEach(function(itemId) { db.${_pluralize( tableName )}.insert({ ${near}: doc._id, ${far}: itemId }) } ) });` : ` * Create a collection ${c(_pluralize(tableName))} with fields ${c(near)} and ${c( far )}\n * Move the data from ${c(`${_pluralize(left.listKey)}.${left.path}`)} into ${c( _pluralize(tableName) )}`
function() { var v0 = new THREE.Vector3(); var v1 = new THREE.Vector3(); return function () { v0.subVectors( this.c, this.b ); v1.subVectors( this.a, this.b ); return v0.cross( v1 ).length() * 0.5; }; }()
test_process_response( '/response-code-200', undefined, '200-die', assert, function(d, r, n, c) { r.statusCode === 200 ? c('200-die') : n(d); } );
test('supports bracket notation with further nesting', async ({ is }) => { const stream = sink() const instance = pino({ redact: ['a["b.b"].c'] }, stream) const obj = { a: { 'b.b': { c: 'd' } } } instance.info(obj) const o = await once(stream, 'data') is(o.a['b.b'].c, '[Redacted]') })
/* If a non-user is viewing a community page, they should only see threads from public channels. We use this function to return an array of channelIds that are public, and pass them into a getThreads function */ // prettier-ignore const getPublicChannelsByCommunity = (communityId: string): Promise<Array<string>> => { return channelsByCommunitiesQuery(communityId) .filter({ isPrivate: false }) .filter(row => row.hasFields('archivedAt').not()) .map(c => c('id')) .run(); }
function color(text, pad, value, green, red) { let c; if (value <= green) c = kleur.green().bold; else if (value >= red) c = kleur.red().bold; else c = kleur.yellow().bold; return c(padStart(text, pad)); }
// Mongoose operations const deleteField = (migration, field, _pluralize) => migration ? `db.collection('${_pluralize(field.listKey)}').updateMany({}, { $unset: { "${ field.path }": 1 } })` : ` * Delete ${c(`${_pluralize(field.listKey)}.${field.path}`)}`
const dropColumn = (migration, tableName, columnName, schemaName) => migration ? `ALTER TABLE ${schemaName}."${tableName}" DROP COLUMN "${columnName}";` : ` * Delete column ${c(`${tableName}.${columnName}`)}`
const moveData = (migration, left, tableName, near, far, _pluralize) => migration ? `db.collection('${_pluralize(left.listKey)}').find({}).forEach(function(doc){ (doc.${ left.path } || []).forEach(function(itemId) { db.${_pluralize( tableName )}.insert({ ${near}: doc._id, ${far}: itemId }) } ) });` : ` * Create a collection ${c(_pluralize(tableName))} with fields ${c(near)} and ${c( far )}\n * Move the data from ${c(`${_pluralize(left.listKey)}.${left.path}`)} into ${c( _pluralize(tableName) )}`
test('supports bracket notation with empty string as path segment', async ({ is }) => { const stream = sink() const instance = pino({ redact: ['a[""].c'] }, stream) const obj = { a: { '': { c: 'd' } } } instance.info(obj) const o = await once(stream, 'data') is(o.a[''].c, '[Redacted]') })
// Mongoose operations const deleteField = (migration, field, _pluralize) => migration ? `db.collection('${_pluralize(field.listKey)}').updateMany({}, { $unset: { "${ field.path }": 1 } })` : ` * Delete ${c(`${_pluralize(field.listKey)}.${field.path}`)}`
function() { var v0 = new THREE.Vector3(); var v1 = new THREE.Vector3(); return function () { v0.subVectors( this.c, this.b ); v1.subVectors( this.a, this.b ); return v0.cross( v1 ).length() * 0.5; }; }()