Socket
Socket
Sign inDemoInstall

anser

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anser - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

4

lib/index.js

@@ -195,4 +195,4 @@ "use strict";

value: function escapeForHtml(txt) {
return txt.replace(/[&<>]/gm, function (str) {
return str == "&" ? "&amp;" : str == "<" ? "&lt;" : str == ">" ? "&gt;" : "";
return txt.replace(/[&<>\"]/gm, function (str) {
return str == "&" ? "&amp;" : str == '"' ? "&quot;" : str == "<" ? "&lt;" : str == ">" ? "&gt;" : "";
});

@@ -199,0 +199,0 @@ }

{
"name": "anser",
"version": "2.1.0",
"version": "2.1.1",
"description": "A low level parser for ANSI sequences.",

@@ -93,2 +93,2 @@ "keywords": [

]
}
}

@@ -283,106 +283,15 @@ <!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->

### `linkify(txt)`
Adds HTML link elements.
#### Params
- **String** `txt`: The input text.
#### Return
- **String** The HTML output containing link elements.
### `ansiToHtml(txt, options)`
Converts ANSI input into HTML output.
#### Params
- **String** `txt`: The input text.
- **Object** `options`: The options passed ot the `process` method.
#### Return
- **String** The HTML output.
### `ansiToJson(txt, options)`
Converts ANSI input into HTML output.
#### Params
- **String** `txt`: The input text.
- **Object** `options`: The options passed ot the `process` method.
#### Return
- **String** The JSON output.
### `ansiToText(txt)`
Converts ANSI input into HTML output.
#### Params
- **String** `txt`: The input text.
#### Return
- **String** The text output.
### `process(txt, options, markup)`
Processes the input.
#### Params
- **String** `txt`: The input text.
- **Object** `options`: An object passed to `processChunk` method, extended with:
- `json` (Boolean): If `true`, the result will be an object.
- `use_classes` (Boolean): If `true`, HTML classes will be appended to the HTML output.
- **Boolean** `markup`:
### `processChunkJson(text, options, markup)`
Processes the current chunk into json output.
#### Params
- **String** `text`: The input text.
- **Object** `options`: An object containing the following fields:
- `json` (Boolean): If `true`, the result will be an object.
- `use_classes` (Boolean): If `true`, HTML classes will be appended to the HTML output.
- **Boolean** `markup`: If false, the colors will not be parsed.
#### Return
- **Object** The result object:
- `content` (String): The text.
- `fg` (String|null): The foreground color.
- `bg` (String|null): The background color.
- `fg_truecolor` (String|null): The foreground true color (if 16m color is enabled).
- `bg_truecolor` (String|null): The background true color (if 16m color is enabled).
- `clearLine` (Boolean): `true` if a carriageReturn \r was fount at end of line.
- `was_processed` (Bolean): `true` if the colors were processed, `false` otherwise.
- `isEmpty` (Function): A function returning `true` if the content is empty, or `false` otherwise.
Add several widely used style codes
### `processChunk(text, options, markup)`
Processes the current chunk of text.
#### Params
- **String** `text`: The input text.
- **Object** `options`: An object containing the following fields:
- `json` (Boolean): If `true`, the result will be an object.
- `use_classes` (Boolean): If `true`, HTML classes will be appended to the HTML output.
- **Boolean** `markup`: If false, the colors will not be parsed.
#### Return
- **Object|String** The result (object if `json` is wanted back or string otherwise).
## :yum: How to contribute

@@ -446,2 +355,3 @@ Have an idea? Found a bug? See [how to contribute][contributing].

- `redux-devtools-trace-monitor`
- `@opensumi/ide-debug`
- `@kui-shell/plugin-client-common`

@@ -453,4 +363,4 @@ - `react-webpack-build-helper`

- `react-dev-utils-extra`
- `ansi-html-themed`
- `webpack-isomorphic-dev-middleware`
- `ansi-html-themed`
- `react-native-okhttp-fork`

@@ -460,3 +370,2 @@ - `uyun-react-dev-utils`

- `react-dev-utils-sebfl-update`
- `@jjavery/react-error-overlay`
- `lambda-dev-utils`

@@ -471,3 +380,2 @@ - `ipynb2html`

- `react-native-ytximkit`
- `@mindinventory/rn-top-navbar`
- `cycle-dev-utils`

@@ -482,7 +390,10 @@ - `@viankakrisna/react-error-overlay`

- `react-native-is7`
- `@nib/e2e-core`
- `react-native-biometric-authenticate`
- `react-native-tvos-nz`
- `@mindinventory/rn-top-navbar`
- `rn-adyen-dropin`
- `@classyllama/code-style`
- `react-native-ansi-view`
- `@corelmax/react-native-my2c2p-sdk`
- `@proteria/react-scripts`
- `@prague-digi/react-error-overlay`
- `native-apple-login`

@@ -493,6 +404,8 @@ - `react-ansi`

- `@blkmarketco/components-library`
- `@datalogic/react-native-datalogic-module`
- `ansi-to-react-with-options`
- `callstack-task-react-error-overlay`
- `@datalogic/react-native-datalogic-module`
- `@tasumaniadiabori/react-native-draggable-flatlist`
- `react-native-flyy`
- `@prague-digi/react-error-overlay`
- `@geeky-apo/react-native-advanced-clipboard`

@@ -502,10 +415,11 @@ - `@apardellass/react-native-audio-stream`

- `react-native-responsive-size`
- `singularityui-tailer`
- `rn-flatlist-fork`
- `@unforgiven/react-native`
- `ansi-to-react-with-classes`
- `react-native-dsphoto-module`
- `react-native-tvos`
- `react-error-guard`
- `react-native-sayhello-module`
- `@plansys/react-dev-utils`
- `singularityui-tailer`
- `react-native-tvos`
- `@saad27/react-native-bottom-tab-tour`
- `react-native-plugpag-wrapper`

@@ -521,2 +435,3 @@ - `react-native-pulsator-native`

- `ada-pack`
- `@jjavery/react-error-overlay`
- `@office-iss/react-native-win32`

@@ -533,2 +448,3 @@ - `react-native-sf`

- `@digibear/socket-bridge`
- `userfetch`

@@ -535,0 +451,0 @@

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