API Docs for: 0.0.8
Show:

File: client/lib/object.js

  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. /**
  5. * Helper functions for working with Objects
  6. *
  7. * @class Object
  8. * @static
  9. */
  10. define([], function () {
  11. 'use strict';
  12. /**
  13. * Extend an object with properties of one or more objects.
  14. * @method extend
  15. * @param {Object} target
  16. * Target object
  17. */
  18. function extend(target/*, ...*/) {
  19. var sources = [].slice.call(arguments, 1);
  20. for (var index = 0, source; source = sources[index]; ++index) {
  21. for (var key in source) {
  22. target[key] = source[key];
  23. }
  24. }
  25. return target;
  26. }
  27. return {
  28. extend: extend
  29. };
  30. });