diff options
author | Vitaly Takmazov | 2023-05-31 06:10:51 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-05-31 06:11:05 +0300 |
commit | f2a7ea3af919548d41383734e8a3667086a44bcc (patch) | |
tree | e0d9db07956f10ccc4e27fc9e0d45d88950dbfbb /vnext/server/sape.js | |
parent | 395185d093b2d6bb46d02830088e00a3a2ca20c1 (diff) |
eslint: enforce semicolons only before statement continuation chars
Diffstat (limited to 'vnext/server/sape.js')
-rw-r--r-- | vnext/server/sape.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/vnext/server/sape.js b/vnext/server/sape.js index ad374f2b..cff9b48a 100644 --- a/vnext/server/sape.js +++ b/vnext/server/sape.js @@ -1,9 +1,9 @@ -import { parseStringPromise } from 'xml2js'; -import axios from 'axios'; -import { setupCache } from 'axios-cache-interceptor'; -import config from 'config'; +import { parseStringPromise } from 'xml2js' +import axios from 'axios' +import { setupCache } from 'axios-cache-interceptor' +import config from 'config' -const token = config.get('service.sape.token') || process.env.SAPE_TOKEN; +const token = config.get('service.sape.token') || process.env.SAPE_TOKEN /** @external Promise */ @@ -14,19 +14,19 @@ const token = config.get('service.sape.token') || process.env.SAPE_TOKEN; */ export const getLinks = async (uri, sapeCookie) => { if (!token) { - console.warn('Sape is not configured'); - return []; + console.warn('Sape is not configured') + return [] } - const response = await sape.get(`http://dispencer-01.sape.ru/code.php?user=${token}&host=juick.com&charset=UTF-8&as_xml=true`); - const data = await parseStringPromise(response.data); - const showCode = token === sapeCookie; - const requestURI = showCode ? '*' : uri; + const response = await sape.get(`http://dispencer-01.sape.ru/code.php?user=${token}&host=juick.com&charset=UTF-8&as_xml=true`) + const data = await parseStringPromise(response.data) + const showCode = token === sapeCookie + const requestURI = showCode ? '*' : uri const page = data.sape.page.filter(page => { - const uri = page['$']['uri']; - return uri === requestURI; - }); - return page.length > 0 ? showCode ? [page[0]._] : page[0].link : []; -}; + const uri = page['$']['uri'] + return uri === requestURI + }) + return page.length > 0 ? showCode ? [page[0]._] : page[0].link : [] +} /** @type { import('axios-cache-interceptor').AxiosCacheInstance } */ let sape = setupCache( @@ -36,4 +36,4 @@ let sape = setupCache( } }), { ttl: 3600 * 1000 } -); +) |