From 7f83f2afd495695bc8ef9298da10b205803a9173 Mon Sep 17 00:00:00 2001 From: Simon Weis Date: Tue, 26 May 2020 22:42:13 +0200 Subject: [PATCH] Require correct module in apploader.js and fix typo in appinfo.js --- bin/apploader.js | 2 +- js/appinfo.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/apploader.js b/bin/apploader.js index fb86540b8..0b80a356e 100644 --- a/bin/apploader.js +++ b/bin/apploader.js @@ -15,6 +15,7 @@ var SETTINGS = { }; var Utils = require("../js/utils.js"); var AppInfo = require("../js/appinfo.js"); +var noble = require('@abandonware/noble'); var apps; function ERROR(msg) { @@ -62,7 +63,6 @@ function cmdInstallApp(appId) { } function bangleSend(command) { - var noble = require('noble'); var log = function() { var args = [].slice.call(arguments); console.log("UART: "+args.join(" ")); diff --git a/js/appinfo.js b/js/appinfo.js index 54cc1b7af..22d2c2152 100644 --- a/js/appinfo.js +++ b/js/appinfo.js @@ -2,7 +2,7 @@ if (typeof btoa==="undefined") { // Don't define btoa as a function here because Apple's // iOS browser defines the function even though it's in // an IF statement that is never executed! - btoa = function(d) { return BufferA.from(d).toString('base64'); } + btoa = function(d) { return Buffer.from(d).toString('base64'); } } // Converts a string into most efficient way to send to Espruino (either json, base64, or compressed base64)