cookie-cutter icon indicating copy to clipboard operation
cookie-cutter copied to clipboard

The config's parse function returns an object with no enumerable properties.

Open plameniv opened this issue 4 years ago • 1 comments

The config object returned by the parse function has no enumerable properties.

The following operations do not work:

  • console.log(config) prints the empty object;
  • const newConfig = { ...config } creates an empty object;
  • Object.keys(config) and Object.getOwnPropertyNames(config) don't return any values.

When the property is manually defined in the following manner, the converter functions stop working, i.e. 1m is not converted to 60 (seconds):

Object.defineProperty(target, key, {
     enumerable: true,
     writable: true,
     value: source[key],
});
target.__assignedProperties.add(key);

plameniv avatar Apr 20 '20 19:04 plameniv

https://github.com/walmartlabs/cookie-cutter/pull/69 addressed symptoms of this bug.

Once the bug is fixed, some of the changes in that PR may be reverted.

plameniv avatar Apr 21 '20 19:04 plameniv