mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
chore: eslint object-curly-newline
This commit is contained in:
committed by
Julian Lam
parent
62869bae3d
commit
8d1462ffd8
@@ -54,8 +54,7 @@
|
|||||||
"no-use-before-define": ["error", "nofunc"],
|
"no-use-before-define": ["error", "nofunc"],
|
||||||
// require consistent newlines before and after braces
|
// require consistent newlines before and after braces
|
||||||
// if contents are multiline
|
// if contents are multiline
|
||||||
// "object-curly-newline": ["error", { "consistent": true, "multiline": true }],
|
"object-curly-newline": ["error", { "consistent": true, "multiline": true }],
|
||||||
"object-curly-newline": "off",
|
|
||||||
// require consistent linebreaks inline function parenthesis (arguments or params)
|
// require consistent linebreaks inline function parenthesis (arguments or params)
|
||||||
"function-paren-newline": ["error", "consistent"],
|
"function-paren-newline": ["error", "consistent"],
|
||||||
// only require const if all parts of destructuring can be const
|
// only require const if all parts of destructuring can be const
|
||||||
|
|||||||
@@ -233,13 +233,15 @@ async function parseAboutMe(userData) {
|
|||||||
function filterLinks(links, states) {
|
function filterLinks(links, states) {
|
||||||
return links.filter((link, index) => {
|
return links.filter((link, index) => {
|
||||||
// Default visibility
|
// Default visibility
|
||||||
link.visibility = { self: true,
|
link.visibility = {
|
||||||
|
self: true,
|
||||||
other: true,
|
other: true,
|
||||||
moderator: true,
|
moderator: true,
|
||||||
globalMod: true,
|
globalMod: true,
|
||||||
admin: true,
|
admin: true,
|
||||||
canViewInfo: true,
|
canViewInfo: true,
|
||||||
...link.visibility };
|
...link.visibility,
|
||||||
|
};
|
||||||
|
|
||||||
const permit = Object.keys(states).some(state => states[state] && link.visibility[state]);
|
const permit = Object.keys(states).some(state => states[state] && link.visibility[state]);
|
||||||
|
|
||||||
|
|||||||
@@ -17,28 +17,36 @@ module.exports.handle = function (req, res, next) {
|
|||||||
function generateXML() {
|
function generateXML() {
|
||||||
return xml([{
|
return xml([{
|
||||||
OpenSearchDescription: [
|
OpenSearchDescription: [
|
||||||
{ _attr: {
|
{
|
||||||
xmlns: 'http://a9.com/-/spec/opensearch/1.1/',
|
_attr: {
|
||||||
'xmlns:moz': 'http://www.mozilla.org/2006/browser/search/',
|
xmlns: 'http://a9.com/-/spec/opensearch/1.1/',
|
||||||
} },
|
'xmlns:moz': 'http://www.mozilla.org/2006/browser/search/',
|
||||||
|
},
|
||||||
|
},
|
||||||
{ ShortName: trimToLength(String(meta.config.title || meta.config.browserTitle || 'NodeBB'), 16) },
|
{ ShortName: trimToLength(String(meta.config.title || meta.config.browserTitle || 'NodeBB'), 16) },
|
||||||
{ Description: trimToLength(String(meta.config.description || ''), 1024) },
|
{ Description: trimToLength(String(meta.config.description || ''), 1024) },
|
||||||
{ InputEncoding: 'UTF-8' },
|
{ InputEncoding: 'UTF-8' },
|
||||||
{ Image: [
|
{
|
||||||
{ _attr: {
|
Image: [
|
||||||
width: '16',
|
{
|
||||||
height: '16',
|
_attr: {
|
||||||
type: 'image/x-icon',
|
width: '16',
|
||||||
} },
|
height: '16',
|
||||||
`${nconf.get('url')}/favicon.ico`,
|
type: 'image/x-icon',
|
||||||
] },
|
},
|
||||||
{ Url: {
|
},
|
||||||
_attr: {
|
`${nconf.get('url')}/favicon.ico`,
|
||||||
type: 'text/html',
|
],
|
||||||
method: 'get',
|
},
|
||||||
template: `${nconf.get('url')}/search?term={searchTerms}&in=titlesposts`,
|
{
|
||||||
|
Url: {
|
||||||
|
_attr: {
|
||||||
|
type: 'text/html',
|
||||||
|
method: 'get',
|
||||||
|
template: `${nconf.get('url')}/search?term={searchTerms}&in=titlesposts`,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} },
|
},
|
||||||
{ 'moz:SearchForm': `${nconf.get('url')}/search` },
|
{ 'moz:SearchForm': `${nconf.get('url')}/search` },
|
||||||
],
|
],
|
||||||
}], { declaration: true, indent: '\t' });
|
}], { declaration: true, indent: '\t' });
|
||||||
|
|||||||
@@ -39,11 +39,13 @@ module.exports = function (module) {
|
|||||||
const bulk = module.client.collection('objects').initializeUnorderedBulkOp();
|
const bulk = module.client.collection('objects').initializeUnorderedBulkOp();
|
||||||
|
|
||||||
for (let i = 0; i < keys.length; i += 1) {
|
for (let i = 0; i < keys.length; i += 1) {
|
||||||
bulk.find({ _key: keys[i] }).upsert().updateOne({ $addToSet: {
|
bulk.find({ _key: keys[i] }).upsert().updateOne({
|
||||||
members: {
|
$addToSet: {
|
||||||
$each: value,
|
members: {
|
||||||
|
$each: value,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} });
|
});
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await bulk.execute();
|
await bulk.execute();
|
||||||
|
|||||||
Reference in New Issue
Block a user