threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324
  1. /*
  2. * Author: Axel Antoine
  3. * mail: ax.antoine@gmail.com
  4. * website: http://axantoine.com
  5. * Created on Wed Dec 14 2022
  6. *
  7. * Loki, Inria project-team with Université de Lille
  8. * within the Joint Research Unit UMR 9189
  9. * CNRS - Centrale Lille - Université de Lille, CRIStAL
  10. * https://loki.lille.inria.fr
  11. *
  12. * Licence: Licence.md
  13. */
  14. export function mergeOptions (target: any, source: any) {
  15. // Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties
  16. for (const key of Object.keys(source)) {
  17. if (source[key] instanceof Object) Object.assign(source[key], mergeOptions(target[key], source[key]))
  18. }
  19. // Join `target` and modified `source`
  20. Object.assign(target || {}, source)
  21. return target
  22. }