code-block-writer
Advanced tools
Comparing version 11.0.0 to 11.0.1
@@ -1,3 +0,8 @@ | ||
import { CommentChar } from "./comment_char.js"; | ||
import { escapeForWithinString, getStringFromStrOrFunc } from "./utils/string_utils.js"; | ||
/** @internal */ | ||
var CommentChar; | ||
(function (CommentChar) { | ||
CommentChar[CommentChar["Line"] = 0] = "Line"; | ||
CommentChar[CommentChar["Star"] = 1] = "Star"; | ||
})(CommentChar || (CommentChar = {})); | ||
// Using the char codes is a performance improvement (about 5.5% faster when writing because it eliminates additional string allocations). | ||
@@ -4,0 +9,0 @@ const CHARS = { |
{ | ||
"module": "./esm/mod.js", | ||
"main": "./umd/mod.js", | ||
"main": "./script/mod.js", | ||
"types": "./types/mod.d.ts", | ||
"name": "code-block-writer", | ||
"version": "11.0.0", | ||
"version": "11.0.1", | ||
"description": "A simple code writer that assists with formatting and visualizing blocks of code.", | ||
@@ -25,6 +25,5 @@ "repository": { | ||
"devDependencies": { | ||
"@types/node": "16.11.1", | ||
"@types/node": "16.11.37", | ||
"chalk": "4.1.2", | ||
"chai": "4.3.4", | ||
"deno.ns": "0.6.4", | ||
"@deno/shim-deno": "~0.6.0", | ||
"@types/chai": "^4.2.22" | ||
@@ -35,3 +34,3 @@ }, | ||
"import": "./esm/mod.js", | ||
"require": "./umd/mod.js", | ||
"require": "./script/mod.js", | ||
"types": "./types/mod.d.ts" | ||
@@ -42,6 +41,3 @@ } | ||
"test": "node test_runner.js" | ||
}, | ||
"dependencies": { | ||
"tslib": "2.3.1" | ||
} | ||
} |
@@ -8,5 +8,5 @@ # code-block-writer | ||
Code writer that assists with formatting and visualizing blocks of JavaScript or TypeScript code. | ||
Code writer for JavaScript or TypeScript code. | ||
With Deno/Browser: | ||
With Deno: | ||
@@ -31,15 +31,14 @@ ```ts | ||
const writer = new CodeBlockWriter({ | ||
// optional options | ||
newLine: "\r\n", // default: "\n" | ||
indentNumberOfSpaces: 2, // default: 4 | ||
useTabs: false, // default: false | ||
useSingleQuote: true // default: false | ||
// optional options | ||
newLine: "\r\n", // default: "\n" | ||
indentNumberOfSpaces: 2, // default: 4 | ||
useTabs: false, // default: false | ||
useSingleQuote: true // default: false | ||
}); | ||
const className = "MyClass"; | ||
writer.write(`class ${className} extends OtherClass`).block(() => { | ||
writer.writeLine(`@MyDecorator(1, 2)`); | ||
writer.write(`myMethod(myParam: any)`).block(() => { | ||
writer.write("return this.post(").quote("myArgument").write(");"); | ||
}); | ||
writer.write("class MyClass extends OtherClass").block(() => { | ||
writer.writeLine(`@MyDecorator(1, 2)`); | ||
writer.write(`myMethod(myParam: any)`).block(() => { | ||
writer.write("return this.post(").quote("myArgument").write(");"); | ||
}); | ||
}); | ||
@@ -52,3 +51,5 @@ | ||
```text | ||
<!-- dprint-ignore --> | ||
```js | ||
class MyClass extends OtherClass { | ||
@@ -55,0 +56,0 @@ @MyDecorator(1, 2) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
4
119
0
80144
11
2099
- Removedtslib@2.3.1
- Removedtslib@2.3.1(transitive)