Socket
Socket
Sign inDemoInstall

@nuxt/utils

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxt/utils - npm Package Compare versions

Comparing version 2.14.1 to 2.14.2

78

dist/utils.js
/*!
* @nuxt/utils v2.14.1 (c) 2016-2020
* @nuxt/utils v2.14.2 (c) 2016-2020

@@ -12,14 +12,22 @@ * - All the amazing contributors

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
const path = require('path');
const path__default = _interopDefault(path);
const consola = _interopDefault(require('consola'));
const hash = _interopDefault(require('hash-sum'));
const fs = _interopDefault(require('fs-extra'));
const properlock = _interopDefault(require('proper-lockfile'));
const onExit = _interopDefault(require('signal-exit'));
const serialize = _interopDefault(require('serialize-javascript'));
const UAParser = _interopDefault(require('ua-parser-js'));
const consola = require('consola');
const hash = require('hash-sum');
const fs = require('fs-extra');
const properlock = require('proper-lockfile');
const onExit = require('signal-exit');
const serialize = require('serialize-javascript');
const UAParser = require('ua-parser-js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
const path__default = /*#__PURE__*/_interopDefaultLegacy(path);
const consola__default = /*#__PURE__*/_interopDefaultLegacy(consola);
const hash__default = /*#__PURE__*/_interopDefaultLegacy(hash);
const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
const properlock__default = /*#__PURE__*/_interopDefaultLegacy(properlock);
const onExit__default = /*#__PURE__*/_interopDefaultLegacy(onExit);
const serialize__default = /*#__PURE__*/_interopDefaultLegacy(serialize);
const UAParser__default = /*#__PURE__*/_interopDefaultLegacy(UAParser);
const TARGETS = {

@@ -104,3 +112,3 @@ server: 'server',

stale: 30000,
onCompromised: err => consola.warn(err)
onCompromised: err => consola__default['default'].warn(err)
};

@@ -113,5 +121,5 @@

function createLockPath ({ id = 'nuxt', dir, root }) {
const sum = hash(`${root}-${dir}`);
const sum = hash__default['default'](`${root}-${dir}`);
return path__default.resolve(root, 'node_modules/.cache/nuxt', `${id}-lock-${sum}`)
return path__default['default'].resolve(root, 'node_modules/.cache/nuxt', `${id}-lock-${sum}`)
}

@@ -124,3 +132,3 @@

// so the (temporary) lockPath needs to exist
await fs.ensureDir(lockPath);
await fs__default['default'].ensureDir(lockPath);

@@ -134,8 +142,8 @@ return lockPath

try {
const locked = await properlock.check(lockPath);
const locked = await properlock__default['default'].check(lockPath);
if (locked) {
consola.fatal(`A lock with id '${id}' already exists on ${dir}`);
consola__default['default'].fatal(`A lock with id '${id}' already exists on ${dir}`);
}
} catch (e) {
consola.debug(`Check for an existing lock with id '${id}' on ${dir} failed`, e);
consola__default['default'].debug(`Check for an existing lock with id '${id}' on ${dir} failed`, e);
}

@@ -155,7 +163,7 @@

release = await properlock.lock(lockPath, options);
release = await properlock__default['default'].lock(lockPath, options);
} catch (e) {}
if (!release) {
consola.warn(`Unable to get a lock with id '${id}' on ${dir} (but will continue)`);
consola__default['default'].warn(`Unable to get a lock with id '${id}' on ${dir} (but will continue)`);
return false

@@ -166,5 +174,5 @@ }

// make sure to always cleanup our temporary lockPaths
onExit(() => {
onExit__default['default'](() => {
for (const lockPath of lockPaths) {
fs.removeSync(lockPath);
fs__default['default'].removeSync(lockPath);
}

@@ -178,3 +186,3 @@ });

try {
await fs.remove(lockPath);
await fs__default['default'].remove(lockPath);
lockPaths.delete(lockPath);

@@ -187,3 +195,3 @@

if (!lockWasCompromised || !e.message.includes('already released')) {
consola.debug(e);
consola__default['default'].debug(e);
return

@@ -197,4 +205,4 @@ }

const lockDir = `${lockPath}.lock`;
if (await fs.exists(lockDir)) {
await fs.remove(lockDir);
if (await fs__default['default'].exists(lockDir)) {
await fs__default['default'].remove(lockDir);
}

@@ -536,3 +544,3 @@ }

const reqSep = /\//g;
const sysSep = escapeRegExp_1(path__default.sep);
const sysSep = escapeRegExp_1(path__default['default'].sep);
const normalize = string => string.replace(reqSep, sysSep);

@@ -547,3 +555,3 @@

return wp(path__default.resolve(...args.map(normalize)))
return wp(path__default['default'].resolve(...args.map(normalize)))
};

@@ -570,5 +578,5 @@

// Make correct relative path
let rp = path__default.relative(dir, resolvedPath);
let rp = path__default['default'].relative(dir, resolvedPath);
if (rp[0] !== '.') {
rp = '.' + path__default.sep + rp;
rp = '.' + path__default['default'].sep + rp;
}

@@ -600,3 +608,3 @@

warned = true;
consola.warn({
consola__default['default'].warn({
message: `'${prop}' is deprecated'`,

@@ -1751,3 +1759,3 @@ additional: new Error().stack.split('\n').splice(2).join('\n')

dir1.startsWith(dir2) &&
!path__default.basename(dir1).startsWith(path__default.basename(dir2))
!path__default['default'].basename(dir1).startsWith(path__default['default'].basename(dir2))
)

@@ -1757,3 +1765,3 @@ )

const errorMessage = `options.${key2} cannot be a parent of or same as ${key1}`;
consola.fatal(errorMessage);
consola__default['default'].fatal(errorMessage);
throw new Error(errorMessage)

@@ -1833,3 +1841,3 @@ }

func = normalizeFunctions(func);
return serialize(func)
return serialize__default['default'](func)
.replace(serializeFunction.assignmentRE, (_, spaces) => {

@@ -2059,3 +2067,3 @@ return `${spaces}: function (`

}
const { browser } = UAParser(ua);
const { browser } = UAParser__default['default'](ua);
const browserVersion = semver.coerce(browser.version);

@@ -2062,0 +2070,0 @@ if (!browserVersion) {

{
"name": "@nuxt/utils",
"version": "2.14.1",
"version": "2.14.2",
"repository": "nuxt/nuxt.js",

@@ -11,3 +11,3 @@ "license": "MIT",

"dependencies": {
"consola": "^2.14.0",
"consola": "^2.15.0",
"fs-extra": "^8.1.0",

@@ -14,0 +14,0 @@ "hash-sum": "^2.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc