Mercurial > hg > nginx-site
comparison xml/en/docs/njs/reference.xml @ 2647:0085d9f7dc3f
Minor corrections in njs reference.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 02 Feb 2021 12:37:28 +0000 |
parents | 7da360f50017 |
children | 9fc25ea7a92c |
comparison
equal
deleted
inserted
replaced
2646:d2d4549363ec | 2647:0085d9f7dc3f |
---|---|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> | 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
8 | 8 |
9 <article name="Reference" | 9 <article name="Reference" |
10 link="/en/docs/njs/reference.html" | 10 link="/en/docs/njs/reference.html" |
11 lang="en" | 11 lang="en" |
12 rev="59"> | 12 rev="60"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 <link doc="index.xml">njs</link> provides objects, methods and properties | 17 <link doc="index.xml">njs</link> provides objects, methods and properties |
1116 if encoding is the name of a supported character encoding. | 1116 if encoding is the name of a supported character encoding. |
1117 </tag-desc> | 1117 </tag-desc> |
1118 | 1118 |
1119 <tag-name id="buf_index"><literal>buffer[<value>index</value>]</literal></tag-name> | 1119 <tag-name id="buf_index"><literal>buffer[<value>index</value>]</literal></tag-name> |
1120 <tag-desc> | 1120 <tag-desc> |
1121 The index operator <value>index</value> | 1121 The index operator that can be used to get and set the octet |
1122 can be used to get and set the octet at position index in | 1122 at position <literal>index</literal> in <literal>buffer</literal>. |
1123 <literal>buffer</literal>. | |
1124 The values refer to individual bytes, | 1123 The values refer to individual bytes, |
1125 so the legal value range is between 0 and 255 (decimal). | 1124 so the legal value range is between 0 and 255 (decimal). |
1126 </tag-desc> | 1125 </tag-desc> |
1127 | 1126 |
1128 <tag-name id="buf_buffer"><literal>buf.buffer</literal></tag-name> | 1127 <tag-name id="buf_buffer"><literal>buf.buffer</literal></tag-name> |
1142 <value>targetStart</value>[, | 1141 <value>targetStart</value>[, |
1143 <value>targetEnd</value>[, | 1142 <value>targetEnd</value>[, |
1144 <value>sourceStart</value>[, | 1143 <value>sourceStart</value>[, |
1145 <value>sourceEnd</value>]]]])</literal></tag-name> | 1144 <value>sourceEnd</value>]]]])</literal></tag-name> |
1146 <tag-desc> | 1145 <tag-desc> |
1147 Compares buffer with target and returns a number | 1146 Compares buffer with <value>target</value> and returns a number |
1148 indicating whether buffer comes before, after, or is the same | 1147 indicating whether buffer comes before, after, or is the same |
1149 as target in sort order. | 1148 as <value>target</value> in sort order. |
1150 Comparison is based on the actual sequence of bytes in each Buffer. | 1149 Comparison is based on the actual sequence of bytes in each Buffer. |
1151 The <literal>targetStart</literal> is an integer specifying the offset | 1150 The <literal>targetStart</literal> is an integer specifying |
1152 within target at which to begin comparison, | 1151 the offset within <value>target</value> at which to begin comparison, |
1153 by default is 0. | 1152 by default is 0. |
1154 The <literal>targetEnd</literal> is an integer specifying the offset | 1153 The <literal>targetEnd</literal> is an integer specifying |
1155 within target at which to end comparison, | 1154 the offset within <value>target</value> at which to end comparison, |
1156 by default is <literal>target.length</literal>. | 1155 by default is <literal>target.length</literal>. |
1157 The <literal>sourceStart</literal> is an integer specifying the offset | 1156 The <literal>sourceStart</literal> is an integer specifying |
1158 within buffer at which to begin comparison, | 1157 the offset within buffer at which to begin comparison, |
1159 by default is 0. | 1158 by default is 0. |
1160 The <literal>sourceEnd</literal> is an integer specifying the offset | 1159 The <literal>sourceEnd</literal> is an integer specifying |
1161 within buffer at which to end comparison (not inclusive), | 1160 the offset within buffer at which to end comparison (not inclusive), |
1162 by default is <literal>buf.length</literal>. | 1161 by default is <literal>buf.length</literal>. |
1163 </tag-desc> | 1162 </tag-desc> |
1164 | 1163 |
1165 <tag-name id="buf_copy"><literal>buf.copy(<value>target</value>[, | 1164 <tag-name id="buf_copy"><literal>buf.copy(<value>target</value>[, |
1166 <value>targetStart</value>[, | 1165 <value>targetStart</value>[, |
1167 <value>sourceStart</value>[, | 1166 <value>sourceStart</value>[, |
1168 <value>sourceEnd</value>]]])</literal></tag-name> | 1167 <value>sourceEnd</value>]]])</literal></tag-name> |
1169 <tag-desc> | 1168 <tag-desc> |
1170 Copies data from a region of buffer to a region in target, | 1169 Copies data from a region of buffer to a region in <value>target</value>, |
1171 even if the target memory region overlaps with buffer. | 1170 even if the target memory region overlaps with buffer. |
1172 The <literal>target</literal> parameter is a | 1171 The <literal>target</literal> parameter is a |
1173 <value>Buffer</value> or <value>Uint8Array</value> to copy into. | 1172 <value>Buffer</value> or <value>Uint8Array</value> to copy into. |
1174 | 1173 |
1175 <para> | 1174 <para> |
1176 The <literal>targetStart</literal> is an integer specifying the offset | 1175 The <literal>targetStart</literal> is an integer specifying |
1177 within target at which to begin writing, | 1176 the offset within target at which to begin writing, |
1178 by default is 0. | 1177 by default is 0. |
1179 The <literal>sourceStart</literal> is an integer specifying the offset | 1178 The <literal>sourceStart</literal> is an integer specifying |
1180 within buffer from which to begin copying, | 1179 the offset within buffer from which to begin copying, |
1181 by default is 0. | 1180 by default is 0. |
1182 The <literal>sourceEnd</literal> is an integer specifying the offset | 1181 The <literal>sourceEnd</literal> is an integer specifying |
1183 within buffer at which to stop copying (not inclusive) | 1182 the offset within buffer at which to stop copying (not inclusive) |
1184 by default is <value>buf.length</value>. | 1183 by default is <value>buf.length</value>. |
1185 </para> | 1184 </para> |
1186 </tag-desc> | 1185 </tag-desc> |
1187 | 1186 |
1188 <tag-name id="buf_equals"><literal>buf.equals(<value>otherBuffer</value>)</literal></tag-name> | 1187 <tag-name id="buf_equals"><literal>buf.equals(<value>otherBuffer</value>)</literal></tag-name> |
1410 <tag-name id="buf_tostring"><literal>buf.toString([<value>encoding</value>[, | 1409 <tag-name id="buf_tostring"><literal>buf.toString([<value>encoding</value>[, |
1411 <value>start</value>[, | 1410 <value>start</value>[, |
1412 <value>end</value>]]])</literal></tag-name> | 1411 <value>end</value>]]])</literal></tag-name> |
1413 <tag-desc> | 1412 <tag-desc> |
1414 Decodes <literal>buf</literal> to a string | 1413 Decodes <literal>buf</literal> to a string |
1415 according to the specified character <value>encoding</value>. | 1414 according to the specified character <value>encoding</value> |
1416 which can be <value>utf8</value>, | 1415 which can be <value>utf8</value>, |
1417 <value>hex</value>, | 1416 <value>hex</value>, |
1418 <value>base64</value>, | 1417 <value>base64</value>, |
1419 <value>base64url</value>. | 1418 <value>base64url</value>. |
1420 The <value>start</value> and <value>end</value> parameters | 1419 The <value>start</value> and <value>end</value> parameters |