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

docuporter

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

docuporter - npm Package Compare versions

Comparing version 0.5.0 to 0.6.4

7

dist/example/simple.js
"use strict";
// This is an example file to show how to use the library
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -10,5 +7,3 @@ // We are goin to make a report on an algorithm that takes three indiviuals with their ages, and a salary table. We are going to determine how much money each of them makes, and how much they make together.

const __1 = require("..");
const path_1 = __importDefault(require("path"));
const fileNameWithoutExt = path_1.default.basename(__filename, path_1.default.extname(__filename));
const mdPath = path_1.default.join('src/example', `${fileNameWithoutExt}.md`);
const mdPath = 'src/example/simple.md';
// We need to instantiate a DocuPorter object with the path to the markdown file where we want to write the report

@@ -15,0 +10,0 @@ const rep = new __1.DocuPorter(mdPath);

6

dist/index.d.ts

@@ -6,2 +6,3 @@ export declare class DocuPorter {

private conditions;
private ticket;
constructor(fileName: string);

@@ -31,2 +32,3 @@ reset(): void;

unMute(): void;
private isNoisy;
setValue(key: string, value: string): void;

@@ -40,2 +42,6 @@ setValues(values: Record<string, string>): void;

clearConditions(): void;
addTicket(ticket: string): void;
useTicket(ticket: string): void;
finishTicket(ticket: string): void;
private anyTicketOngoing;
}

@@ -29,2 +29,8 @@ "use strict";

const fs = __importStar(require("fs"));
var TicketState;
(function (TicketState) {
TicketState[TicketState["New"] = 0] = "New";
TicketState[TicketState["InProgress"] = 1] = "InProgress";
TicketState[TicketState["Used"] = 2] = "Used";
})(TicketState || (TicketState = {}));
class DocuPorter {

@@ -35,2 +41,3 @@ constructor(fileName) {

this.conditions = new Map();
this.ticket = new Map();
this.text = this.appendText;

@@ -53,3 +60,3 @@ this.json = this.appendJson;

append(text) {
if (this.valuesMatch() && !this.muted) {
if (this.isNoisy()) {
fs.appendFileSync(this.filePath, `\n${text}`);

@@ -89,3 +96,3 @@ }

log(...args) {
if (this.valuesMatch() && !this.muted) {
if (this.isNoisy()) {
console.log(...args);

@@ -100,2 +107,5 @@ }

}
isNoisy() {
return this.anyTicketOngoing() || (this.valuesMatch() && !this.muted);
}
setValue(key, value) {

@@ -125,3 +135,15 @@ this.values.set(key, value);

}
addTicket(ticket) {
this.ticket.set(ticket, TicketState.New);
}
useTicket(ticket) {
this.ticket.set(ticket, TicketState.InProgress);
}
finishTicket(ticket) {
this.ticket.set(ticket, TicketState.Used);
}
anyTicketOngoing() {
return Array.from(this.ticket.values()).some(state => state === TicketState.InProgress);
}
}
exports.DocuPorter = DocuPorter;
{
"name": "docuporter",
"version": "0.5.0",
"version": "0.6.4",
"description": "Understand a file by documenting it in a markdown file",

@@ -13,3 +13,4 @@ "main": "dist/index.js",

"build": "tsc",
"example:simple": "ts-node src/example/simple.ts"
"example:simple": "ts-node src/example/simple.ts",
"ci": "npm install && npm run build"
},

@@ -16,0 +17,0 @@ "author": "FrBosquet",

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