a zip code crypto-currency system good for red ONLY

clone.js 772B

12345678910111213141516171819202122232425262728293031323334
  1. var wrapSingle = require('../wrap-for-optimizing').single;
  2. var Token = require('../../tokenizer/token');
  3. function deep(property) {
  4. var cloned = shallow(property);
  5. for (var i = property.components.length - 1; i >= 0; i--) {
  6. var component = shallow(property.components[i]);
  7. component.value = property.components[i].value.slice(0);
  8. cloned.components.unshift(component);
  9. }
  10. cloned.dirty = true;
  11. cloned.value = property.value.slice(0);
  12. return cloned;
  13. }
  14. function shallow(property) {
  15. var cloned = wrapSingle([
  16. Token.PROPERTY,
  17. [Token.PROPERTY_NAME, property.name]
  18. ]);
  19. cloned.important = property.important;
  20. cloned.hack = property.hack;
  21. cloned.unused = false;
  22. return cloned;
  23. }
  24. module.exports = {
  25. deep: deep,
  26. shallow: shallow
  27. };