New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

derw

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

derw - npm Package Compare versions

Comparing version 0.0.3-31 to 0.0.3-32

4

build/cli/install.js

@@ -37,2 +37,6 @@ "use strict";

const isInstallNewPackage = program.flags.name.isPresent;
if (argv.length > 3 && !(isInstallNewPackage || isQuiet)) {
showInstallHelp();
return;
}
const packageFile = await package_1.loadPackageFile("derw-package.json");

@@ -39,0 +43,0 @@ if (packageFile.kind === "err") {

@@ -35,2 +35,3 @@ "use strict";

baner_1.longFlag("file", "A particular file name to run", baner_1.string()),
baner_1.longFlag("only-fails", "Only log failing tests", baner_1.empty()),
baner_1.bothFlag("h", "help", "This help text", baner_1.empty()),

@@ -37,0 +38,0 @@ ]);

10

build/generators/derw.js

@@ -482,7 +482,13 @@ "use strict";

function generateConst(constDef) {
const body = common_1.prefixLines(generateExpression(constDef.value), 4);
const maybeLetBody = constDef.letBody.length > 0
? common_1.prefixLines("\nlet", 4) +
"\n" +
common_1.prefixLines(constDef.letBody.map(generateBlock).join("\n\n"), 8) +
common_1.prefixLines("\nin", 4)
: "";
const typeDef = generateTopLevelType(constDef.type);
const body = common_1.prefixLines(generateExpression(constDef.value), maybeLetBody === "" ? 4 : 8);
return `
${constDef.name}: ${typeDef}
${constDef.name} =
${constDef.name} =${maybeLetBody}
${body}

@@ -489,0 +495,0 @@ `.trim();

@@ -479,7 +479,13 @@ "use strict";

function generateConst(constDef) {
const body = common_1.prefixLines(generateExpression(constDef.value), 4);
const maybeLetBody = constDef.letBody.length > 0
? common_1.prefixLines("\nlet", 4) +
"\n" +
common_1.prefixLines(constDef.letBody.map(generateBlock).join("\n\n"), 8) +
common_1.prefixLines("\nin", 4)
: "";
const typeDef = generateTopLevelType(constDef.type);
const body = common_1.prefixLines(generateExpression(constDef.value), maybeLetBody === "" ? 4 : 8);
return `
${constDef.name}: ${typeDef}
${constDef.name} =
${constDef.name} =${maybeLetBody}
${body}

@@ -486,0 +492,0 @@ `.trim();

@@ -543,2 +543,12 @@ "use strict";

}
function generateNestedConst(constDef, body) {
const generatedBlocks = constDef.letBody
.map((block) => generateBlock(block))
.join("\n");
return `(function() {
${common_1.prefixLines(generatedBlocks, 4)}
return ${body};
})()
`.trim();
}
function generateConst(constDef) {

@@ -548,11 +558,26 @@ let body = "";

case "IfStatement": {
body = generateInlineIf(constDef.value);
if (constDef.letBody.length === 0) {
body = generateInlineIf(constDef.value);
}
else {
body = generateNestedConst(constDef, generateInlineIf(constDef.value));
}
break;
}
case "CaseStatement": {
body = generateInlineCase(constDef.value);
if (constDef.letBody.length === 0) {
body = generateInlineCase(constDef.value);
}
else {
body = generateNestedConst(constDef, generateInlineCase(constDef.value));
}
break;
}
default: {
body = generateExpression(constDef.value);
if (constDef.letBody.length === 0) {
body = generateExpression(constDef.value);
}
else {
body = generateNestedConst(constDef, generateExpression(constDef.value));
}
break;

@@ -559,0 +584,0 @@ }

@@ -763,2 +763,13 @@ "use strict";

}
function generateNestedConst(constDef, body) {
const typeDef = generateTopLevelType(constDef.type);
const generatedBlocks = constDef.letBody
.map((block) => generateBlock(block, [], []))
.join("\n");
return `(function(): ${typeDef} {
${common_1.prefixLines(generatedBlocks, 4)}
return ${body};
})()
`.trim();
}
function generateConst(constDef) {

@@ -768,11 +779,26 @@ let body = "";

case "IfStatement": {
body = generateInlineIf(constDef.value);
if (constDef.letBody.length === 0) {
body = generateInlineIf(constDef.value);
}
else {
body = generateNestedConst(constDef, generateInlineIf(constDef.value));
}
break;
}
case "CaseStatement": {
body = generateInlineCase(constDef.value);
if (constDef.letBody.length === 0) {
body = generateInlineCase(constDef.value);
}
else {
body = generateNestedConst(constDef, generateInlineCase(constDef.value));
}
break;
}
default: {
body = generateExpression(constDef.value);
if (constDef.letBody.length === 0) {
body = generateExpression(constDef.value);
}
else {
body = generateNestedConst(constDef, generateExpression(constDef.value));
}
break;

@@ -779,0 +805,0 @@ }

@@ -282,5 +282,6 @@ import { Maybe } from "@eeue56/ts-core/build/main/lib/maybe";

type: Type;
letBody: Block[];
value: Expression;
};
export declare function Const(name: string, type: Type, value: Expression): Const;
export declare function Const(name: string, type: Type, letBody: Block[], value: Expression): Const;
export declare type ImportNamespace = "Global" | "Relative";

@@ -287,0 +288,0 @@ export declare type ImportModule = {

@@ -400,3 +400,3 @@ "use strict";

exports.Function = Function;
function Const(name, type, value) {
function Const(name, type, letBody, value) {
return {

@@ -406,2 +406,3 @@ kind: "Const",

type,
letBody,
value,

@@ -408,0 +409,0 @@ };

{
"name": "derw",
"version": "0.0.3-31",
"version": "0.0.3-32",
"description": "An Elm-inspired language that transpiles to TypeScript",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -60,4 +60,9 @@ import {

const isQuiet = program.flags.quiet.isPresent;
const isInstallNewPackage = program.flags.name.isPresent;
const isInstallNewPackage = program.flags.name.isPresent;
if (argv.length > 3 && !(isInstallNewPackage || isQuiet)) {
showInstallHelp();
return;
}
const packageFile = await loadPackageFile("derw-package.json");

@@ -64,0 +69,0 @@

@@ -20,2 +20,3 @@ import { runner } from "@eeue56/bach/build/bach";

longFlag("file", "A particular file name to run", string()),
longFlag("only-fails", "Only log failing tests", empty()),
bothFlag("h", "help", "This help text", empty()),

@@ -22,0 +23,0 @@ ]);

@@ -638,7 +638,17 @@ import {

function generateConst(constDef: Const): string {
const body = prefixLines(generateExpression(constDef.value), 4);
const maybeLetBody =
constDef.letBody.length > 0
? prefixLines("\nlet", 4) +
"\n" +
prefixLines(constDef.letBody.map(generateBlock).join("\n\n"), 8) +
prefixLines("\nin", 4)
: "";
const typeDef = generateTopLevelType(constDef.type);
const body = prefixLines(
generateExpression(constDef.value),
maybeLetBody === "" ? 4 : 8
);
return `
${constDef.name}: ${typeDef}
${constDef.name} =
${constDef.name} =${maybeLetBody}
${body}

@@ -645,0 +655,0 @@ `.trim();

@@ -625,7 +625,17 @@ import {

function generateConst(constDef: Const): string {
const body = prefixLines(generateExpression(constDef.value), 4);
const maybeLetBody =
constDef.letBody.length > 0
? prefixLines("\nlet", 4) +
"\n" +
prefixLines(constDef.letBody.map(generateBlock).join("\n\n"), 8) +
prefixLines("\nin", 4)
: "";
const typeDef = generateTopLevelType(constDef.type);
const body = prefixLines(
generateExpression(constDef.value),
maybeLetBody === "" ? 4 : 8
);
return `
${constDef.name}: ${typeDef}
${constDef.name} =
${constDef.name} =${maybeLetBody}
${body}

@@ -632,0 +642,0 @@ `.trim();

@@ -757,2 +757,13 @@ import { exportTests } from "../blocks";

function generateNestedConst(constDef: Const, body: string): string {
const generatedBlocks = constDef.letBody
.map((block) => generateBlock(block))
.join("\n");
return `(function() {
${prefixLines(generatedBlocks, 4)}
return ${body};
})()
`.trim();
}
function generateConst(constDef: Const): string {

@@ -763,11 +774,32 @@ let body = "";

case "IfStatement": {
body = generateInlineIf(constDef.value);
if (constDef.letBody.length === 0) {
body = generateInlineIf(constDef.value);
} else {
body = generateNestedConst(
constDef,
generateInlineIf(constDef.value)
);
}
break;
}
case "CaseStatement": {
body = generateInlineCase(constDef.value);
if (constDef.letBody.length === 0) {
body = generateInlineCase(constDef.value);
} else {
body = generateNestedConst(
constDef,
generateInlineCase(constDef.value)
);
}
break;
}
default: {
body = generateExpression(constDef.value);
if (constDef.letBody.length === 0) {
body = generateExpression(constDef.value);
} else {
body = generateNestedConst(
constDef,
generateExpression(constDef.value)
);
}
break;

@@ -774,0 +806,0 @@ }

@@ -1091,2 +1091,14 @@ import { exportTests } from "../blocks";

function generateNestedConst(constDef: Const, body: string): string {
const typeDef = generateTopLevelType(constDef.type);
const generatedBlocks = constDef.letBody
.map((block) => generateBlock(block, [ ], [ ]))
.join("\n");
return `(function(): ${typeDef} {
${prefixLines(generatedBlocks, 4)}
return ${body};
})()
`.trim();
}
function generateConst(constDef: Const): string {

@@ -1097,11 +1109,32 @@ let body = "";

case "IfStatement": {
body = generateInlineIf(constDef.value);
if (constDef.letBody.length === 0) {
body = generateInlineIf(constDef.value);
} else {
body = generateNestedConst(
constDef,
generateInlineIf(constDef.value)
);
}
break;
}
case "CaseStatement": {
body = generateInlineCase(constDef.value);
if (constDef.letBody.length === 0) {
body = generateInlineCase(constDef.value);
} else {
body = generateNestedConst(
constDef,
generateInlineCase(constDef.value)
);
}
break;
}
default: {
body = generateExpression(constDef.value);
if (constDef.letBody.length === 0) {
body = generateExpression(constDef.value);
} else {
body = generateNestedConst(
constDef,
generateExpression(constDef.value)
);
}
break;

@@ -1108,0 +1141,0 @@ }

@@ -798,6 +798,12 @@ import { Maybe } from "@eeue56/ts-core/build/main/lib/maybe";

type: Type;
letBody: Block[];
value: Expression;
};
export function Const(name: string, type: Type, value: Expression): Const {
export function Const(
name: string,
type: Type,
letBody: Block[],
value: Expression
): Const {
return {

@@ -807,2 +813,3 @@ kind: "Const",

type,
letBody,
value,

@@ -809,0 +816,0 @@ };

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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