@unavatar/core 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@unavatar/core",
3
3
  "description": "Get unified user avatar from social networks, including Instagram, SoundCloud, Telegram, Twitter, YouTube & more.",
4
4
  "homepage": "https://unavatar.io",
5
- "version": "0.0.7",
5
+ "version": "0.0.8",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js",
package/src/constant.js CHANGED
@@ -9,7 +9,6 @@ const DEFAULTS = {
9
9
  TTL_DEFAULT: ms('28d'),
10
10
  TMP_FOLDER: existsSync('/dev/shm') ? '/dev/shm' : '/tmp',
11
11
  DEBUG_HTML_TO_FILE: false,
12
- PUPPETEER_RANDOM_DIR: false
13
12
  }
14
13
 
15
14
  DEFAULTS.PROXY_TIMEOUT = Math.floor(DEFAULTS.REQUEST_TIMEOUT * (1 / 3))
@@ -5,11 +5,11 @@ const { randomUUID } = require('crypto')
5
5
  const puppeteer = require('puppeteer')
6
6
  const path = require('path')
7
7
 
8
- module.exports = ({ TMP_FOLDER, PUPPETEER_RANDOM_DIR }) => {
8
+ module.exports = ({ TMP_FOLDER, isTest }) => {
9
9
  const PUPPETEER_BASE_DIR = path.join(TMP_FOLDER, 'puppeteer')
10
10
 
11
- const getPuppeteerDir = PUPPETEER_RANDOM_DIR
12
- ? () => `${PUPPETEER_BASE_DIR}-${randomUUID()}`
11
+ const getPuppeteerDir = isTest
12
+ ? () => path.join(`${PUPPETEER_BASE_DIR}-${randomUUID()}`)
13
13
  : () => PUPPETEER_BASE_DIR
14
14
 
15
15
  const getArgs = () => {