From 634873409f453099ecee8a6fec84fb3ee7907c51 Mon Sep 17 00:00:00 2001 From: Ciaran Welch Date: Wed, 26 Jun 2024 11:17:39 +1000 Subject: [PATCH] revert(lodash): revert switching to native version of defaults Accidental commit --- imports/infoitem.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/imports/infoitem.js b/imports/infoitem.js index 5e8660b35..99551021b 100644 --- a/imports/infoitem.js +++ b/imports/infoitem.js @@ -1,15 +1,15 @@ /** * A InfoItem is a sub-element of - * a topic which has a subject, + * a topic which has a subject,> * a date when is was created * and a list of associated tags. */ -import { User } from "/imports/user"; +import { _ } from "lodash"; import { Meteor } from "meteor/meteor"; import { Random } from "meteor/random"; - -import { formatDateISO8601 } from "./helpers/date"; -import { StringUtils } from "./helpers/string-utils"; +import { formatDateISO8601 } from "./helpers/date.js"; +import { StringUtils } from "./helpers/string-utils.js"; +import { User } from "./user.js"; /** * The InfoItem class represents an information item in a topic. @@ -48,13 +48,12 @@ export class InfoItem { if (!Object.prototype.hasOwnProperty.call(source, "createdInMinute")) { throw new Meteor.Error("Property createdInMinute of topicDoc required"); } - const defaultValues = { + _.defaults(source, { itemType: "infoItem", isNew: true, isSticky: false, labels: [], - }; - this._infoItemDoc = Object.assign({}, defaultValues, source); + }); this._infoItemDoc = source; }