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

extra-javascript-text

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extra-javascript-text - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

144

index.d.ts
/**
* String match function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/StringMatchFunction)
* @param full full string
*/
* */
declare type StringMatchFunction = (full: string) => void;
/**
* Match string in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/forEachString)
* @param txt javascript text
* @param fn match function
*/
* */
declare function forEachString(txt: string, fn: StringMatchFunction): void;
/**
* Get strings in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/strings)
* @param txt javascript text
* @returns strings
*/
* */
declare function strings(txt: string): string[];
/**
* String replace function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/StringReplaceFunction)
* @param full full string
* @returns updated string
*/
* */
declare type StringReplaceFunction = (full: string) => string;
/**
* Replace strings in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/replaceStrings)
* @param txt javascript text
* @param fn replace function
* @returns updated javascript text
*/
* */
declare function replaceStrings(txt: string, fn: StringReplaceFunction): string;
/**
* Tag strings in javascript text and remove them.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/tagStrings)
* @param txt javascript text
* @returns [updated javascript text, tags]
*/
* */
declare function tagStrings(txt: string): [string, Map<string, string>];
/**
* Untag strings in javascript text by adding them back.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/untagStrings)
* @param txt javascript text
* @param tags tags
* @returns updated javascript text
*/
* */
declare function untagStrings(txt: string, tags: Map<string, string>): string;
/**
* Comment match function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/CommentMatchFunction)
* @param full full comment
*/
* */
declare type CommentMatchFunction = (full: string) => void;
/**
* Match links in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/forEachComment)
* @param txt javascript text
* @param fn match function
*/
* */
declare function forEachComment(txt: string, fn: CommentMatchFunction): void;
/**
* Get comments in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/comments)
* @param txt javascript text
* @returns comments
*/
* */
declare function comments(txt: string): string[];
/**
* Comment replace function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/CommentReplaceFunction)
* @param full full comment
* @returns updated comment
*/
* */
declare type CommentReplaceFunction = (full: string) => string;
/**
* Replace comments in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/replaceComments)
* @param txt javascript text
* @param fn replace function
* @returns updated javascript text
*/
* */
declare function replaceComments(txt: string, fn: CommentReplaceFunction): string;
/**
* Tag comments in javascript text and remove them.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/tagComments)
* @param txt javascript text
* @returns [updated javascript text, tags]
*/
* */
declare function tagComments(txt: string): [string, Map<string, string>];
/**
* Untag comments in javascript text by adding them back.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/untagComments)
* @param txt javascript text
* @param tags tags
* @returns updated javascript text
*/
* */
declare function untagComments(txt: string, tags: Map<string, string>): string;
/**
* Remove comments from javascript text.
* @param {string} txt javascript text
* @param {boolean} empty keep empty lines?
*/
* [📘](https://github.com/nodef/extra-javascript-text/wiki/uncomment)
* */
declare function uncomment(txt: string, empty?: boolean): string;
/**
* JSDoc symbol match function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/JsdocSymbolMatchFunction)
* @param full full jsdoc symbol match

@@ -101,11 +130,18 @@ * @param jsdoc jsdoc attached to symbol

* @param isDefault symbol is default?
*/
* */
declare type JsdocSymbolMatchFunction = (full: string, jsdoc: string, name: string, kind: string, isExported: boolean, isDefault: boolean) => void;
/**
* Match jsdoc symbols in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/forEachJsdocSymbol)
* @param txt javascript text
* @param fn match function
*/
* */
declare function forEachJsdocSymbol(txt: string, fn: JsdocSymbolMatchFunction): void;
/** JSDoc symbol. */
/**
* JSDoc symbol.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/JsdocSymbol)
* */
interface JsdocSymbol {

@@ -127,8 +163,11 @@ /** Full jsdoc symbol match. */

* Get jsdoc symbols in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/jsdocSymbols)
* @param txt javascript text
* @returns jsdoc symbols
*/
* */
declare function jsdocSymbols(txt: string): JsdocSymbol[];
/**
* Jsdoc symbol replace function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/JsdocSymbolReplaceFunction)
* @param full full jsdoc symbol match

@@ -141,13 +180,17 @@ * @param jsdoc jsdoc attached to symbol

* @returns updated jsdoc symbol
*/
* */
declare type JsdocSymbolReplaceFunction = (full: string, jsdoc: string, name: string, kind: string, isExported: boolean, isDefault: boolean) => string;
/**
* Replace jsdoc symbols in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/replaceJsdocSymbols)
* @param txt javascript text
* @param fn replace function
* @returns updated javascript text
*/
* */
declare function replaceJsdocSymbols(txt: string, fn: JsdocSymbolReplaceFunction): string;
/**
* Export symbol match function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/ExportSymbolMatchFunction)
* @param full full export symbol match

@@ -157,11 +200,18 @@ * @param name symbol name

* @param isDefault symbol is default?
*/
* */
declare type ExportSymbolMatchFunction = (full: string, name: string, kind: string, isDefault: boolean) => void;
/**
* Match export symbols in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/forEachExportSymbol)
* @param txt javascript text
* @param fn match function
*/
* */
declare function forEachExportSymbol(txt: string, fn: ExportSymbolMatchFunction): void;
/** Export symbol. */
/**
* Export symbol.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/ExportSymbol)
* */
interface ExportSymbol {

@@ -179,8 +229,11 @@ /** Full export symbol match. */

* Get export symbols in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/exportSymbols)
* @param txt javascript text
* @returns export symbols
*/
* */
declare function exportSymbols(txt: string): ExportSymbol[];
/**
* Export symbol replace function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/ExportSymbolReplaceFunction)
* @param full full export symbol match

@@ -191,24 +244,35 @@ * @param name symbol name

* @returns updated export symbol
*/
* */
declare type ExportSymbolReplaceFunction = (full: string, name: string, kind: string, isDefault: boolean) => string;
/**
* Replace export symbols in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/replaceExportSymbols)
* @param txt javascript text
* @param fn replace function
* @returns updated javascript text
*/
* */
declare function replaceExportSymbols(txt: string, fn: ExportSymbolReplaceFunction): string;
/**
* Import symbol match function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/ImportSymbolMatchFunction)
* @param full full import symbol match
* @param file import file
*/
* */
declare type ImportSymbolMatchFunction = (full: string, file: string) => void;
/**
* Match import symbols in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/forEachImportSymbol)
* @param txt javascript text
* @param fn match function
*/
* */
declare function forEachImportSymbol(txt: string, fn: ImportSymbolMatchFunction): void;
/** Import symbol. */
/**
* Import symbol.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/ImportSymbol)
* */
interface ImportSymbol {

@@ -222,28 +286,36 @@ /** Full import symbol match. */

* Get import symbols in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/importSymbols)
* @param txt javascript text
* @returns export symbols
*/
* */
declare function importSymbols(txt: string): ImportSymbol[];
/**
* Import symbol replace function.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/ImportSymbolReplaceFunction)
* @param full full import symbol match
* @param file import file
* @returns updated import symbol
*/
* */
declare type ImportSymbolReplaceFunction = (full: string, file: string) => string;
/**
* Replace import symbols in javascript text.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/replaceImportSymbols)
* @param txt javascript text
* @param fn replace function
* @returns updated javascript text
*/
* */
declare function replaceImportSymbols(txt: string, fn: ImportSymbolReplaceFunction): string;
/**
* Correct type declarations after generation.
* [📘](https://github.com/nodef/extra-javascript-text/wiki/correctDeclarations)
* @param txt javascript text
* @param module module name
* @returns corrected javascript text
*/
* */
declare function correctDeclarations(txt: string, module?: string): string;
export { CommentMatchFunction, CommentReplaceFunction, ExportSymbol, ExportSymbolMatchFunction, ExportSymbolReplaceFunction, ImportSymbol, ImportSymbolMatchFunction, ImportSymbolReplaceFunction, JsdocSymbol, JsdocSymbolMatchFunction, JsdocSymbolReplaceFunction, StringMatchFunction, StringReplaceFunction, comments, correctDeclarations, exportSymbols, forEachComment, forEachExportSymbol, forEachImportSymbol, forEachJsdocSymbol, forEachString, importSymbols, jsdocSymbols, replaceComments, replaceExportSymbols, replaceImportSymbols, replaceJsdocSymbols, replaceStrings, strings, tagComments, tagStrings, uncomment, untagComments, untagStrings };
{
"name": "extra-javascript-text",
"version": "0.1.5",
"version": "0.1.6",
"description": "Utilities for processing JavaScript text.",

@@ -15,8 +15,5 @@ "main": "index.js",

"build": "node ./build",
"deploy": "node ./build deploy"
"publish-docs": "node ./build publish-docs",
"publish-packages": "node ./build publish-packages"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nodef/extra-javascript.git"
},
"keywords": [

@@ -26,34 +23,43 @@ "extra",

"text",
"tag-strings",
"untag-strings",
"comment-match-function",
"for-each-comment",
"ExportSymbol",
"ImportSymbol",
"JsdocSymbol",
"CommentMatchFunction",
"CommentReplaceFunction",
"ExportSymbolMatchFunction",
"ExportSymbolReplaceFunction",
"ImportSymbolMatchFunction",
"ImportSymbolReplaceFunction",
"JsdocSymbolMatchFunction",
"JsdocSymbolReplaceFunction",
"StringMatchFunction",
"StringReplaceFunction",
"comments",
"comment-replace-function",
"replace-comments",
"tag-comments",
"untag-comments",
"correctDeclarations",
"exportSymbols",
"forEachComment",
"forEachExportSymbol",
"forEachImportSymbol",
"forEachJsdocSymbol",
"forEachString",
"importSymbols",
"jsdocSymbols",
"replaceComments",
"replaceExportSymbols",
"replaceImportSymbols",
"replaceJsdocSymbols",
"replaceStrings",
"strings",
"tagComments",
"tagStrings",
"uncomment",
"jsdoc-symbol-match-function",
"for-each-jsdoc-symbol",
"jsdoc-symbol",
"jsdoc-symbols",
"jsdoc-symbol-replace-function",
"replace-jsdoc-symbols",
"export-symbol-match-function",
"for-each-export-symbol",
"export-symbol",
"export-symbols",
"export-symbol-replace-function",
"replace-export-symbols",
"import-symbol-match-function",
"for-each-import-symbol",
"import-symbol",
"import-symbols",
"import-symbol-replace-function",
"replace-import-symbols",
"correct-declarations"
"untagComments",
"untagStrings"
],
"author": "wolfram77@gmail.com",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/nodef/extra-javascript.git"
},
"bugs": {

@@ -64,9 +70,9 @@ "url": "https://github.com/nodef/extra-javascript/issues"

"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/node": "^17.0.23",
"extra-build": "^2.0.29",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/node": "^18.6.2",
"extra-build": "^2.2.21",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^4.2.0"
"rollup-plugin-dts": "^4.2.2"
}
}
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