UNPKG

tia

Version:

Time is All (logs driven test engine with ExtJs support)

26 lines (19 loc) 574 B
'use strict'; const { t, a, l } = gT; t.setTitle('Tests for invertObj function'); const uniqueObj = { key1: 'value1', key2: 'value2', }; const notUniqueObj = { key1: 'value1', key2: 'value2', key3: 'value2', key4: 'value3', }; l.println('\nUnique values: '); const invertedUniqueObjs = gT.commonMiscUtils.invertMapObj(uniqueObj); l.println(JSON.stringify(invertedUniqueObjs, null, 2)); l.println('Non unique values: '); const invertedNotUniqueObjs = gT.commonMiscUtils.invertMapObj(notUniqueObj); l.println(JSON.stringify(invertedNotUniqueObjs, null, 2));