From 0a6c1e2ecc7755fdb302978d67a5c67e3c011441 Mon Sep 17 00:00:00 2001 From: dacarson <44933987+dacarson@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:32:09 -0800 Subject: [PATCH] Fix punycode warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #303 Fix punycode warning. Used fix recommended in mathiasbynens/punycode.js#137 --- CHANGELOG.md | 1 + index.js | 4 ++++ package.json | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb25ca6..8903e69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -299,3 +299,4 @@ ## 3.3.6 * The fix in 3.3.4 for tile naming in Home app was not supported with HomeBridge. Add setting of Name property back for HomeBridge compatibility. * Fix issue with threshold triggers and WeatherUnderground. In 3.3.4, WeatherUnderground API call was modified and incorrectly return values in km, and km/h. +* Fix punycode deprication warning. diff --git a/index.js b/index.js index 62823f7..929cf55 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,9 @@ /* jshint esversion: 6,node: true,-W041: false */ "use strict"; + +const moduleAlias = require('module-alias'); +moduleAlias.addAlias('punycode', 'punycode/'); + const weatherunderground = require("./apis/weatherunderground").WundergroundAPI, openweathermap = require("./apis/openweathermap").OpenWeatherMapAPI, weewx = require("./apis/weewx").WeewxAPI, diff --git a/package.json b/package.json index f68d366..71ace0a 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,8 @@ "underscore": "^1.13.6", "request": "^2.88.2", "weather-formulas": "^1", - "node-persist": "^2.1.0" + "node-persist": "^2.1.0", + "module-alias": "^2.2.3" }, "funding": { "type": "buymeacoffee",