Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

power-assert-renderer-comparison

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

power-assert-renderer-comparison - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

lib/default-options.js

41

index.js

@@ -6,6 +6,8 @@ 'use strict';

var typeName = require('type-name');
var keys = Object.keys || require('object-keys');
var forEach = require('array-foreach');
var keys = require('core-js/library/fn/object/keys');
var forEach = require('core-js/library/fn/array/for-each');
var udiff = require('./lib/udiff');
var stringifier = require('stringifier');
var assign = require('core-js/library/fn/object/assign');
var defaultOptions = require('./lib/default-options');
var literalPattern = /^(?:String|Numeric|Null|Boolean|RegExp)?Literal$/;

@@ -17,4 +19,15 @@

/**
* options.stringify [function]
* options.maxDepth [number]
* options.lineSeparator [string]
* options.anonymous [string]
* options.circular [string]
*
* options.diff [function]
* options.lineDiffThreshold [number]
*/
function ComparisonRenderer (config) {
BaseRenderer.call(this, config);
BaseRenderer.call(this);
this.config = assign({}, defaultOptions(), config);
if (typeof this.config.stringify !== 'function') {

@@ -32,15 +45,15 @@ this.stringify = stringifier(this.config);

var pair;
if (!esNode.isCaptured()) {
if (isTargetBinaryExpression(esNode.getParent()) && isLiteral(esNode.currentNode)) {
this.espathToPair[esNode.parentEspath][esNode.currentProp] = {code: esNode.code(), value: esNode.value()};
if (!esNode.isCaptured) {
if (isTargetBinaryExpression(esNode.parent) && isLiteral(esNode.node)) {
this.espathToPair[esNode.parent.espath][esNode.key] = {code: esNode.code, value: esNode.value};
}
return;
}
if (isTargetBinaryExpression(esNode.getParent())) {
this.espathToPair[esNode.parentEspath][esNode.currentProp] = {code: esNode.code(), value: esNode.value()};
if (isTargetBinaryExpression(esNode.parent)) {
this.espathToPair[esNode.parent.espath][esNode.key] = {code: esNode.code, value: esNode.value};
}
if (isTargetBinaryExpression(esNode)) {
pair = {
operator: esNode.currentNode.operator,
value: esNode.value()
operator: esNode.node.operator,
value: esNode.value
};

@@ -90,6 +103,6 @@ this.espathToPair[esNode.espath] = pair;

return esNode &&
esNode.currentNode.type === 'BinaryExpression' &&
(esNode.currentNode.operator === '===' || esNode.currentNode.operator === '==') &&
esNode.isCaptured() &&
!(esNode.value());
esNode.node.type === 'BinaryExpression' &&
(esNode.node.operator === '===' || esNode.node.operator === '==') &&
esNode.isCaptured &&
!(esNode.value);
}

@@ -96,0 +109,0 @@

{
"name": "power-assert-renderer-comparison",
"description": "comparison renderer for power-assert context",
"version": "0.1.0",
"version": "1.0.0",
"author": {

@@ -14,7 +14,6 @@ "name": "Takuto Wada",

"dependencies": {
"array-foreach": "^1.0.1",
"core-js": "^2.0.0",
"googlediff": "^0.1.0",
"object-keys": "^1.0.4",
"power-assert-renderer-base": "^0.1.0",
"stringifier": "^1.2.1",
"stringifier": "^1.3.0",
"type-name": "^2.0.1"

@@ -21,0 +20,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc