MCPcopy
hub / github.com/zxing-js/library / append

Method append

src/core/util/StringBuilder.ts:15–26  ·  view source on GitHub ↗
(s: string | number)

Source from the content-addressed store, hash-verified

13 }
14
15 public append(s: string | number): StringBuilder {
16 if (typeof s === 'string') {
17 this.value += s.toString();
18 } else if (this.encoding) {
19 // use passed format (fromCharCode will return UTF8 encoding)
20 this.value += StringUtils.castAsNonUtf8Char(s, this.encoding);
21 } else {
22 // correctly converts from UTF-8, but not other encodings
23 this.value += String.fromCharCode(s);
24 }
25 return this;
26 }
27
28 public appendChars(
29 str: char[] | string[],

Callers 15

toStringFunction · 0.95
encodeToCodewordsMethod · 0.95
encodeECC200Method · 0.95
constructorMethod · 0.95
encodeMethod · 0.95
encodeToCodewordsMethod · 0.95
encodeMethod · 0.95
decodeMethod · 0.95
convertUPCEtoUPCAMethod · 0.95
constructResultMethod · 0.95
parseInformationMethod · 0.95
parseInformationMethod · 0.95

Calls 2

castAsNonUtf8CharMethod · 0.80
toStringMethod · 0.45

Tested by 6

toBitFieldStringArrayMethod · 0.76
unvisualizeFunction · 0.76
createBinaryMessageFunction · 0.76
matrixToStringFunction · 0.64
arrayToStringFunction · 0.64