MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / from

Function from

lib/models/dav.js:1993–2007  ·  view source on GitHub ↗
(that, value, encodingOrOffset, length)

Source from the content-addressed store, hash-verified

1991};
1992
1993function from (that, value, encodingOrOffset, length) {
1994 if (typeof value === 'number') {
1995 throw new TypeError('"value" argument must not be a number')
1996 }
1997
1998 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
1999 return fromArrayBuffer(that, value, encodingOrOffset, length)
2000 }
2001
2002 if (typeof value === 'string') {
2003 return fromString(that, value, encodingOrOffset)
2004 }
2005
2006 return fromObject(that, value)
2007}
2008
2009/**
2010 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError

Callers 2

BufferFunction · 0.85
dav.jsFile · 0.85

Calls 3

fromArrayBufferFunction · 0.85
fromStringFunction · 0.85
fromObjectFunction · 0.85

Tested by

no test coverage detected