Comparing version 2.14.0 to 2.15.0
@@ -911,4 +911,11 @@ // Load modules | ||
exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source object: must be null, undefined, or an object'); | ||
exports.assert(source === null || source === undefined || typeof source === 'object' || Array.isArray(source), 'Invalid source object: must be null, undefined, an object, or an array'); | ||
if (Array.isArray(source)) { | ||
return source.map(function (obj) { | ||
return exports.transform(obj, transform, options); | ||
}); | ||
} | ||
var result = {}; | ||
@@ -915,0 +922,0 @@ var keys = Object.keys(transform); |
{ | ||
"name": "hoek", | ||
"description": "General purpose node utilities", | ||
"version": "2.14.0", | ||
"version": "2.15.0", | ||
"repository": "git://github.com/hapijs/hoek", | ||
"main": "index", | ||
"main": "lib/index.js", | ||
"keywords": [ | ||
@@ -11,3 +11,3 @@ "utilities" | ||
"engines": { | ||
"node": ">=0.8.0" | ||
"node": ">=0.10.40" | ||
}, | ||
@@ -20,5 +20,6 @@ "dependencies": {}, | ||
"scripts": { | ||
"test": "make test-cov" | ||
"test": "lab -a code -t 100 -L", | ||
"test-cov-html": "lab -a code -t 100 -L -r html -o coverage.html" | ||
}, | ||
"license": "BSD-3-Clause" | ||
} |
@@ -5,3 +5,3 @@ ![hoek Logo](https://raw.github.com/hapijs/hoek/master/images/hoek.png) | ||
[![Build Status](https://secure.travis-ci.org/hapijs/hoek.png)](http://travis-ci.org/hapijs/hoek) | ||
[![Build Status](https://secure.travis-ci.org/hapijs/hoek.svg)](http://travis-ci.org/hapijs/hoek) | ||
@@ -26,3 +26,3 @@ Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf) | ||
* [reach](#reachobj-chain-options "reach") | ||
* [reachTemplate](#reachobj-template-options "reachTemplate") | ||
* [reachTemplate](#reachtemplateobj-template-options "reachTemplate") | ||
* [transform](#transformobj-transform-options "transform") | ||
@@ -50,4 +50,5 @@ * [shallow](#shallowobj "shallow") | ||
* [Miscellaneous](#miscellaneous "Miscellaneous") | ||
* [uniqueFilename](#uniquefilename "uniqueFilename") | ||
* [isInteger](#isInteger "isInteger") | ||
* [uniqueFilename](#uniquefilenamepath-extension "uniqueFilename") | ||
* [isAbsolutePath](#isabsolutepathpath-platform "isAbsolutePath") | ||
* [isInteger](#isintegervalue "isInteger") | ||
@@ -194,3 +195,3 @@ | ||
var config = Hoek.applyToDefaults(defaults, options); // results in { server: { port: 8080 }, name: 'example' } | ||
var config = Hoek.applyToDefaultsWithShallow(defaults, options, ['server']); // results in { server: { port: 8080 }, name: 'example' } | ||
``` | ||
@@ -331,3 +332,3 @@ | ||
Transforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options. | ||
Transforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options. The first argument can also be an array of objects. In that case the method will return an array of transformed objects. | ||
@@ -573,2 +574,9 @@ ```javascript | ||
### isAbsolutePath(path, [platform]) | ||
Determines whether `path` is an absolute path. Returns `true` or `false`. | ||
- `path` - A file path to test for whether it is absolute or not. | ||
- `platform` - An optional parameter used for specifying the platform. Defaults to `process.platform`. | ||
### isInteger(value) | ||
@@ -575,0 +583,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
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
154626
2700
583
15