From 469a95cda819d784b2030f3e12a3c2ebba3ecc02 Mon Sep 17 00:00:00 2001 From: gardspirito Date: Mon, 18 Jul 2022 18:54:30 +0300 Subject: [PATCH] Use native JavaScript/ECMAScript module syntax --- src/Data/Base64.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Data/Base64.js b/src/Data/Base64.js index 91517f3..48136ae 100644 --- a/src/Data/Base64.js +++ b/src/Data/Base64.js @@ -7,7 +7,7 @@ function validateBase64(s) { } } -exports.encodeBase64Impl = function (buffer) { +export function encodeBase64Impl(buffer) { if (typeof btoa === 'undefined') { // Node return Buffer.from(buffer).toString('base64'); @@ -22,7 +22,7 @@ exports.encodeBase64Impl = function (buffer) { } }; -exports.decodeBase64Impl = function (just, nothing, str) { +export function decodeBase64Impl(just, nothing, str) { try { validateBase64(str); if (typeof atob === 'undefined') { @@ -43,11 +43,11 @@ exports.decodeBase64Impl = function (just, nothing, str) { } }; -exports.fromStringImpl = function (just, nothing, str) { +export function fromStringImpl(just, nothing, str) { try { validateBase64(str); return just(str); } catch (e) { return nothing; } -} \ No newline at end of file +}