Skip to content

Commit 7edc043

Browse files
fixed issue with unexpected object conversion (#20)
1 parent c941659 commit 7edc043

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

CHANGELOG.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to the "@qavajs/memory" will be documented in this file.
44

55
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
66

7+
## [1.6.1]
8+
- :beetle: fixed issue with unexpected object conversion
9+
710
## [1.6.0]
811
- :rocket: added capability to provide logger
912

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qavajs/memory",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"description": "memory package for @qavajs framework",
55
"main": "index.js",
66
"scripts": {

src/memory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Memory {
4141
if (typeof str !== 'string') return str;
4242
value = str.replace(ESCAPE_DOLLAR_REGEXP, QAVA_ESCAPE_DOLLAR);
4343
if (KEY_REGEXP.test(value)) value = this.getKey(value);
44-
if (PARSE_STRING_REGEXP.test(value)) value = this.getString(value);
44+
else if (PARSE_STRING_REGEXP.test(value)) value = this.getString(value);
4545
if (typeof value === 'string') value = value.replace(UNESCAPE_DOLLAR_REGEXP, '$');
4646
this.logger.log(`${str} -> ${toString(value)}`);
4747
return value;

tests/memory.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@ test('non string input', () => {
292292
expect(memory.getValue(42)).to.equal(42);
293293
});
294294

295+
test('empty object conversion', () => {
296+
memory.setValue('key', {});
297+
expect(memory.getValue('$key')).to.deep.equal({});
298+
});
299+
295300

296301

297302

0 commit comments

Comments
 (0)