Gathering detailed insights and metrics for power-assert-formatter
Gathering detailed insights and metrics for power-assert-formatter
Gathering detailed insights and metrics for power-assert-formatter
Gathering detailed insights and metrics for power-assert-formatter
npm install power-assert-formatter
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
6 Stars
380 Commits
3 Forks
12 Watching
1 Branches
9 Contributors
Updated on 13 Aug 2018
Minified
Minified + Gzipped
JavaScript (99.46%)
HTML (0.54%)
Cumulative downloads
Total Downloads
Last day
-19.5%
22,446
Compared to previous day
Last week
7.4%
175,106
Compared to previous week
Last month
10.8%
640,782
Compared to previous month
Last year
-28.2%
6,559,534
Compared to previous year
7
28
Power Assert output formatter.
power-assert-formatter
is a formatter module for Power Assert output.
Pull-requests, issue reports and patches are always welcomed. See power-assert project for more documentation.
See CHANGELOG
return type |
---|
function |
Returns creator function for power-assert.
return type |
---|
function |
Create formatter function with options. options
argument is optional.
type | default value |
---|---|
object | (return value of createFormatter.defaultOptions() ) |
Configuration options. If not passed, default options will be used.
type | default value |
---|---|
number | 5 |
Threshold to show diff at character level or line level. If number of lines in target string is greater than lineDiffThreshold
, then line diff mode will be used to show diff output.
type | default value |
---|---|
number | 1 |
Depth of object traversal. If object depth is greater than maxDepth
, compound object (IOW, Array
or object
) will be pruned with #
like ["foo",#Array#,#Object#]
.
type | default value |
---|---|
number | 2 |
Number of spaces inserted at the left in power-assert output.
type | default value |
---|---|
string | "Object" |
Type name to show when target object is created by anonymous constructor.
type | default value |
---|---|
string | "#@Circular#" |
Name to show when target object is detected as circular structure.
type | default value |
---|---|
string | "\n" |
Line separator in power assert output.
type | default value |
---|---|
number | 2 |
Width of 'Ambiguous' characters defined in Unicode Standard Annex #11 EAST ASIAN WIDTH. Configure options.ambiguousEastAsianCharWidth
to treat ambiguous east asian character as fullwidth (= 2
) or narrow (= 1
). Default is 2
.
type | default value |
---|---|
function | string-width.js |
Function to calculate width of string.
type | default value |
---|---|
function | stringifier module |
Function to stringify any target value.
type | default value |
---|---|
function | udiff.js |
Function to create diff string between two strings.
type | default value |
---|---|
function | string-writer.js |
Constructor Function for output writer class.
type | default value |
---|---|
Array of (string or function ) | shown below |
1[ 2 './built-in/file', 3 './built-in/assertion', 4 './built-in/diagram', 5 './built-in/binary-expression' 6]
Output renderers. Power assert output is rendered by renderers in order. You can create custom renderer and add its constructor function to customize power-assert-output.
1[ 2 './built-in/file', 3 './built-in/assertion', 4 YourCustomRenderer, 5 './built-in/binary-expression' 6]
Returns default options object for createFormatter function. In other words, returns
1{ 2 lineDiffThreshold: 5, 3 maxDepth: 1, 4 anonymous: 'Object', 5 circular: '#@Circular#', 6 lineSeparator: '\n', 7 ambiguousEastAsianCharWidth: 2, 8 renderers: [ 9 './built-in/file', 10 './built-in/assertion', 11 './built-in/diagram', 12 './built-in/binary-expression' 13 ] 14};
return type |
---|
string |
Format powerAssertContext
into formattedText
. powerAssertContext
is an internal object structure, containing informations to render. Example of powerAssertContext
is:
1{ 2 source: { 3 content: "assert.equal(foo, bar)", 4 filepath: "/path/to/some_test.js", 5 line: 1 6 }, 7 args: [ 8 { 9 value: "foo", 10 events: [ 11 { 12 value: "foo", 13 espath: "arguments/0" 14 } 15 ] 16 }, 17 { 18 value: "bar", 19 events: [ 20 { 21 value: "bar", 22 espath: "arguments/1" 23 } 24 ] 25 } 26 ] 27}
Note that structure of powerAssertContext may change.
Install
$ npm install --save-dev power-assert-formatter
powerAssertFormatter
function is exported
<script type="text/javascript" src="./path/to/node_modules/power-assert-formatter/build/power-assert-formatter.js"></script>
Install
$ bower install --save-dev power-assert-formatter
Then load (powerAssertFormatter
function is exported)
<script type="text/javascript" src="./path/to/bower_components/power-assert-formatter/build/power-assert-formatter.js"></script>
Licensed under the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More