8000 utfx 1.0.1 · adon-at-work/bytebuffer.js@cf838b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf838b3

Browse files
committed
utfx 1.0.1
1 parent 2786a43 commit cf838b3

11 files changed

+57
-57
lines changed

dist/ByteBufferAB.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
*/
189189
ByteBufferPrototype.__isByteBuffer__;
190190

191-
Object.defineProperty(ByteBuffer.prototype, "__isByteBuffer__", {
191+
Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", {
192192
value: true,
193193
enumerable: false,
194194
configurable: false
@@ -3640,7 +3640,7 @@
36403640
utfx.calculateUTF8 = function(src) {
36413641
var cp, l=0;
36423642
while ((cp = src()) !== null)
3643-
l += utfx.calculateCodePoint(cp);
3643+
l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
36443644
return l;
36453645
}; 10000
36463646

@@ -3653,7 +3653,7 @@
36533653
utfx.calculateUTF16asUTF8 = function(src) {
36543654
var n=0, l=0;
36553655
utfx.UTF16toUTF8(src, function(cp) {
3656-
++n; l += utfx.calculateCodePoint(cp);
3656+
++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
36573657
});
36583658
return [n,l];
36593659
};

dist/ByteBufferAB.min.js

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ByteBufferAB.min.js.gz

11 Bytes
Binary file not shown.

dist/ByteBufferAB.min.map

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

dist/ByteBufferAB_DataView.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
*/
189189
ByteBufferPrototype.__isByteBuffer__;
190190

191-
Object.defineProperty(ByteBuffer.prototype, "__isByteBuffer__", {
191+
Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", {
192192
value: true,
193193
enumerable: false,
194194
configurable: false
@@ -3345,7 +3345,7 @@
33453345
utfx.calculateUTF8 = function(src) {
33463346
var cp, l=0;
33473347
while ((cp = src()) !== null)
3348-
l += utfx.calculateCodePoint(cp);
3348+
l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
33493349
return l;
33503350
};
33513351

@@ -3358,7 +3358,7 @@
33583358
utfx.calculateUTF16asUTF8 = function(src) {
33593359
var n=0, l=0;
33603360
utfx.UTF16toUTF8(src, function(cp) {
3361-
++n; l += utfx.calculateCodePoint(cp);
3361+
++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
33623362
});
33633363
return [n,l];
33643364
};

dist/ByteBufferAB_DataView.min.js

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ByteBufferAB_DataView.min.js.gz

1 Byte
Binary file not shown.

dist/ByteBufferAB_DataView.min.map

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

dist/ByteBufferNB.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ module.exports = (function() {
173173
*/
174174
ByteBufferPrototype.__isByteBuffer__;
175175

176-
Object.defineProperty(ByteBuffer.prototype, "__isByteBuffer__", {
176+
Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", {
177177
value: true,
178178
enumerable: false,
179179
configurable: false
@@ -3367,7 +3367,7 @@ module.exports = (function() {
33673367
utfx.calculateUTF8 = function(src) {
33683368
var cp, l=0;
33693369
1E0A while ((cp = src()) !== null)
3370-
l += utfx.calculateCodePoint(cp);
3370+
l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
33713371
return l;
33723372
};
33733373

@@ -3380,7 +3380,7 @@ module.exports = (function() {
33803380
utfx.calculateUTF16asUTF8 = function(src) {
33813381
var n=0, l=0;
33823382
utfx.UTF16toUTF8(src, function(cp) {
3383-
++n; l += utfx.calculateCodePoint(cp);
3383+
++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;
33843384
});
33853385
return [n,l];
33863386
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"metascript": "~0",
3434
"pretty-hrtime": "^1.0.0",
3535
"testjs": "~1",
36-
"utfx": "~1"
36+
"utfx": "^1.0.1"
3737
},
3838
"license": "Apache-2.0",
3939
"engines": {

0 commit comments

Comments
 (0)
0