mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
12 lines
428 B
JavaScript
12 lines
428 B
JavaScript
export const normalizeProjection = options => {
|
|
// transform fields key in projection
|
|
const { fields, projection, ...otherOptions } = options || {};
|
|
// TODO: enable this comment when deprecating the fields option
|
|
// Log.debug(`fields option has been deprecated, please use the new 'projection' instead`)
|
|
|
|
return {
|
|
...otherOptions,
|
|
...(projection || fields ? { projection: fields || projection } : {}),
|
|
};
|
|
};
|