Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use object shorthand for properties #363

Merged
merged 1 commit into from
Apr 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions benchmarks/alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ function handleAlert (alertInfo, sev) {
}

module.exports = {
handleAlert: handleAlert,
setupAlertSystem: setupAlertSystem,
severity: severity,
action: action
handleAlert,
setupAlertSystem,
severity,
action
}
14 changes: 7 additions & 7 deletions benchmarks/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ function reportFinal (argv, print) {
}

module.exports = {
start: start,
stop: stop,
iteration: iteration,
interval: interval,
printHistogram: printHistogram,
reportFinal: reportFinal,
parseTimeToSecs: parseTimeToSecs
start,
stop,
iteration,
interval,
printHistogram,
reportFinal,
parseTimeToSecs
}
2 changes: 1 addition & 1 deletion benchmarks/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function run (options) {
var k = keygen(options.keyRange.min, options.keyRange.max)
var key = { ns: options.namespace, set: options.set, key: k }
var record = recordgen(k, options.binSpec)
var ops = { key: key, record: record }
var ops = { key, record }
if (writeOps > 0) {
writeOps--
if (usePromises) {
Expand Down
2 changes: 1 addition & 1 deletion examples/geospatialMonteCarlo.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ shared.runner()

async function monteCarlo (client, argv) {
const game = {
client: client,
client,
noDarts: argv.darts, // number of darts to throw
maxInFlight: argv.maxInFlight,
maxLatLng: 10, // pick coordinates between (-10, -10) and (10, 10)
Expand Down
6 changes: 3 additions & 3 deletions lib/event_loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function setCommandQueuePolicy (policy) {
}

module.exports = {
releaseEventLoop: releaseEventLoop,
registerASEventLoop: registerASEventLoop,
setCommandQueuePolicy: setCommandQueuePolicy
releaseEventLoop,
registerASEventLoop,
setCommandQueuePolicy
}
4 changes: 2 additions & 2 deletions lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class EqualPredicate extends SindexFilterPredicate {
class RangePredicate extends SindexFilterPredicate {
constructor (bin, min, max, dataType, indexType) {
super(as.predicates.RANGE, bin, dataType, indexType, {
min: min,
max: max
min,
max
})
}
}
Expand Down
8 changes: 4 additions & 4 deletions lib/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ function splitBins (str) {
}
})
return {
stats: stats,
names: names
stats,
names
}
}

module.exports = {
parse: parse,
separators: separators
parse,
separators
}
114 changes: 57 additions & 57 deletions lib/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ exports.returnType = as.lists.returnType
*/
exports.setOrder = function (bin, order) {
return new ListOperation(opcodes.LIST_SET_ORDER, bin, {
order: order
order
})
}

Expand All @@ -290,7 +290,7 @@ exports.setOrder = function (bin, order) {
*/
exports.sort = function (bin, flags) {
return new ListOperation(opcodes.LIST_SORT, bin, {
flags: flags
flags
})
}

Expand Down Expand Up @@ -330,8 +330,8 @@ exports.sort = function (bin, flags) {
*/
exports.append = function (bin, value, policy) {
return new ListOperation(opcodes.LIST_APPEND, bin, {
value: value,
policy: policy
value,
policy
})
}

Expand Down Expand Up @@ -371,8 +371,8 @@ exports.append = function (bin, value, policy) {
*/
exports.appendItems = function (bin, list, policy) {
return new ListOperation(opcodes.LIST_APPEND_ITEMS, bin, {
list: list,
policy: policy
list,
policy
})
}

Expand Down Expand Up @@ -413,9 +413,9 @@ exports.appendItems = function (bin, list, policy) {
*/
exports.insert = function (bin, index, value, policy) {
return new ListOperation(opcodes.LIST_INSERT, bin, {
index: index,
value: value,
policy: policy
index,
value,
policy
})
}

Expand Down Expand Up @@ -455,9 +455,9 @@ exports.insert = function (bin, index, value, policy) {
*/
exports.insertItems = function (bin, index, list, policy) {
return new ListOperation(opcodes.LIST_INSERT_ITEMS, bin, {
index: index,
list: list,
policy: policy
index,
list,
policy
})
}

Expand Down Expand Up @@ -663,8 +663,8 @@ exports.removeRange = function (bin, index, count) {
*/
exports.removeByIndex = function (bin, index, returnType) {
return new ListOperation(opcodes.LIST_REMOVE_BY_INDEX, bin, {
index: index,
returnType: returnType
index,
returnType
})
}

Expand All @@ -691,9 +691,9 @@ exports.removeByIndex = function (bin, index, returnType) {
*/
exports.removeByIndexRange = function (bin, index, count, returnType) {
return new InvertibleListOp(opcodes.LIST_REMOVE_BY_INDEX_RANGE, bin, {
index: index,
count: count,
returnType: returnType
index,
count,
returnType
})
}

Expand All @@ -718,8 +718,8 @@ exports.removeByIndexRange = function (bin, index, count, returnType) {
*/
exports.removeByValue = function (bin, value, returnType) {
return new InvertibleListOp(opcodes.LIST_REMOVE_BY_VALUE, bin, {
value: value,
returnType: returnType
value,
returnType
})
}

Expand All @@ -744,8 +744,8 @@ exports.removeByValue = function (bin, value, returnType) {
*/
exports.removeByValueList = function (bin, values, returnType) {
return new InvertibleListOp(opcodes.LIST_REMOVE_BY_VALUE_LIST, bin, {
values: values,
returnType: returnType
values,
returnType
})
}

Expand Down Expand Up @@ -775,9 +775,9 @@ exports.removeByValueList = function (bin, values, returnType) {
*/
exports.removeByValueRange = function (bin, begin, end, returnType) {
return new InvertibleListOp(opcodes.LIST_REMOVE_BY_VALUE_RANGE, bin, {
begin: begin,
end: end,
returnType: returnType
begin,
end,
returnType
})
}

Expand Down Expand Up @@ -844,10 +844,10 @@ exports.removeByValueRange = function (bin, begin, end, returnType) {
*/
exports.removeByValueRelRankRange = function (bin, value, rank, count, returnType) {
return new InvertibleListOp(opcodes.LIST_REMOVE_BY_VALUE_REL_RANK_RANGE, bin, {
value: value,
rank: rank,
count: count,
returnType: returnType
value,
rank,
count,
returnType
})
}

Expand All @@ -872,8 +872,8 @@ exports.removeByValueRelRankRange = function (bin, value, rank, count, returnTyp
*/
exports.removeByRank = function (bin, rank, returnType) {
return new ListOperation(opcodes.LIST_REMOVE_BY_RANK, bin, {
rank: rank,
returnType: returnType
rank,
returnType
})
}

Expand All @@ -900,9 +900,9 @@ exports.removeByRank = function (bin, rank, returnType) {
*/
exports.removeByRankRange = function (bin, rank, count, returnType) {
return new InvertibleListOp(opcodes.LIST_REMOVE_BY_RANK_RANGE, bin, {
rank: rank,
count: count,
returnType: returnType
rank,
count,
returnType
})
}

Expand Down Expand Up @@ -1138,8 +1138,8 @@ exports.getRange = function (bin, index, count) {
*/
exports.getByIndex = function (bin, index, returnType) {
return new ListOperation(opcodes.LIST_GET_BY_INDEX, bin, {
index: index,
returnType: returnType
index,
returnType
})
}

Expand All @@ -1166,9 +1166,9 @@ exports.getByIndex = function (bin, index, returnType) {
*/
exports.getByIndexRange = function (bin, index, count, returnType) {
return new InvertibleListOp(opcodes.LIST_GET_BY_INDEX_RANGE, bin, {
index: index,
count: count,
returnType: returnType
index,
count,
returnType
})
}

Expand All @@ -1193,8 +1193,8 @@ exports.getByIndexRange = function (bin, index, count, returnType) {
*/
exports.getByValue = function (bin, value, returnType) {
return new InvertibleListOp(opcodes.LIST_GET_BY_VALUE, bin, {
value: value,
returnType: returnType
value,
returnType
})
}

Expand All @@ -1219,8 +1219,8 @@ exports.getByValue = function (bin, value, returnType) {
*/
exports.getByValueList = function (bin, values, returnType) {
return new InvertibleListOp(opcodes.LIST_GET_BY_VALUE_LIST, bin, {
values: values,
returnType: returnType
values,
returnType
})
}

Expand Down Expand Up @@ -1250,9 +1250,9 @@ exports.getByValueList = function (bin, values, returnType) {
*/
exports.getByValueRange = function (bin, begin, end, returnType) {
return new InvertibleListOp(opcodes.LIST_GET_BY_VALUE_RANGE, bin, {
begin: begin,
end: end,
returnType: returnType
begin,
end,
returnType
})
}

Expand Down Expand Up @@ -1318,10 +1318,10 @@ exports.getByValueRange = function (bin, begin, end, returnType) {
*/
exports.getByValueRelRankRange = function (bin, value, rank, count, returnType) {
return new InvertibleListOp(opcodes.LIST_GET_BY_VALUE_REL_RANK_RANGE, bin, {
value: value,
rank: rank,
count: count,
returnType: returnType
value,
rank,
count,
returnType
})
}

Expand All @@ -1346,8 +1346,8 @@ exports.getByValueRelRankRange = function (bin, value, rank, count, returnType)
*/
exports.getByRank = function (bin, rank, returnType) {
return new ListOperation(opcodes.LIST_GET_BY_RANK, bin, {
rank: rank,
returnType: returnType
rank,
returnType
})
}

Expand All @@ -1374,9 +1374,9 @@ exports.getByRank = function (bin, rank, returnType) {
*/
exports.getByRankRange = function (bin, rank, count, returnType) {
return new InvertibleListOp(opcodes.LIST_GET_BY_RANK_RANGE, bin, {
rank: rank,
count: count,
returnType: returnType
rank,
count,
returnType
})
}

Expand Down Expand Up @@ -1420,9 +1420,9 @@ exports.getByRankRange = function (bin, rank, count, returnType) {
*/
exports.increment = function (bin, index, value, policy) {
return new ListOperation(opcodes.LIST_INCREMENT, bin, {
index: index,
value: value,
policy: policy
index,
value,
policy
})
}

Expand Down
Loading