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

annotate-code

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

annotate-code - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

4

dist/cjs/index.js

@@ -38,5 +38,3 @@ "use strict";

return {
message: RED +
`index ${pos} past buffer of size ${size}: ${pos} > ${size}` +
RESET,
message: RED + `index ${pos} past buffer of size ${size}: ${pos} > ${size}` + RESET,
};

@@ -43,0 +41,0 @@ }

@@ -35,5 +35,3 @@ // colors

return {
message: RED +
`index ${pos} past buffer of size ${size}: ${pos} > ${size}` +
RESET,
message: RED + `index ${pos} past buffer of size ${size}: ${pos} > ${size}` + RESET,
};

@@ -40,0 +38,0 @@ }

@@ -6,3 +6,3 @@ {

"description": "beautifully annotate source code with a message, given an index, like a parser or compiler",
"version": "2.0.1",
"version": "2.0.2",
"license": "MIT",

@@ -27,10 +27,2 @@ "repository": {

},
"targets": {
"main": {
"context": "node",
"engines": {
"node": ">=16.0"
}
}
},
"files": [

@@ -40,47 +32,56 @@ "dist"

"scripts": {
"build": "npm run clean && npm run build:cjs && npm run build:esm && echo done.",
"docs": "documentation readme src --resolve=node --pe ts --re ts --re d.ts --github --section=API --markdown-toc-max-depth=3",
"start": "vite-open example/web.ts",
"start:https": "vite-open --https example/web.ts",
"build:watch": "tsc -p tsconfig.dist.json --outDir dist/esm --module esnext --watch & tsc -p tsconfig.dist.json --outDir dist/cjs --watch",
"cov:watch": "jest --coverage --watchAll",
"test": "echo ok",
"test:node": "jest",
"test:web": "web-test-runner",
"cov": "jest --coverage",
"example": "fpick example --repeat -- node -r @swc-node/register",
"docs": "documentation readme src --resolve=node --pe ts --re ts --re d.ts --github --section=API --markdown-toc-max-depth=3",
"build": "npm run build:cjs && npm run build:esm && echo done.",
"build:cjs": "tsc -p tsconfig.dist.json --outDir dist/cjs",
"build:esm": "tsc -p tsconfig.dist.json --outDir dist/esm --module esnext && echo '{\"type\":\"module\"}' >dist/esm/package.json",
"build:bundle": "esbuild dist/esm/index.js --bundle --format=esm --outfile=\"$(cat package.json | jq -r '.name').js\" && wc -c \"$(cat package.json | jq -r '.name').js\"",
"build:min": "esbuild dist/esm/index.js --bundle --format=esm | terser --compress --module --mangle -o \"$(cat package.json | jq -r '.name').min.js\" && wc -c \"$(cat package.json | jq -r '.name').min.js\"",
"lint": "eslint src && prettier --check src",
"build:watch": "onchange -i src --await-write-finish 400 -- npm run build",
"docs:watch": "onchange -i src --await-write-finish 400 -- npm run docs",
"test:watch": "jest --watchAll",
"cov:watch": "jest --coverage --watchAll",
"example:watch": "fpick example --repeat -- onchange -i src example --await-write-finish 400 --kill -- node -r @swc-node/register",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.esm.json && echo '{\"type\":\"module\"}' >dist/esm/package.json",
"lint:fix": "eslint --fix src && prettier --write src",
"clean": "rimraf dist",
"prepack": "npm run build",
"prepack": "npm run clean && npm run build",
"prepack:dry": "npm pack --dry-run",
"prepare": "husky install"
"prepush": "npm run lint && npm run test",
"prepare": "husky install && node .pull-configs.js"
},
"devDependencies": {
"@swc-node/jest": "^1.4.1",
"@swc-node/register": "^1.4.0",
"@n1kk/intspector": "^1.0.2",
"@rollup/plugin-commonjs": "^21.0.1",
"@stagas/documentation-fork": "^13.2.5",
"@stagas/sucrase-jest-plugin": "^2.2.0-fork",
"@swc-node/jest": "^1.4.3",
"@tsconfig/node16": "^1.0.2",
"@types/jest": "^27.0.3",
"@types/node": "^16.11.9",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@web/dev-server-esbuild": "^0.2.16",
"@web/test-runner": "^0.13.22",
"benny": "^3.7.1",
"benny-ascii-chart-reporter": "^1.0.1",
"documentation": "github:documentationjs/documentation",
"eslint": "^8.3.0",
"eslint-plugin-import": "^2.25.3",
"fpick": "^1.1.0",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.18",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"@web/dev-server-rollup": "^0.3.15",
"@web/test-runner": "^0.13.27",
"esbuild": "^0.14.22",
"eslint": "^8.9.0",
"eslint-config-html-jsx": "^1.0.0",
"eslint-plugin-import": "^2.25.4",
"husky": "^7.0.4",
"jest": "^27.3.1",
"jest": "^27.5.1",
"jest-browser-globals": "^25.1.0-beta",
"onchange": "^7.1.0",
"prettier": "^2.4.1",
"prettier": "^2.5.1",
"pull-configs": "^0.2.0",
"rimraf": "^3.0.2",
"ts-node": "^10.4.0",
"typescript": "^4.5.2"
"swcno": "^0.1.1",
"terser": "^5.10.0",
"ts-jest": "^27.1.3",
"ts-node": "^10.5.0",
"typescript": "^4.5.5",
"vite-open": "^1.2.0",
"vite-web-test-runner-plugin": "^0.1.0"
}
}

@@ -34,3 +34,3 @@ <h1 align="center">annotate-code</h1>

size: 6,
code,
input,
}).message

@@ -53,3 +53,3 @@ )

[src/index.ts:44-160](https://github.com/stagas/annotate-code/blob/4390275c76e1c9b679c13fdb38f4e1b138672f64/src/index.ts#L44-L160 "Source code on GitHub")
[src/index.ts:44-155](https://github.com/stagas/annotate-code/blob/24f21ac6f7ca15849a13a7dc3d2928995df903f3/src/index.ts#L44-L155 "Source code on GitHub")

@@ -60,11 +60,11 @@ Annotates a source code string given an index and a message.

* `settings` **{message: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), code: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), index: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), linesBefore: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, linesAfter: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, size: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, showLineNumbers: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?}**&#x20;
* `settings` **{message: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), input: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), index: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), linesBefore: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, linesAfter: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, size: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, showLineNumbers: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?}**&#x20;
* `settings.message` The message to display
* `settings.code` The code to annotate
* `settings.input` The code to annotate
* `settings.index` The index position
* `settings.linesBefore` How many lines before to show&#x20;(optional, default `3`)
* `settings.linesAfter` How many lines after to show&#x20;(optional, default `3`)
* `settings.size` The size of the arrows ^^^^&#x20;(optional, default `1`)
* `settings.showLineNumbers` Whether to show line numbers&#x20;(optional, default `true`)
* `settings.linesBefore` How many lines before to show (optional, default `3`)
* `settings.linesAfter` How many lines after to show (optional, default `3`)
* `settings.size` The size of the arrows ^^^^ (optional, default `1`)
* `settings.showLineNumbers` Whether to show line numbers (optional, default `true`)

@@ -71,0 +71,0 @@ Returns **{line: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, col: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, message: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}**&#x20;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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