imdone-core 1.40.1 → 1.40.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/card.js CHANGED
@@ -3,6 +3,7 @@ const _path = require('path')
3
3
  const template = require('lodash.template')
4
4
  const _pick = require('lodash.pick')
5
5
  const _isFunction = require('lodash.isfunction')
6
+ const _isObject = require('lodash.isobject')
6
7
  const _isEmpty = require('lodash.isempty')
7
8
  const _get = require('lodash.get')
8
9
  const eol = require('eol')
@@ -194,6 +195,16 @@ module.exports = function newCard(task, _project, dontParse) {
194
195
  ...defaultData
195
196
  }
196
197
 
198
+ const keys = Object.keys(data)
199
+ keys.forEach((key) => {
200
+ const value = data[key]
201
+ if (_isObject(value) && !Array.isArray(value)) {
202
+
203
+ keys.push(...Object.keys(value).map((k) => `${key}.${k}`))
204
+ }
205
+ })
206
+ this.dataKeys = keys
207
+
197
208
  this.data = { ...data }
198
209
  this.desc = this.getDescriptionData()
199
210
  this.data = { ...data, ...this.desc }
@@ -244,9 +255,6 @@ module.exports = function newCard(task, _project, dontParse) {
244
255
  content = content.replace(opts.interpolate, `~~{{${e}}}~~`)
245
256
  }
246
257
  }
247
- // Fix list endings
248
- // const listEndingRegex = /(\n\s*([-+*]{1}|\d+.)\s.*[\n\r])([^1-9-+* \t])/gm
249
- // description = description.replace(listEndingRegex, '$1\n$3')
250
258
 
251
259
  return content
252
260
  }
package/lib/file.js CHANGED
@@ -166,10 +166,11 @@ File.parseDueDate = function (config, text) {
166
166
  if (dueString) return dueMatch
167
167
  try {
168
168
  const due = chrono.parseDate(dueMatch, new Date(), {forwardDate: true})
169
+ if (!due) return dueMatch
169
170
  dueString = moment(due).format()
170
171
  return `${p1.toLowerCase()}${config.getMetaSep()}${dueString}`
171
172
  } catch (e) {
172
- // console.log(`Unable to parse due date for ${text}`)
173
+ console.log(`Unable to parse due date for ${text}`)
173
174
  return dueMatch
174
175
  }
175
176
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-core",
3
- "version": "1.40.1",
3
+ "version": "1.40.2",
4
4
  "description": "imdone-core",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -81,7 +81,7 @@
81
81
  "lodash.isundefined": "^3.0.1",
82
82
  "lodash.noop": "^3.0.1",
83
83
  "lodash.omit": "^4.5.0",
84
- "lodash.pick": "^4.4.0",
84
+ "lodash.pick": "^3.1.0",
85
85
  "lodash.reject": "^4.6.0",
86
86
  "lodash.remove": "^4.7.0",
87
87
  "lodash.some": "^4.6.0",