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

elm-review

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elm-review - npm Package Compare versions

Comparing version 2.9.0 to 2.9.1

2

lib/optimize-js.js

@@ -432,3 +432,3 @@ const util = require('util');

} else {
const json = JSON.stringify(context);
const json = JSON.stringify(context, global.elmJsonReplacer);
stringifyMap.set(context, json);

@@ -435,0 +435,0 @@ return json;

@@ -7,2 +7,30 @@ module.exports = {

function replacer(key, value) {
if (typeof value === 'object') {
// TODO Serialize Dicts also
// if (value.$ === -1) {
// return {
// $: '$D',
// a: toDictProd(value, {})
// };
// }
if (
value.$ === 1 &&
value.a !== undefined &&
value.b !== undefined &&
value.c === undefined
) {
const list = prudent_List_toArray(value);
if (list === null) {
return value;
}
return {
$: '$L',
a: list
};
}
return value;
}
if (Number.isNaN(value)) {

@@ -23,5 +51,28 @@ return '$$elm-review$$NaN';

function prudent_List_toArray(xs) {
const out = [];
for (; xs.b; xs = xs.b) {
if (xs.a === undefined || xs.c !== undefined) {
return null;
}
out.push(xs.a);
}
if (xs.$ !== 0 || xs.a !== undefined) {
return null;
}
return out;
}
function reviver(_, value) {
const type_ = typeof value;
if (type_ === 'object' && value.$ === '$L') {
return _List_fromArray_PROD(value.a);
}
if (
typeof value !== 'string' ||
type_ !== 'string' ||
value === null ||

@@ -44,1 +95,11 @@ !value.startsWith('$$elm-review$$')

}
const _List_Nil_PROD = {$: 0};
function _List_fromArray_PROD(array) {
let out = _List_Nil_PROD;
for (let i = array.length; i--; ) {
out = {$: 1, a: array[i], b: out};
}
return out;
}

@@ -55,2 +55,3 @@ const path = require('path');

options.resultCacheFolder || options.resultCachePath(appHash);
global.elmJsonReplacer = ResultCacheJson.replacer;

@@ -57,0 +58,0 @@ global.loadResultFromCache = (ruleName, ruleId) => {

{
"name": "elm-review",
"version": "2.9.0",
"version": "2.9.1",
"description": "Run elm-review from Node.js",

@@ -5,0 +5,0 @@ "engines": {

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