MCPcopy Create free account
hub / github.com/cryptii/cryptii / getCodePoints

Method getCodePoints

src/Chain.js:69–81  ·  view source on GitHub ↗

* Lazily retrieves the Unicode code point representation. * @return {number[]} Array of Unicode code points

()

Source from the content-addressed store, hash-verified

67 * @return {number[]} Array of Unicode code points
68 */
69 getCodePoints () {
70 if (this._codePoints === null) {
71 if (this._string !== null) {
72 // retrieve code points from string
73 this._codePoints = TextEncoder.codePointsFromString(this._string)
74 } else {
75 // retrieve code points from bytes
76 this._codePoints = TextEncoder.codePointsFromBytes(
77 this._bytes, this._encoding)
78 }
79 }
80 return this._codePoints
81 }
82
83 /**
84 * Returns a string for each Unicode character.

Callers 15

getCharsMethod · 0.95
[Symbol.iterator]Method · 0.95
getCodePointAtMethod · 0.95
getLengthMethod · 0.95
getStringMethod · 0.95
substrMethod · 0.95
extendMethod · 0.95
indexOfCodePointMethod · 0.95
getBytesMethod · 0.95
isEqualToMethod · 0.95
Chain.jsFile · 0.80
performEncodeMethod · 0.80

Calls 2

codePointsFromStringMethod · 0.80
codePointsFromBytesMethod · 0.80

Tested by

no test coverage detected