MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / copy

Method copy

projects/JavaScript/proto/protoex.js:2923–2964  ·  view source on GitHub ↗

* Copy struct (shallow copy) * @this {!Account} * @param {!Account} other Other struct * @returns {!Account} This struct

(other)

Source from the content-addressed store, hash-verified

2921 * @returns {!Account} This struct
2922 */
2923 copy (other) {
2924 if (other.id != null) {
2925 this.id = other.id
2926 } else {
2927 this.id = undefined
2928 }
2929 if (other.name != null) {
2930 this.name = other.name
2931 } else {
2932 this.name = undefined
2933 }
2934 if (other.state != null) {
2935 this.state = StateEx.fromObject(other.state)
2936 } else {
2937 this.state = undefined
2938 }
2939 if (other.wallet != null) {
2940 this.wallet = Balance.fromObject(other.wallet)
2941 } else {
2942 this.wallet = undefined
2943 }
2944 if (other.asset != null) {
2945 this.asset = Balance.fromObject(other.asset)
2946 } else {
2947 this.asset = undefined
2948 }
2949 if (other.orders != null) {
2950 this.orders = []
2951 for (let item of other.orders) {
2952 if (item != null) {
2953 let tempItem
2954 tempItem = Order.fromObject(item)
2955 this.orders.push(tempItem)
2956 } else {
2957 this.orders.push(undefined)
2958 }
2959 }
2960 } else {
2961 this.orders = undefined
2962 }
2963 return this
2964 }
2965
2966 /**
2967 * Clone struct (deep clone)

Callers

nothing calls this directly

Calls 1

fromObjectMethod · 0.45

Tested by

no test coverage detected