layout
menu_item
title
description
return_to
sections
default
api
Object
Version 0.26.1
API Documentation Index
/api/
lookup
lookupPrefix
size
string2Type
type2String
typeisloose
#dup
#id
#lookupByPath
#owner
#peel
#shortId
#type
TYPE
#lookup
#lookupPrefix
#size
#string2Type
#type2String
#typeisloose
#dup
#id
#lookupByPath
#owner
#peel
#shortId
#type
#TYPE
Object. lookup Async Experimental
Object . lookup ( repo , id , type ) . then ( function ( object ) {
// Use object
} ) ;
Parameters
Type
repo
Repository
the repository to look up the object
id
Oid
the unique identifier for the object
type
Number
the type of the object
Object. lookupPrefix Async Experimental
Object . lookupPrefix ( repo , id , len , type ) . then ( function ( object ) {
// Use object
} ) ;
Parameters
Type
repo
Repository
the repository to look up the object
id
Oid
a short identifier for the object
len
Number
the length of the short identifier
type
Number
the type of the object
Returns
Object
the looked-up object
Object. size Sync Experimental
var result = Object . size ( type ) ;
Parameters
Type
type
Number
object type to get its size
Returns
Number
size in bytes of the object
Object. string2Type Sync Experimental
var result = Object . string2Type ( str ) ;
Parameters
Type
str
String
the string to convert.
Returns
Number
the corresponding git_object_t.
Object. type2String Sync Experimental
var string = Object . type2String ( type ) ;
Parameters
Type
type
Number
object type to convert.
Returns
String
the corresponding string representation.
Object. typeisloose Sync Experimental
var result = Object . typeisloose ( type ) ;
Parameters
Type
type
Number
object type to test.
Returns
Number
true if the type represents a valid loose object type,
false otherwise.
Object# dup Async Experimental
object . dup ( ) . then ( function ( object ) {
// Use object
} ) ;
Object# id Sync Experimental
Object# lookupByPath Async Experimental
object . lookupByPath ( path , type ) . then ( function ( object ) {
// Use object
} ) ;
| Parameters | Type |
| --- | --- | --- |
| path | String | relative path from the root object to the desired object |
| type | Number | type of object desired |
Returns
Object
buffer that receives the object (which must be freed
Object# owner Sync Experimental
var repository = object . owner ( ) ;
Returns
Repository
the repository who owns this object
Object# peel Async Experimental
object . peel ( target_type ) . then ( function ( object ) {
// Use object
} ) ;
| Parameters | Type |
| --- | --- | --- |
| target_type | Number | The type of the requested object (a GIT_OBJECT_ value) |
Object# shortId Async Experimental
object . shortId ( ) . then ( function ( buf ) {
// Use buf
} ) ;
Returns
Buf
Buffer to write string into
Object# type Sync Experimental
var result = object . type ( ) ;
Returns
Number
the object's type
| Flag | Value |
| --- | --- | --- |
| Object.TYPE. ANY | -2 |
| Object.TYPE. INVALID | -1 |
| Object.TYPE. COMMIT | 1 |
| Object.TYPE. TREE | 2 |
| Object.TYPE. BLOB | 3 |
| Object.TYPE. TAG | 4 |
| Object.TYPE. OFS_DELTA | 6 |
| Object.TYPE. REF_DELTA | 7 |