版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
689 B

  1. 'use strict';
  2. const icon_defaults = require('./defaults.cjs');
  3. const icon_transformations = require('./transformations.cjs');
  4. function mergeIconData(parent, child) {
  5. const result = icon_transformations.mergeIconTransformations(parent, child);
  6. for (const key in icon_defaults.defaultExtendedIconProps) {
  7. if (key in icon_defaults.defaultIconTransformations) {
  8. if (key in parent && !(key in result)) {
  9. result[key] = icon_defaults.defaultIconTransformations[key];
  10. }
  11. } else if (key in child) {
  12. result[key] = child[key];
  13. } else if (key in parent) {
  14. result[key] = parent[key];
  15. }
  16. }
  17. return result;
  18. }
  19. exports.mergeIconData = mergeIconData;