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
@types/power-assert-formatter
TypeScript definitions for power-assert-formatter
power-assert-context-formatter
format power-assert context
retyped-power-assert-formatter-tsd-ambient
TypeScript typings for power-assert-formatter
@ryancavanaugh/power-assert-formatter
Type definitions for power-assert-formatter from https://www.github.com/DefinitelyTyped/DefinitelyTyped
npm install power-assert-formatter
Typescript
Module System
Node Version
NPM Version
JavaScript (99.46%)
HTML (0.54%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
6 Stars
380 Commits
3 Forks
11 Watchers
1 Branches
9 Contributors
Updated on Aug 13, 2018
Latest Version
1.4.1
Package Id
power-assert-formatter@1.4.1
Size
91.97 kB
NPM Version
3.9.5
Node Version
6.2.2
Published on
Jul 05, 2016
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
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
Found 0/24 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- 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 2025-06-30
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