UNPKG

strapi-pfapi

Version:

a strapi plugin library uses local and redis caches to achieve single digit milliseconds on average api response time.

11 lines (10 loc) 308 B
'use strict'; module.exports = (data) => { if (data === undefined) { throw new Error('data is undefined'); } if (data === null) return 'null'; if (typeof data === 'string') return data; if (Buffer.isBuffer(data)) return data.toString('utf-8'); return JSON.stringify(data); };