template-utils
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -5,3 +5,3 @@ 'use strict'; | ||
* Add default properties to an object. | ||
* | ||
* | ||
* @param {Object} `o` Object to add properties to. | ||
@@ -13,4 +13,9 @@ * @param {Array} `props` Property names to look for. | ||
module.exports = function defaults(o, props, fallback) { | ||
if (o == null) { | ||
throw new Error('template-utils.defaults() expects an object.'); | ||
} | ||
var len = props.length; | ||
var i = 0; | ||
while (len--) { | ||
@@ -17,0 +22,0 @@ var prop = props[i++]; |
{ | ||
"name": "template-utils", | ||
"description": "Utils for [Template](https://github.com/jonschlinkert/template).", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"homepage": "https://github.com/jonschlinkert/template-utils", | ||
@@ -21,2 +21,6 @@ "author": { | ||
}, | ||
"files": [ | ||
"index.js", | ||
"lib/" | ||
], | ||
"main": "index.js", | ||
@@ -26,6 +30,2 @@ "engines": { | ||
}, | ||
"files": [ | ||
"index.js", | ||
"lib/" | ||
], | ||
"scripts": { | ||
@@ -38,6 +38,6 @@ "test": "mocha" | ||
"escape-delims": "^0.4.0", | ||
"export-files": "^1.0.0", | ||
"export-files": "^1.1.0", | ||
"extend-shallow": "^0.2.0", | ||
"extract-gfm": "^0.1.0", | ||
"gray-matter": "^1.2.3", | ||
"gray-matter": "^1.2.5", | ||
"merge-deep": "^0.1.3", | ||
@@ -51,3 +51,3 @@ "object.pick": "^1.1.1", | ||
"should": "^5.0.0", | ||
"verb": "^0.3.9" | ||
"verb": "^0.5.0" | ||
}, | ||
@@ -54,0 +54,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
# template-utils [![NPM version](https://badge.fury.io/js/template-utils.svg)](http://badge.fury.io/js/template-utils) | ||
# template-utils [![NPM version](https://badge.fury.io/js/template-utils.svg)](http://badge.fury.io/js/template-utils) [![Build Status](https://travis-ci.org/jonschlinkert/template-utils.svg)](https://travis-ci.org/jonschlinkert/template-utils) | ||
@@ -11,8 +11,10 @@ > Utils for [Template](https://github.com/jonschlinkert/template). | ||
## Run tests | ||
## Running tests | ||
Install dev dependencies. | ||
```bash | ||
npm test | ||
npm i -d && npm test | ||
``` | ||
## Usage | ||
@@ -29,3 +31,3 @@ | ||
### [.defaultProps](lib/utils/defaultProps.js#L14) | ||
### [.defaultProps](./lib/utils/defaultProps.js#L14) | ||
@@ -36,3 +38,3 @@ * `template` **{Object}**: Template Object to add properties to. | ||
### [.headings](lib/utils/headings.js#L22) | ||
### [.headings](./lib/utils/headings.js#L22) | ||
@@ -53,4 +55,5 @@ Adjust markdown heading levels. | ||
### [.parsePath](lib/utils/parsePath.js#L15) | ||
### [.parsePath](./lib/utils/parsePath.js#L15) | ||
* `template` **{Object}**: Template object | ||
@@ -60,3 +63,3 @@ | ||
### [.toTemplate](lib/utils/toTemplate.js#L23) | ||
### [.toTemplate](./lib/utils/toTemplate.js#L23) | ||
@@ -72,3 +75,3 @@ Convert a Vinyl file object to a non-vinyl template object. | ||
### [.toVinyl](lib/utils/toVinyl.js#L19) | ||
### [.toVinyl](./lib/utils/toVinyl.js#L19) | ||
@@ -102,2 +105,2 @@ Convert a `template` object to a Vinyl file object. | ||
_This file was generated by [verb](https://github.com/assemble/verb) on February 01, 2015._ | ||
_This file was generated by [verb](https://github.com/assemble/verb) on February 25, 2015._ |
Sorry, the diff of this file is not supported yet
12938
18
302
99
Updatedexport-files@^1.1.0
Updatedgray-matter@^1.2.5