Skip to content

Commit da6e745

Browse files
committed
build(project): improved the README files
1 parent f82298d commit da6e745

File tree

6 files changed

+93
-89
lines changed

6 files changed

+93
-89
lines changed

packages/partials/array/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# LiteRT/Utils - Array
2+
3+
[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
4+
[![npm version](https://img.shields.io/npm/v/@litert/utils-array.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/utils-array "Stable Version")
5+
[![License](https://img.shields.io/npm/l/@litert/utils-array.svg?maxAge=2592000?style=plastic)](https://github.com/litert/utils/blob/master/LICENSE)
6+
[![node](https://img.shields.io/node/v/@litert/utils-array.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
7+
[![GitHub issues](https://img.shields.io/github/issues/litert/utils.js.svg)](https://github.com/litert/utils.js/issues)
8+
[![GitHub Releases](https://img.shields.io/github/release/litert/utils.js.svg)](https://github.com/litert/utils.js/releases "Stable Release")
9+
10+
The utility functions/classes/constants about arrays for JavaScript/TypeScript.
11+
12+
## Requirement
13+
14+
- TypeScript v5.0.0 (or newer)
15+
- Node.js v18.0.0 (or newer)
16+
17+
## Installation
18+
19+
```sh
20+
npm i @litert/utils-array --save
21+
```
22+
23+
## License
24+
25+
This library is published under [Apache-2.0](./LICENSE) license.

packages/partials/array/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"prepublishOnly": "echo \"Please use ottoia publishing this package!\"; exit 1;"
1919
},
2020
"private": false,
21-
"dependencies": {},
22-
"devDependencies": {
21+
"dependencies": {
2322
"@litert/utils-ts-types": "-"
2423
},
24+
"devDependencies": {},
2525
"peerDependencies": {},
2626
"ottoia:alias": "partials.array",
2727
"access": "public"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# LiteRT/Utils - Network
2+
3+
[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
4+
[![npm version](https://img.shields.io/npm/v/@litert/utils-network.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/utils-network "Stable Version")
5+
[![License](https://img.shields.io/npm/l/@litert/utils-network.svg?maxAge=2592000?style=plastic)](https://github.com/litert/utils/blob/master/LICENSE)
6+
[![node](https://img.shields.io/node/v/@litert/utils-network.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
7+
[![GitHub issues](https://img.shields.io/github/issues/litert/utils.js.svg)](https://github.com/litert/utils.js/issues)
8+
[![GitHub Releases](https://img.shields.io/github/release/litert/utils.js.svg)](https://github.com/litert/utils.js/releases "Stable Release")
9+
10+
The utility functions/classes/constants about network for JavaScript/TypeScript.
11+
12+
## Requirement
13+
14+
- TypeScript v5.0.0 (or newer)
15+
- Node.js v18.0.0 (or newer)
16+
17+
## Installation
18+
19+
```sh
20+
npm i @litert/utils-network --save
21+
```
22+
23+
## License
24+
25+
This library is published under [Apache-2.0](./LICENSE) license.

packages/partials/object/src/Functions/GetPropertyNames.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,18 @@ NodeTest.describe('Function Object.getPropertyNames', () => {
5454
['a', 'b', 'c', s1, s2, s3]
5555
);
5656
});
57+
58+
NodeTest.it('Should throw exception if not a valid object', () => {
59+
60+
try {
61+
62+
getPropertyNames(null as any);
63+
NodeAssert.fail('Expected TypeError to be thrown');
64+
}
65+
catch (e) {
66+
67+
NodeAssert.ok(e instanceof TypeError);
68+
NodeAssert.strictEqual(e.message, 'An object is expected by "getPropertyNames" function.');
69+
}
70+
});
5771
});

packages/partials/string/README.md

Lines changed: 2 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# LiteRT/Utils-String
1+
# LiteRT/Utils - String
22

33
[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
44
[![npm version](https://img.shields.io/npm/v/@litert/utils-string.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/utils-string "Stable Version")
@@ -7,7 +7,7 @@
77
[![GitHub issues](https://img.shields.io/github/issues/litert/utils.js.svg)](https://github.com/litert/utils.js/issues)
88
[![GitHub Releases](https://img.shields.io/github/release/litert/utils.js.svg)](https://github.com/litert/utils.js/releases "Stable Release")
99

10-
The string utility functions/classes/constants for JavaScript/TypeScript.
10+
The utility functions/classes/constants about string for JavaScript/TypeScript.
1111

1212
## Requirement
1313

@@ -19,91 +19,6 @@ The string utility functions/classes/constants for JavaScript/TypeScript.
1919
```sh
2020
npm i @litert/utils-string --save
2121
```
22-
## Features
23-
24-
### Classes
25-
26-
- `class UnitParser`
27-
28-
A helper class for extracting the value and the unit from a string, by the given format.
29-
30-
### Functions
31-
32-
- `function includeEvilSpaceChars(str: string): boolean;`
33-
34-
Check if the string contains some evil space characters, including:
35-
36-
- Unicode `\u0000-\u0008`
37-
- Unicode `\u000B-\u000C`
38-
- Unicode `\u000E-\u001F`
39-
- Unicode `\u0080-\u00A0`
40-
- Unicode `\u2000-\u200F`
41-
42-
- `function replaceEvilSpaceChars(str: string, to: string = ''): string;`
43-
44-
Replace the evil space characters in the string.
45-
46-
- `function htmlEscape(text: string, extraReplacement?: Array<[from: string, to: string]>): string;`
47-
48-
Escape the HTML special characters in the string.
49-
50-
The built-in replacements are:
51-
52-
- `&` to `&amp;`
53-
- `<` to `&lt;`
54-
- `>` to `&gt;`
55-
- `"` to `&quot;`
56-
- `'` to `&#39;`
57-
58-
Some extra replacements can be passed in the `extraReplacement` parameter.
59-
60-
- `function splitIntoLines(text: string, eol: string | RegExp = /\r\n|\r|\n/): string[];`
61-
62-
Split the string into lines.
63-
64-
The default EOL is `/\r\n|\r|\n/`, but you can pass in a custom EOL string or a regular expression.
65-
66-
- `function toUnixString(text: string): string;`
67-
68-
Convert the string to a Unix-style string, using `\n` as the EOL.
69-
70-
- `function toWindowsString(text: string): string;`
71-
72-
Convert the string to a Windows-style (DOS-style) string, using `\r\n` as the EOL.
73-
74-
- `function toMacString(text: string): string;`
75-
76-
Convert the string to a MacOS-style string, using `\r` as the EOL.
77-
78-
- `function random(length: number, charset: string = DEFAULT_RANDOM_CHARSET): string;`
79-
80-
Generate a random string with the specified length and charset.
81-
82-
The default charset is `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`.
83-
84-
- `function regexpEscape(str: string): string;`
85-
86-
Escape a string for use in a regular expression, all below characters will be escaped.
87-
88-
`[.*+?^${}()|[\]/\\]`
89-
90-
### Constants
91-
92-
- `const DEFAULT_RANDOM_CHARSET: string;`
93-
94-
The default charset for the `random` function.
95-
96-
- `enum ERandomStringCharset`
97-
98-
The enum for the charset of the `random` function.
99-
100-
- `UPPER_ALPHA`: `ABCDEFGHIJKLMNOPQRSTUVWXYZ`
101-
- `LOWER_ALPHA`: `abcdefghijklmnopqrstuvwxyz`
102-
- `DEC_DIGIT`: `0123456789`
103-
- `UPPER_HEX_DIGIT`: `0123456789ABCDEF`
104-
- `LOWER_HEX_DIGIT`: `0123456789abcdef`
105-
106-
> You can combine the charset by concatenating them as a string, e.g. `ERandomStringCharset.UPPER_ALPHA + ERandomStringCharset.LOWER_ALPHA`.
10722

10823
## License
10924

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# LiteRT/Utils - TypeScript Types
2+
3+
[![Strict TypeScript Checked](https://badgen.net/badge/TS/Strict "Strict TypeScript Checked")](https://www.typescriptlang.org)
4+
[![npm version](https://img.shields.io/npm/v/@litert/utils-ts-types.svg?colorB=brightgreen)](https://www.npmjs.com/package/@litert/utils-ts-types "Stable Version")
5+
[![License](https://img.shields.io/npm/l/@litert/utils-ts-types.svg?maxAge=2592000?style=plastic)](https://github.com/litert/utils/blob/master/LICENSE)
6+
[![node](https://img.shields.io/node/v/@litert/utils-ts-types.svg?colorB=brightgreen)](https://nodejs.org/dist/latest-v8.x/)
7+
[![GitHub issues](https://img.shields.io/github/issues/litert/utils.js.svg)](https://github.com/litert/utils.js/issues)
8+
[![GitHub Releases](https://img.shields.io/github/release/litert/utils.js.svg)](https://github.com/litert/utils.js/releases "Stable Release")
9+
10+
The utility functions/classes/constants about helper types for TypeScript.
11+
12+
## Requirement
13+
14+
- TypeScript v5.0.0 (or newer)
15+
- Node.js v18.0.0 (or newer)
16+
17+
## Installation
18+
19+
```sh
20+
npm i @litert/utils-ts-types --save
21+
```
22+
23+
## License
24+
25+
This library is published under [Apache-2.0](./LICENSE) license.

0 commit comments

Comments
 (0)