Skip to content

Commit ed065b7

Browse files
author
Dinesh
committed
review changes
1 parent 238e6b3 commit ed065b7

File tree

4 files changed

+1
-10
lines changed

4 files changed

+1
-10
lines changed

dist/util/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,13 @@ exports.groupItems = (items) => {
112112
* @param {Object} config - Application config
113113
*/
114114
exports.formatItems = (items, config) => {
115-
// const time = new Date().toISOString()
116115
for (let i = 0, j = items.length; i < j; i++) {
117116
switch (items[i].type) {
118117
case 'asset_published':
119118
delete items[i].type;
120119
items[i]._content_type_uid = formattedAssetType;
121120
items[i]._type = config.contentstack.actions.publish;
122121
// extra keys
123-
// items[i]._synced_at = time
124122
items[i] = lodash_1.merge(items[i], items[i].data);
125123
items[i].locale = items[i].data.publish_details.locale;
126124
break;
@@ -141,7 +139,6 @@ exports.formatItems = (items, config) => {
141139
items[i]._type = config.contentstack.actions.publish;
142140
items[i]._content_type_uid = items[i].content_type_uid;
143141
// extra keys
144-
// items[i]._synced_at = time
145142
items[i] = lodash_1.merge(items[i], items[i].data);
146143
items[i].locale = items[i].data.publish_details.locale;
147144
break;

src/util/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,13 @@ export const groupItems = (items) => {
134134
* @param {Object} config - Application config
135135
*/
136136
export const formatItems = (items, config) => {
137-
// const time = new Date().toISOString()
138137
for (let i = 0, j = items.length; i < j; i++) {
139138
switch (items[i].type) {
140139
case 'asset_published':
141140
delete items[i].type
142141
items[i]._content_type_uid = formattedAssetType
143142
items[i]._type = config.contentstack.actions.publish
144143
// extra keys
145-
// items[i]._synced_at = time
146144
items[i] = merge(items[i], items[i].data)
147145
items[i].locale = items[i].data.publish_details.locale
148146
break
@@ -163,7 +161,6 @@ export const formatItems = (items, config) => {
163161
items[i]._type = config.contentstack.actions.publish
164162
items[i]._content_type_uid = items[i].content_type_uid
165163
// extra keys
166-
// items[i]._synced_at = time
167164
items[i] = merge(items[i], items[i].data)
168165
items[i].locale = items[i].data.publish_details.locale
169166
break
@@ -478,6 +475,5 @@ export const getSchema = (action, data) => {
478475
schema._synced_at = data._synced_at
479476
schema.locale = data.locale
480477
}
481-
482478
return { schema }
483479
}

src/util/validations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ const assetPublishedStructure = (asset) => {
209209

210210
export const validatePlugin = (plugin) => {
211211
if (!plugin.name || typeof plugin.name !== 'string' || plugin.name.length < 1) {
212-
throw new Error("Invalid plugin config, 'plugin.name' is a required property!")
212+
throw new Error(`Invalid plugin config, 'plugin.name' is a required property!`)
213213
}
214214
}
215215

test/util/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ describe('core-utilities', () => {
5555
const formattedItem = formatItems(items, configs)[0]
5656
expect(formattedItem).toHaveProperty('_content_type_uid')
5757
// expect(formattedItem).not.toHaveProperty('content_type_uid')
58-
// expect(formattedItem).not.toHaveProperty('_synced_at')
5958
expect(formattedItem).toHaveProperty('action')
6059
})
6160

@@ -76,7 +75,6 @@ describe('core-utilities', () => {
7675
const formattedItem = formatItems(items, configs)[0]
7776
expect(formattedItem).toHaveProperty('_content_type_uid')
7877
// expect(formattedItem).not.toHaveProperty('content_type_uid')
79-
// expect(formattedItem).not.toHaveProperty('_synced_at')
8078
expect(formattedItem).toHaveProperty('action')
8179
})
8280

0 commit comments

Comments
 (0)