code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
renderAnchorLink = function renderAnchorLink(anchor, options, tokens, idx) { var _tokens$children; var linkTokens = [_extends({}, new Token("link_open", "a", 1), { attrs: [["class", options.anchorClassName], ["href", "#" + anchor]] })]...
Clones (copies) an Object using deep copying. This function supports circular references by default, but if you are certain there are no circular references in your object, you can save some CPU time by calling clone(obj, false). Caution: if `circular` is false and `parent` contains circular references, your program ...
renderAnchorLink
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
treeToMarkdownBulletList = function treeToMarkdownBulletList(tree) { var indent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; return tree.map(function (item) { var indentation = " "; var node = repeat(ind...
Clones (copies) an Object using deep copying. This function supports circular references by default, but if you are certain there are no circular references in your object, you can save some CPU time by calling clone(obj, false). Caution: if `circular` is false and `parent` contains circular references, your program ...
treeToMarkdownBulletList
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
generateTocMarkdownFromArray = function generateTocMarkdownFromArray(headings, options) { var tree = { nodes: [] }; // create an ast headings.forEach(function (heading) { if (heading.level < options.tocFirstLevel || heading.level > opti...
Clones (copies) an Object using deep copying. This function supports circular references by default, but if you are certain there are no circular references in your object, you can save some CPU time by calling clone(obj, false). Caution: if `circular` is false and `parent` contains circular references, your program ...
generateTocMarkdownFromArray
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function _instanceof(obj, type) { return type != null && obj instanceof type; }
Clones (copies) an Object using deep copying. This function supports circular references by default, but if you are certain there are no circular references in your object, you can save some CPU time by calling clone(obj, false). Caution: if `circular` is false and `parent` contains circular references, your program ...
_instanceof
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function __objToStr(o) { return Object.prototype.toString.call(o); }
Functionally equivalent to Buffer(arg, encoding) but throws a TypeError if value is a number. Buffer.from(str[, encoding]) Buffer.from(array) Buffer.from(buffer) Buffer.from(arrayBuffer[, byteOffset[, length]])
__objToStr
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function __isDate(o) { return typeof o === 'object' && __objToStr(o) === '[object Date]'; }
Functionally equivalent to Buffer(arg, encoding) but throws a TypeError if value is a number. Buffer.from(str[, encoding]) Buffer.from(array) Buffer.from(buffer) Buffer.from(arrayBuffer[, byteOffset[, length]])
__isDate
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function __isArray(o) { return typeof o === 'object' && __objToStr(o) === '[object Array]'; }
Functionally equivalent to Buffer(arg, encoding) but throws a TypeError if value is a number. Buffer.from(str[, encoding]) Buffer.from(array) Buffer.from(buffer) Buffer.from(arrayBuffer[, byteOffset[, length]])
__isArray
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function __isRegExp(o) { return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; }
Functionally equivalent to Buffer(arg, encoding) but throws a TypeError if value is a number. Buffer.from(str[, encoding]) Buffer.from(array) Buffer.from(buffer) Buffer.from(arrayBuffer[, byteOffset[, length]])
__isRegExp
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function __getRegExpFlags(re) { var flags = ''; if (re.global) flags += 'g'; if (re.ignoreCase) flags += 'i'; if (re.multiline) flags += 'm'; return flags; }
Creates a new filled Buffer instance. alloc(size[, fill[, encoding]])
__getRegExpFlags
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function typedArraySupport () { try { var arr = new Uint8Array(1) arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} return arr.foo() === 42 && // typed array instances can be augme...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
typedArraySupport
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function kMaxLength () { return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
kMaxLength
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function createBuffer (that, length) { if (kMaxLength() < length) { throw new RangeError('Invalid typed array length') } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` i...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
createBuffer
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function Buffer (arg, encodingOrOffset, length) { if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { return new Buffer(arg, encodingOrOffset, length) } // Common case. if (typeof arg...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
Buffer
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function from (that, value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('"value" argument must not be a number') } if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuf...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
from
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be a number') } else if (size < 0) { throw new RangeError('"size" argument must not be negative') ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
assertSize
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function alloc (that, size, fill, encoding) { assertSize(size) if (size <= 0) { return createBuffer(that, size) } if (fill !== undefined) { // Only pay attention to enc...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
alloc
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function allocUnsafe (that, size) { assertSize(size) that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) if (!Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < size; ++i) { that[i]...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
allocUnsafe
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function fromString (that, string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('"encoding" m...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
fromString
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function fromArrayLike (that, array) { var length = array.length < 0 ? 0 : checked(array.length) | 0 that = createBuffer(that, length) for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255 ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
fromArrayLike
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function fromArrayBuffer (that, array, byteOffset, length) { array.byteLength // this throws if `array` is not a valid ArrayBuffer if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('\'offset\' is out of bounds') ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
fromArrayBuffer
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function fromObject (that, obj) { if (Buffer.isBuffer(obj)) { var len = checked(obj.length) | 0 that = createBuffer(that, len) if (that.length === 0) { return that ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
fromObject
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function checked (length) { // Note: cannot use `length < kMaxLength()` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= kMaxLength()) { throw new RangeError('Attempt to a...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
checked
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function SlowBuffer (length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0 } return Buffer.alloc(+length) }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
SlowBuffer
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffe...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
byteLength
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function slowToString (encoding, start, end) { var loweredCase = false // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
slowToString
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function swap (b, n, m) { var i = b[n] b[n] = b[m] b[m] = i }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
swap
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
bidirectionalIndexOf
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function arrayIndexOf (arr, val, byteOffset, encoding, dir) { var indexSize = 1 var arrLength = arr.length var valLength = val.length if (encoding !== undefined) { encoding = String(encoding).toL...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
arrayIndexOf
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function read (buf, i) { if (indexSize === 1) { return buf[i] } else { return buf.readUInt16BE(i * indexSize) } }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
read
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 var remaining = buf.length - offset if (!length) { length = remaining } else { length = N...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
hexWrite
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function utf8Write (buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
utf8Write
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
asciiWrite
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function latin1Write (buf, string, offset, length) { return asciiWrite(buf, string, offset, length) }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
latin1Write
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
base64Write
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function ucs2Write (buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
ucs2Write
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
base64Slice
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function utf8Slice (buf, start, end) { end = Math.min(buf.length, end) var res = [] var i = start while (i < end) { var firstByte = buf[i] var codePoint = null ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
utf8Slice
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function decodeCodePointsArray (codePoints) { var len = codePoints.length if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } // Decod...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
decodeCodePointsArray
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function asciiSlice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 0x7F) } return...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
asciiSlice
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function latin1Slice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]) } return ret ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
latin1Slice
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function hexSlice (buf, start, end) { var len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len var out = '' for (var i = start; i < end; ++i) { ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
hexSlice
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function utf16leSlice (buf, start, end) { var bytes = buf.slice(start, end) var res = '' for (var i = 0; i < bytes.length; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) } ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
utf16leSlice
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
checkOffset
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') if (offs...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
checkInt
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function objectWriteUInt16 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i))))...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
objectWriteUInt16
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function objectWriteUInt32 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffffffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xf...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
objectWriteUInt32
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function checkIEEE754 (buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range') if (offset < 0) throw new RangeError('Index out of range') }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
checkIEEE754
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function writeFloat (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } ieee754.write(buf, value, offset, littleEndian, 2...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
writeFloat
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function writeDouble (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) } ieee754.write(buf, value, offset, littleEndian...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
writeDouble
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function isValidDelim(state, pos) { var prevChar, nextChar, max = state.posMax, can_open = true, can_close = true; prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1; nextChar = pos ...
Parse and build an expression, and return the markup for that.
isValidDelim
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function math_block(state, start, end, silent){ var firstLine, lastLine, next, lastPos, found = false, token, pos = state.bMarks[start] + state.tShift[start], max = state.eMarks[start] if(pos + 2 > max){ return false; } ...
The main Settings object The current options stored are: - displayMode: Whether the expression should be typeset by default in textstyle or displaystyle (default false)
math_block
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
inlineRenderer = function(tokens, idx){ return katexInline(tokens[idx].content); }
This file does the main work of building a domTree structure from a parse tree. The entry point is the `buildHTML` function, which takes a parse tree. Then, the buildExpression, buildGroup, and various groupTypes functions are called, to produce a final HTML tree.
inlineRenderer
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
katexBlock = function(latex){ options.displayMode = true; try{ return "<p>" + katex.renderToString(latex, options) + "</p>"; } catch(error){ if(options.throwOnError){ c...
This file does the main work of building a domTree structure from a parse tree. The entry point is the `buildHTML` function, which takes a parse tree. Then, the buildExpression, buildGroup, and various groupTypes functions are called, to produce a final HTML tree.
katexBlock
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
blockRenderer = function(tokens, idx){ return katexBlock(tokens[idx].content) + '\n'; }
Take a list of nodes, build them in order, and return a list of the built nodes. This function handles the `prev` node correctly, and passes the previous element from the list as the prev of the next element.
blockRenderer
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
render = function(expression, baseNode, options) { utils.clearNode(baseNode); var settings = new Settings(options); var tree = parseTree(expression, settings); var node = buildTree(tree, expression, settings).toNode(); ...
Take a list of nodes, build them in order, and return a list of the built nodes. This function handles the `prev` node correctly, and passes the previous element from the list as the prev of the next element.
render
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
renderToString = function(expression, options) { var settings = new Settings(options); var tree = parseTree(expression, settings); return buildTree(tree, expression, settings).toMarkup(); }
Gets the final math type of an expression, given its group type. This type is used to determine spacing between elements, and affects bin elements by causing them to change depending on what types are around them. This type must be attached to the outermost node of an element as a CSS class so that spacing with its sur...
renderToString
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
generateParseTree = function(expression, options) { var settings = new Settings(options); return parseTree(expression, settings); }
Gets the final math type of an expression, given its group type. This type is used to determine spacing between elements, and affects bin elements by causing them to change depending on what types are around them. This type must be attached to the outermost node of an element as a CSS class so that spacing with its sur...
generateParseTree
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function ParseError(message, lexer, position) { var error = "KaTeX parse error: " + message; if (lexer !== undefined && position !== undefined) { // If we have the input and a position, make the error a bit fancier // Prepend some...
Sometimes, groups perform special rules when they have superscripts or subscripts attached to them. This function lets the `supsub` group know that its inner element should handle the superscripts and subscripts instead of handling them itself.
ParseError
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function get(option, defaultValue) { return option === undefined ? defaultValue : option; }
TeXbook algorithms often reference "character boxes", which are simply groups with a single character in them. To decide if something is a character box, we find its innermost group, and see if it is a single character.
get
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function Settings(options) { // allow null options options = options || {}; this.displayMode = get(options.displayMode, false); this.throwOnError = get(options.throwOnError, true); this.errorColor = get(options.errorColo...
TeXbook algorithms often reference "character boxes", which are simply groups with a single character in them. To decide if something is a character box, we find its innermost group, and see if it is a single character.
Settings
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
buildTree = function(tree, expression, settings) { settings = settings || new Settings({}); var startStyle = Style.TEXT; if (settings.displayMode) { startStyle = Style.DISPLAY; } // Setup the de...
This is a map of group types to the function used to handle that type. Simpler types come at the beginning, while complicated types come afterwards.
buildTree
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
buildExpression = function(expression, options, prev) { var groups = []; for (var i = 0; i < expression.length; i++) { var group = expression[i]; groups.push(buildGroup(group, options, prev)); prev = group; ...
This is a map of group types to the function used to handle that type. Simpler types come at the beginning, while complicated types come afterwards.
buildExpression
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
getTypeOfGroup = function(group) { if (group == null) { // Like when typesetting $^3$ return groupToType.mathord; } else if (group.type === "supsub") { return getTypeOfGroup(group.value.base); ...
This is a map of group types to the function used to handle that type. Simpler types come at the beginning, while complicated types come afterwards.
getTypeOfGroup
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
shouldHandleSupSub = function(group, options) { if (!group) { return false; } else if (group.type === "op") { // Operators handle supsubs differently when they have limits // (e.g. `\displaystyle\sum_2^3`) ...
This is a map of group types to the function used to handle that type. Simpler types come at the beginning, while complicated types come afterwards.
shouldHandleSupSub
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
getBaseElem = function(group) { if (!group) { return false; } else if (group.type === "ordgroup") { if (group.value.length === 1) { return getBaseElem(group.value[0]); } else { ...
This is a map of group types to the function used to handle that type. Simpler types come at the beginning, while complicated types come afterwards.
getBaseElem
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
isCharacterBox = function(group) { var baseElem = getBaseElem(group); // These are all they types of groups which hold single characters return baseElem.type === "mathord" || baseElem.type === "textord" || baseE...
This is a map of group types to the function used to handle that type. Simpler types come at the beginning, while complicated types come afterwards.
isCharacterBox
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeNullDelimiter = function(options) { return makeSpan([ "sizing", "reset-" + options.size, "size5", options.style.reset(), Style.TEXT.cls(), "nulldelimiter", ]); }
This is a map of group types to the function used to handle that type. Simpler types come at the beginning, while complicated types come afterwards.
makeNullDelimiter
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
buildGroup = function(group, options, prev) { if (!group) { return makeSpan(); } if (groupTypes[group.type]) { // Call the groupTypes function var groupNode = groupTypes[group.type](group...
Makes a symbolNode after translation via the list of symbols in symbols.js. Correctly pulls out metrics for the character, and optionally takes a list of classes to be attached to the node.
buildGroup
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
buildHTML = function(tree, options) { // buildExpression is destructive, so we need to make a clone // of the incoming tree so that it isn't accidentally changed tree = JSON.parse(JSON.stringify(tree)); // Build the expression contained in...
Makes a symbol in Main-Regular or AMS-Regular. Used for rel, bin, open, close, inner, and punct.
buildHTML
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function Style(id, size, multiplier, cramped) { this.id = id; this.size = size; this.cramped = cramped; this.sizeMultiplier = multiplier; }
Makes either a mathord or textord in the correct font and color.
Style
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeSymbol = function(value, style, mode, color, classes) { // Replace the value with its replaced value from symbol.js if (symbols[mode][value] && symbols[mode][value].replace) { value = symbols[mode][value].replace; } ...
Makes an element placed in each of the vlist elements to ensure that each element has the same max font size. To do this, we create a zero-width space with the correct font size.
makeSymbol
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
mathsym = function(value, mode, color, classes) { // Decide what font to render the symbol in by its entry in the symbols // table. // Have a special case for when the value = \ because the \ is used as a // textord in unsupported command e...
Makes a vertical list by stacking elements and kerns on top of each other. Allows for many different ways of specifying the positioning method. Arguments: - children: A list of child or kern nodes to be stacked on top of each other (i.e. the first element will be at the bottom, and the last at ...
mathsym
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
mathDefault = function(value, mode, color, classes, type) { if (type === "mathord") { return mathit(value, mode, color, classes); } else if (type === "textord") { return makeSymbol( value, "Main-Regular",...
Makes a vertical list by stacking elements and kerns on top of each other. Allows for many different ways of specifying the positioning method. Arguments: - children: A list of child or kern nodes to be stacked on top of each other (i.e. the first element will be at the bottom, and the last at ...
mathDefault
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
mathit = function(value, mode, color, classes) { if (/[0-9]/.test(value.charAt(0)) || // glyphs for \imath and \jmath do not exist in Math-Italic so we // need to use Main-Italic instead utils.contains(dotlessLetters, value) || ...
Makes a vertical list by stacking elements and kerns on top of each other. Allows for many different ways of specifying the positioning method. Arguments: - children: A list of child or kern nodes to be stacked on top of each other (i.e. the first element will be at the bottom, and the last at ...
mathit
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeOrd = function(group, options, type) { var mode = group.mode; var value = group.value; if (symbols[mode][value] && symbols[mode][value].replace) { value = symbols[mode][value].replace; } var ...
Makes a vertical list by stacking elements and kerns on top of each other. Allows for many different ways of specifying the positioning method. Arguments: - children: A list of child or kern nodes to be stacked on top of each other (i.e. the first element will be at the bottom, and the last at ...
makeOrd
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
sizeElementFromChildren = function(elem) { var height = 0; var depth = 0; var maxFontSize = 0; if (elem.children) { for (var i = 0; i < elem.children.length; i++) { if (elem.children[i].h...
Makes a vertical list by stacking elements and kerns on top of each other. Allows for many different ways of specifying the positioning method. Arguments: - children: A list of child or kern nodes to be stacked on top of each other (i.e. the first element will be at the bottom, and the last at ...
sizeElementFromChildren
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeSpan = function(classes, children, color) { var span = new domTree.span(classes, children); sizeElementFromChildren(span); if (color) { span.style.color = color; } return span; ...
Makes a vertical list by stacking elements and kerns on top of each other. Allows for many different ways of specifying the positioning method. Arguments: - children: A list of child or kern nodes to be stacked on top of each other (i.e. the first element will be at the bottom, and the last at ...
makeSpan
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeFragment = function(children) { var fragment = new domTree.documentFragment(children); sizeElementFromChildren(fragment); return fragment; }
Makes a vertical list by stacking elements and kerns on top of each other. Allows for many different ways of specifying the positioning method. Arguments: - children: A list of child or kern nodes to be stacked on top of each other (i.e. the first element will be at the bottom, and the last at ...
makeFragment
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeFontSizer = function(options, fontSize) { var fontSizeInner = makeSpan([], [new domTree.symbolNode("\u200b")]); fontSizeInner.style.fontSize = (fontSize / options.style.sizeMultiplier) + "em"; var fontSizer = makeSpan( ...
Maps TeX font commands to objects containing: - variant: string used for "mathvariant" attribute in buildMathML.js - fontName: the "style" parameter to fontMetrics.getCharacterMetrics
makeFontSizer
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeVList = function(children, positionType, positionData, options) { var depth; var currPos; var i; if (positionType === "individualShift") { var oldChildren = children; children = [oldChildr...
Create an HTML className based on a list of classes. In addition to joining with spaces, we also remove null or empty classes.
makeVList
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function span(classes, children, height, depth, maxFontSize, style) { this.classes = classes || []; this.children = children || []; this.height = height || 0; this.depth = depth || 0; this.maxFontSize = maxFontSize || 0;...
Provide an `indexOf` function which works in IE8, but defers to native if possible.
span
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function documentFragment(children, height, depth, maxFontSize) { this.children = children || []; this.height = height || 0; this.depth = depth || 0; this.maxFontSize = maxFontSize || 0; }
This file contains metrics regarding fonts and individual symbols. The sigma and xi variables, as well as the metricMap map contain data extracted from TeX, TeX font metrics, and the TTF files. These data are then exposed via the `metrics` variable and the getCharacterMetrics function.
documentFragment
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function symbolNode(value, height, depth, italic, skew, classes, style) { this.value = value || ""; this.height = height || 0; this.depth = depth || 0; this.italic = italic || 0; this.skew = skew || 0; ...
This file contains metrics regarding fonts and individual symbols. The sigma and xi variables, as well as the metricMap map contain data extracted from TeX, TeX font metrics, and the TTF files. These data are then exposed via the `metrics` variable and the getCharacterMetrics function.
symbolNode
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function defineSymbol(mode, font, group, replace, name) { module.exports[mode][name] = { font: font, group: group, replace: replace, }; }
This file holds a list of all no-argument functions and single-character symbols (like 'a' or ';'). For each of the symbols, there are three properties they can have: - font (required): the font to be used for this symbol. Either "main" (the normal font), or "ams" (the ams fonts). - group (required): ...
defineSymbol
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeSizedDelim = function(delim, size, options, mode) { // < and > turn into \langle and \rangle in delimiters if (delim === "<" || delim === "\\lt") { delim = "\\langle"; } else if (delim === ">" || delim === "\\gt") { ...
This file converts a parse tree into a cooresponding MathML tree. The main entry point is the `buildMathML` function, which takes a parse tree from the parser.
makeSizedDelim
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
delimTypeToFont = function(type) { if (type.type === "small") { return "Main-Regular"; } else if (type.type === "large") { return "Size" + type.size + "-Regular"; } else if (type.type === "stack") { ...
Functions for handling the different types of groups found in the parse tree. Each function should take a parse group and return a MathML node.
delimTypeToFont
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
traverseSequence = function(delim, height, sequence, options) { // Here, we choose the index we should start at in the sequences. In smaller // sizes (which correspond to larger numbers in style.size) we start earlier // in the sequence. Thus, scriptscript sta...
Functions for handling the different types of groups found in the parse tree. Each function should take a parse group and return a MathML node.
traverseSequence
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeCustomSizedDelim = function(delim, height, center, options, mode) { if (delim === "<" || delim === "\\lt") { delim = "\\langle"; } else if (delim === ">" || delim === "\\gt") { delim = "\\rangle"; } ...
Functions for handling the different types of groups found in the parse tree. Each function should take a parse group and return a MathML node.
makeCustomSizedDelim
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeLeftRightDelim = function(delim, height, depth, options, mode) { // We always center \left/\right delimiters, so the axis is always shifted var axisHeight = fontMetrics.metrics.axisHeight * options.style.sizeMultiplier; // Taken fr...
Functions for handling the different types of groups found in the parse tree. Each function should take a parse group and return a MathML node.
makeLeftRightDelim
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
makeText = function(text, mode) { if (symbols[mode][text] && symbols[mode][text].replace) { text = symbols[mode][text].replace; } return new mathMLTree.TextNode(text); }
Functions for handling the different types of groups found in the parse tree. Each function should take a parse group and return a MathML node.
makeText
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
getVariant = function(group, options) { var font = options.font; if (!font) { return null; } var mode = group.mode; if (font === "mathit") { return "italic"; ...
Functions for handling the different types of groups found in the parse tree. Each function should take a parse group and return a MathML node.
getVariant
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
buildExpression = function(expression, options) { var groups = []; for (var i = 0; i < expression.length; i++) { var group = expression[i]; groups.push(buildGroup(group, options)); } return gr...
Create a new options object with the given size.
buildExpression
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
buildGroup = function(group, options) { if (!group) { return new mathMLTree.MathNode("mrow"); } if (groupTypes[group.type]) { // Call the groupTypes function return groupTypes[group.type]...
Create a new options object with "phantom" set to true.
buildGroup
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
buildMathML = function(tree, texExpression, options) { var expression = buildExpression(tree, options); // Wrap up the expression in an mrow so it is presented in the semantics // tag correctly. var wrapper = new mathMLTree.MathNode("mrow"...
A map of color names to CSS colors. TODO(emily): Remove this when we have real macros
buildMathML
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function MathNode(type, children) { this.type = type; this.attributes = {}; this.children = children || []; }
A map of color names to CSS colors. TODO(emily): Remove this when we have real macros
MathNode
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
parseTree = function(toParse, settings) { var parser = new Parser(toParse, settings); return parser.parse(); }
Rewrites infix operators such as \over with corresponding commands such as \frac. There can only be one infix operator per group. If there's more than one then the expression is ambiguous. This can be resolved by adding {}. @returns {Array}
parseTree
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function Parser(input, settings) { // Make a new lexer this.lexer = new Lexer(input); // Store the settings for use in parsing this.settings = settings; }
Converts the textual input of an unsupported command into a text node contained within a color node whose color is determined by errorColor
Parser
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function ParseFuncOrArgument(result, isFunction) { this.result = result; // Is this a function (i.e. is it something defined in functions.js)? this.isFunction = isFunction; }
Converts the textual input of an unsupported command into a text node contained within a color node whose color is determined by errorColor
ParseFuncOrArgument
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function defineEnvironment(names, props, handler) { if (typeof names === "string") { names = [names]; } if (typeof props === "number") { props = { numArgs: props }; } // Se...
This function lexes a single normal token. It takes a position and whether it should completely ignore whitespace or not.
defineEnvironment
javascript
arturssmirnovs/github-profile-readme-generator
js/markdown.js
https://github.com/arturssmirnovs/github-profile-readme-generator/blob/master/js/markdown.js
MIT
function createPrivateKey(entropy) { if (entropy) { if (!Buffer.isBuffer(entropy)) throw new Error('EthCrypto.createPrivateKey(): given entropy is no Buffer'); if (Buffer.byteLength(entropy, 'utf8') < MIN_ENTROPY_SIZE) throw new Error('EthCrypto.createPrivateKey(): Entropy-size must be at least ' + MIN_ENTROP...
create a privateKey from the given entropy or a new one @param {Buffer} entropy @return {string}
createPrivateKey
javascript
pubkey/eth-crypto
dist/es/create-identity.js
https://github.com/pubkey/eth-crypto/blob/master/dist/es/create-identity.js
MIT