@hapi/hoek
Advanced tools
Comparing version 7.2.1 to 8.0.0
@@ -404,13 +404,2 @@ /** | ||
/** | ||
Generate a random file name within a given path and optional extension. | ||
@param path - The file path within to generate a temporary file. | ||
@param extension - File extension. | ||
@return The generarted filename. | ||
*/ | ||
export function uniqueFilename(path: string, extension?: string): string; | ||
/** | ||
Converts a JavaScript value to a JavaScript Object Notation (JSON) string with protection against thrown errors. | ||
@@ -417,0 +406,0 @@ |
'use strict'; | ||
const Assert = require('assert'); | ||
const Crypto = require('crypto'); | ||
const Path = require('path'); | ||
const DeepEqual = require('./deep-equal'); | ||
@@ -610,9 +606,5 @@ const Escape = require('./escape'); | ||
throw new Assert.AssertionError({ | ||
message: msgs.join(' ') || 'Unknown error', | ||
actual: false, | ||
expected: true, | ||
operator: '==', | ||
stackStartFunction: exports.assert | ||
}); | ||
const error = new Error(msgs.join(' ') || 'Unknown error'); | ||
Error.captureStackTrace(error, exports.assert); | ||
throw error; | ||
}; | ||
@@ -703,17 +695,2 @@ | ||
exports.uniqueFilename = function (path, extension) { | ||
if (extension) { | ||
extension = extension[0] !== '.' ? '.' + extension : extension; | ||
} | ||
else { | ||
extension = ''; | ||
} | ||
path = Path.resolve(path); | ||
const name = [Date.now(), process.pid, Crypto.randomBytes(8).toString('hex')].join('-') + extension; | ||
return Path.join(path, name); | ||
}; | ||
exports.stringify = function (...args) { | ||
@@ -720,0 +697,0 @@ |
{ | ||
"name": "@hapi/hoek", | ||
"description": "General purpose node utilities", | ||
"version": "7.2.1", | ||
"version": "8.0.0", | ||
"repository": "git://github.com/hapijs/hoek", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
42947
1142