UNPKG

jobsuche-api-js

Version:

A JavaScript wrapper for the Arbeitsagentur jobs API, allowing developers to easily integrate job search functionality into their applications.

20 lines (19 loc) 604 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addUUID = addUUID; const uuid_1 = require("uuid"); function addUUID(obj) { if (typeof obj !== 'object' || obj === null || Buffer.isBuffer(obj)) { return obj; } if (Array.isArray(obj)) { return obj.map(addUUID); } const newObj = Object.assign(Object.assign({}, obj), { uuid: (0, uuid_1.v4)() }); for (const key in newObj) { if (typeof newObj[key] === 'object' && newObj[key] !== null) { newObj[key] = addUUID(newObj[key]); } } return newObj; }