Comparing version 4.2.1 to 4.3.1
'use strict'; | ||
// Declare internals | ||
const internals = {}; | ||
@@ -96,3 +94,3 @@ | ||
const hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex'); | ||
const hexValue = Buffer.from(String.fromCharCode(charCode), 'ascii').toString('hex'); | ||
return '\\x' + internals.padLeft(hexValue, 2); | ||
@@ -113,3 +111,3 @@ }; | ||
const hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex'); | ||
const hexValue = Buffer.from(String.fromCharCode(charCode), 'ascii').toString('hex'); | ||
return '&#x' + internals.padLeft(hexValue, 2) + ';'; | ||
@@ -116,0 +114,0 @@ }; |
'use strict'; | ||
// Load modules | ||
const Crypto = require('crypto'); | ||
@@ -11,4 +9,2 @@ const Path = require('path'); | ||
// Declare internals | ||
const internals = {}; | ||
@@ -39,3 +35,3 @@ | ||
if (Buffer.isBuffer(obj)) { | ||
newObj = new Buffer(obj); | ||
newObj = Buffer.from(obj); | ||
} | ||
@@ -805,3 +801,3 @@ else if (obj instanceof Date) { | ||
exports.assert(typeof value === 'string' || Buffer.isBuffer(value), 'value must be string or buffer'); | ||
const buf = (Buffer.isBuffer(value) ? value : new Buffer(value, encoding || 'binary')); | ||
const buf = (Buffer.isBuffer(value) ? value : Buffer.from(value, encoding || 'binary')); | ||
return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); | ||
@@ -825,3 +821,3 @@ }; | ||
const buf = new Buffer(value, 'base64'); | ||
const buf = Buffer.from(value, 'base64'); | ||
return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary')); | ||
@@ -828,0 +824,0 @@ }; |
{ | ||
"name": "hoek", | ||
"description": "General purpose node utilities", | ||
"version": "4.2.1", | ||
"version": "4.3.1", | ||
"repository": "git://github.com/hapijs/hoek", | ||
"engines": { | ||
"node": ">=6.0.0" | ||
}, | ||
"main": "lib/index.js", | ||
@@ -10,15 +13,12 @@ "keywords": [ | ||
], | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"code": "4.x.x", | ||
"lab": "13.x.x" | ||
"lab": "14.x.x" | ||
}, | ||
"scripts": { | ||
"test": "lab -a code -t 100 -L", | ||
"test-cov-html": "lab -a code -t 100 -L -r html -o coverage.html" | ||
"test": "lab -a code -t 100 -L -l", | ||
"test-cov-html": "lab -a code -t 100 -L -r html -o coverage.html -l" | ||
}, | ||
"license": "BSD-3-Clause" | ||
"license": "SEE LICENSE IN LICENSE.md" | ||
} |
@@ -1,13 +0,11 @@ | ||
![hoek Logo](https://raw.github.com/hapijs/hoek/master/images/hoek.png) | ||
# hoek | ||
Utility methods for the hapi ecosystem. This module is not intended to solve every problem for everyone, but rather as a central place to store hapi-specific methods. If you're looking for a general purpose utility module, check out [lodash](https://github.com/lodash/lodash) or [underscore](https://github.com/jashkenas/underscore). | ||
[![Build Status](https://secure.travis-ci.org/hapijs/hoek.svg)](http://travis-ci.org/hapijs/hoek) | ||
[![Build Status](https://travis-ci.org/hapijs/hoek.svg?branch=v4-commercial)](https://travis-ci.org/hapijs/hoek) | ||
<a href="https://andyet.com"><img src="https://s3.amazonaws.com/static.andyet.com/images/%26yet-logo.svg" align="right" /></a> | ||
## License | ||
Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf) | ||
This version of the package requires a commercial license. You may not use, copy, or distribute it without first acquiring a commercial license from Sideway Inc. Using this software without a license is a violation of US and international law. To obtain a license, please contact [sales@sideway.com](mailto:sales@sideway.com). The open source version of this package can be found [here](https://github.com/hapijs/hoek). | ||
**hoek** is sponsored by [&yet](https://andyet.com) | ||
## Usage | ||
@@ -14,0 +12,0 @@ |
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
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
30512
1
1
80
808
29
1