Comparing version 2.1.0 to 2.2.0
14
index.js
@@ -15,2 +15,3 @@ 'use strict'; | ||
proto.message = message; | ||
proto.info = info; | ||
proto.fail = fail; | ||
@@ -157,4 +158,3 @@ | ||
/* Create a message with `reason` at `position`. | ||
* When an error is passed in as `reason`, copies the | ||
* stack. This does not add a message to `messages`. */ | ||
* When an error is passed in as `reason`, copies the stack. */ | ||
function message(reason, position, ruleId) { | ||
@@ -217,2 +217,12 @@ var filePath = this.path; | ||
/* Info. Creates a vmessage, associates it with the file, | ||
* and marks the fatality as null. */ | ||
function info() { | ||
var message = this.message.apply(this, arguments); | ||
message.fatal = null; | ||
return message; | ||
} | ||
/* Inherit from `Error#`. */ | ||
@@ -219,0 +229,0 @@ function VMessagePrototype() {} |
{ | ||
"name": "vfile", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Virtual file format for text processing", | ||
@@ -22,2 +22,3 @@ "license": "MIT", | ||
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"Brendan Abbott <brendan.abbott@temando.com>", | ||
"Denys Dovhan <email@denysdovhan.com>", | ||
@@ -39,3 +40,3 @@ "Kyle Mathews <mathews.kyle@gmail.com>", | ||
"esmangle": "^1.0.0", | ||
"nyc": "^10.0.0", | ||
"nyc": "^11.0.0", | ||
"remark-cli": "^3.0.0", | ||
@@ -42,0 +43,0 @@ "remark-preset-wooorm": "^3.0.0", |
@@ -45,2 +45,3 @@ # ![vfile][] | ||
* [VFile#message(reason\[, position\[, ruleId\]\])](#vfilemessagereason-position-ruleid) | ||
* [VFile#info(reason\[, position\[, ruleId\]\])](#vfileinforeason-position-ruleid) | ||
* [VFile#fail(reason\[, position\[, ruleId\]\])](#vfilefailreason-position-ruleid) | ||
@@ -210,3 +211,4 @@ * [VFileMessage](#vfilemessage) | ||
Associates a message with the file for `reason` at `position`. When an | ||
error is passed in as `reason`, copies the stack. | ||
error is passed in as `reason`, copies the stack. Each message has a `fatal` | ||
property which by default is set to `false` (ie. `warning`). | ||
@@ -220,3 +222,3 @@ ###### Parameters | ||
* `ruleId` (`string`, optional) | ||
— Category of warning | ||
— Category of message | ||
@@ -227,2 +229,11 @@ ###### Returns | ||
### `VFile#info(reason[, position[, ruleId]])` | ||
Associates an informational message with the file, where `fatal` is set to | ||
`null`. Calls [`#message()`][messages] internally. | ||
###### Returns | ||
[`VFileMessage`][message]. | ||
### `VFile#fail(reason[, position[, ruleId]])` | ||
@@ -229,0 +240,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
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
18648
224
302