Socket
Socket
Sign inDemoInstall

@hapi/hoek

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/hoek - npm Package Compare versions

Comparing version 7.2.1 to 8.0.0

11

lib/index.d.ts

@@ -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 @@

29

lib/index.js
'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 @@

2

package.json
{
"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",

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