cookie-cutter
cookie-cutter copied to clipboard
The config's parse function returns an object with no enumerable properties.
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)
andObject.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);
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.