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

Method copy

projects/JavaScript/proto/test.js:15215–15367  ·  view source on GitHub ↗

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

(other)

Source from the content-addressed store, hash-verified

15213 * @returns {!StructVector} This struct
15214 */
15215 copy (other) {
15216 if (other.f1 != null) {
15217 this.f1 = []
15218 for (let item of other.f1) {
15219 if (item != null) {
15220 let tempItem
15221 tempItem = item
15222 this.f1.push(tempItem)
15223 } else {
15224 this.f1.push(undefined)
15225 }
15226 }
15227 } else {
15228 this.f1 = undefined
15229 }
15230 if (other.f2 != null) {
15231 this.f2 = []
15232 for (let item of other.f2) {
15233 if (item != null) {
15234 let tempItem
15235 tempItem = item
15236 this.f2.push(tempItem)
15237 } else {
15238 this.f2.push(undefined)
15239 }
15240 }
15241 } else {
15242 this.f2 = undefined
15243 }
15244 if (other.f3 != null) {
15245 this.f3 = []
15246 for (let item of other.f3) {
15247 if (item != null) {
15248 let tempItem
15249 if (typeof item === 'string') {
15250 // noinspection JSUnresolvedFunction
15251 tempItem = Uint8Array.from(Buffer.from(item, 'base64'))
15252 } else {
15253 tempItem = Uint8Array.from(item)
15254 }
15255 this.f3.push(tempItem)
15256 } else {
15257 this.f3.push(undefined)
15258 }
15259 }
15260 } else {
15261 this.f3 = undefined
15262 }
15263 if (other.f4 != null) {
15264 this.f4 = []
15265 for (let item of other.f4) {
15266 if (item != null) {
15267 let tempItem
15268 if (typeof item === 'string') {
15269 // noinspection JSUnresolvedFunction
15270 tempItem = Uint8Array.from(Buffer.from(item, 'base64'))
15271 } else {
15272 tempItem = Uint8Array.from(item)

Callers

nothing calls this directly

Calls 1

fromObjectMethod · 0.45

Tested by

no test coverage detected