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

Method copy

projects/JavaScript/proto/test.js:16856–17008  ·  view source on GitHub ↗

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

(other)

Source from the content-addressed store, hash-verified

16854 * @returns {!StructList} This struct
16855 */
16856 copy (other) {
16857 if (other.f1 != null) {
16858 this.f1 = []
16859 for (let item of other.f1) {
16860 if (item != null) {
16861 let tempItem
16862 tempItem = item
16863 this.f1.push(tempItem)
16864 } else {
16865 this.f1.push(undefined)
16866 }
16867 }
16868 } else {
16869 this.f1 = undefined
16870 }
16871 if (other.f2 != null) {
16872 this.f2 = []
16873 for (let item of other.f2) {
16874 if (item != null) {
16875 let tempItem
16876 tempItem = item
16877 this.f2.push(tempItem)
16878 } else {
16879 this.f2.push(undefined)
16880 }
16881 }
16882 } else {
16883 this.f2 = undefined
16884 }
16885 if (other.f3 != null) {
16886 this.f3 = []
16887 for (let item of other.f3) {
16888 if (item != null) {
16889 let tempItem
16890 if (typeof item === 'string') {
16891 // noinspection JSUnresolvedFunction
16892 tempItem = Uint8Array.from(Buffer.from(item, 'base64'))
16893 } else {
16894 tempItem = Uint8Array.from(item)
16895 }
16896 this.f3.push(tempItem)
16897 } else {
16898 this.f3.push(undefined)
16899 }
16900 }
16901 } else {
16902 this.f3 = undefined
16903 }
16904 if (other.f4 != null) {
16905 this.f4 = []
16906 for (let item of other.f4) {
16907 if (item != null) {
16908 let tempItem
16909 if (typeof item === 'string') {
16910 // noinspection JSUnresolvedFunction
16911 tempItem = Uint8Array.from(Buffer.from(item, 'base64'))
16912 } else {
16913 tempItem = Uint8Array.from(item)

Callers

nothing calls this directly

Calls 1

fromObjectMethod · 0.45

Tested by

no test coverage detected