2
2
layout : default
3
3
menu_item : api
4
4
title : Blob
5
- description : Version 0.26.0
5
+ description : Version 0.26.1
6
6
menu_item : api
7
7
return_to :
8
8
" API Documentation Index " : /api/
@@ -16,12 +16,14 @@ sections:
16
16
" #content " : " #content"
17
17
" #dup " : " #dup"
18
18
" #filemode " : " #filemode"
19
+ " #filter " : " #filter"
19
20
" #id " : " #id"
20
21
" #isBinary " : " #isBinary"
21
22
" #owner " : " #owner"
22
23
" #rawcontent " : " #rawcontent"
23
24
" #rawsize " : " #rawsize"
24
25
" #toString " : " #toString"
26
+ " FILTER_FLAG " : " #FILTER_FLAG"
25
27
---
26
28
27
29
## <a name =" createFromBuffer " ></a ><span >Blob.</span >createFromBuffer <span class =" tags " ><span class =" async " >Async</span ></span >
@@ -86,13 +88,13 @@ Blob.filteredContent(blob, as_path, check_for_binary_data).then(function(buffer)
86
88
87
89
| Parameters | Type | |
88
90
| --- | --- | --- |
89
- | blob | [ Blob] ( /api/blob/ ) | Pointer to the blob |
90
- | as_path | String | Path used for file attribute lookups, etc. |
91
- | check_for_binary_data | Number | Should this test if blob content contains NUL bytes / looks like binary data before applying filters? |
91
+ | blob | [ Blob] ( /api/blob/ ) | |
92
+ | as_path | String | |
93
+ | check_for_binary_data | Number | |
92
94
93
95
| Returns | |
94
96
| --- | --- |
95
- | Buffer | The git_buf to be filled in |
97
+ | Buffer | |
96
98
97
99
## <a name =" lookup " ></a ><span >Blob.</span >lookup <span class =" tags " ><span class =" async " >Async</span ></span >
98
100
@@ -167,6 +169,30 @@ Retrieve the Blob's type.
167
169
| --- | --- |
168
170
| Number | The filemode of the blob. |
169
171
172
+ ## <a name =" filter " ></a ><span >Blob#</span >filter <span class =" tags " ><span class =" async " >Async</span ></span >
173
+
174
+ ``` js
175
+ blob .filter (asPath, opts).then (function (promiseString ) {
176
+ // Use promiseString
177
+ });
178
+ ```
179
+
180
+ Get a buffer with the filtered content of a blob.
181
+
182
+ This applies filters as if the blob was being checked out to the
183
+ working directory under the specified filename. This may apply
184
+ CRLF filtering or other types of changes depending on the file
185
+ attributes set for the blob and the content detected in it.
186
+
187
+ | Parameters | Type |
188
+ | --- | --- | --- |
189
+ | asPath | | Path used for file attribute lookups, etc. |
190
+ | opts | | Options to use for filtering the blob |
191
+
192
+ | Returns | |
193
+ | --- | --- |
194
+ | Promise.<string > | |
195
+
170
196
## <a name =" id " ></a ><span >Blob#</span >id <span class =" tags " ><span class =" sync " >Sync</span ></span >
171
197
172
198
``` js
@@ -230,3 +256,11 @@ Retrieve the Blob's content as String.
230
256
| --- | --- |
231
257
| String | Contents as a string. |
232
258
259
+ ## <a name =" FILTER_FLAG " ></a ><span >Blob.</span >FILTER_FLAG <span class =" tags " ><span class =" enum " >ENUM</span ></span >
260
+
261
+ | Flag | Value |
262
+ | --- | --- | --- |
263
+ | <span >Blob.FILTER_FLAG.</span >CHECK_FOR_BINARY | 1 |
264
+ | <span >Blob.FILTER_FLAG.</span >NO_SYSTEM_ATTRIBUTES | 2 |
265
+ | <span >Blob.FILTER_FLAG.</span >ATTTRIBUTES_FROM_HEAD | 4 |
266
+
0 commit comments