HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/node_modules/apollo-utilities/src/util/stripSymbols.ts
/**
 * In order to make assertions easier, this function strips `symbol`'s from
 * the incoming data.
 *
 * This can be handy when running tests against `apollo-client` for example,
 * since it adds `symbol`'s to the data in the store. Jest's `toEqual`
 * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437),
 * which means all test data used in a `toEqual` comparison would also have to
 * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data
 * we can compare against more simplified test data.
 */
export function stripSymbols<T>(data: T): T {
  return JSON.parse(JSON.stringify(data));
}