finki-main
main
|
Last change
on this file since 62b2964 was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
874 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Continues with the callback on the next tick.
|
|---|
| 3 | * @function
|
|---|
| 4 | * @param {function(...[*])} callback Callback to execute
|
|---|
| 5 | * @inner
|
|---|
| 6 | */
|
|---|
| 7 | var nextTick = typeof process !== 'undefined' && process && typeof process.nextTick === 'function'
|
|---|
| 8 | ? (typeof setImmediate === 'function' ? setImmediate : process.nextTick)
|
|---|
| 9 | : setTimeout;
|
|---|
| 10 |
|
|---|
| 11 | /**
|
|---|
| 12 | * Converts a JavaScript string to UTF8 bytes.
|
|---|
| 13 | * @param {string} str String
|
|---|
| 14 | * @returns {!Array.<number>} UTF8 bytes
|
|---|
| 15 | * @inner
|
|---|
| 16 | */
|
|---|
| 17 | function stringToBytes(str) {
|
|---|
| 18 | var out = [],
|
|---|
| 19 | i = 0;
|
|---|
| 20 | utfx.encodeUTF16toUTF8(function() {
|
|---|
| 21 | if (i >= str.length) return null;
|
|---|
| 22 | return str.charCodeAt(i++);
|
|---|
| 23 | }, function(b) {
|
|---|
| 24 | out.push(b);
|
|---|
| 25 | });
|
|---|
| 26 | return out;
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | //? include("util/base64.js");
|
|---|
| 30 |
|
|---|
| 31 | //? include("../../node_modules/utfx/dist/utfx-embeddable.js");
|
|---|
| 32 |
|
|---|
| 33 | Date.now = Date.now || function() { return +new Date; };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.