版博士V2.0程序
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

19 řádky
489 B

  1. "use strict";
  2. const { atob } = require("abab");
  3. exports.stripLeadingAndTrailingASCIIWhitespace = string => {
  4. return string.replace(/^[ \t\n\f\r]+/u, "").replace(/[ \t\n\f\r]+$/u, "");
  5. };
  6. exports.isomorphicDecode = input => {
  7. return Array.from(input, byte => String.fromCodePoint(byte)).join("");
  8. };
  9. exports.forgivingBase64Decode = data => {
  10. const asString = atob(data);
  11. if (asString === null) {
  12. return null;
  13. }
  14. return Uint8Array.from(asString, c => c.codePointAt(0));
  15. };