Skip to content

Commit b3e1d5b

Browse files
authored
Revert "Add new string methods (#11)" (#12)
This reverts commit 2785905.
1 parent 2785905 commit b3e1d5b

9 files changed

+122
-11989
lines changed

.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ lib/**/files/**
33
lib/channels/**
44
test/**
55
*.spec.ts
6-
*.md

CHANGELOG.md

Whitespace-only changes.

README.md

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Support
1+
# Nestjs Hasher
22

33
## Contents
44

@@ -21,18 +21,6 @@
2121

2222
### <a name="sam"></a> Available methods
2323

24-
For the majority of the remaining Str documentation
25-
26-
[contains](#method-contains)
27-
[ucFirst](#method-ucFirst)
28-
[lower](#method-lower)
29-
30-
#### <a name="method-contains"></a> `contains()`
31-
32-
#### <a name="method-ucFirst"></a> `ucFirst()`
33-
34-
#### <a name="method-lower"></a> `lower()`
35-
3624
## <a name="arr"></a> Array - Arr
3725

3826
### <a name="aam"></a> Available methods

lib/arr/array.interface.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
//
1+
export interface IArr {
2+
//
3+
}

lib/collect/collect.interface.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
//
1+
export interface ICollect {
2+
//
3+
}

lib/str/string.interface.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
export interface IString {
2-
ucFirst(value: string): string;
3-
contains(value: string, needles: string | string[]): boolean;
4-
lower(value: string): string;
2+
//
53
}

lib/str/string.spec.ts

-50
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,4 @@ describe('Str', () => {
1010
it('should be defined', () => {
1111
expect(str).toBeDefined();
1212
});
13-
14-
describe('Property ucFirst', () => {
15-
it('should be have property ucFirst', () => {
16-
expect(str).toHaveProperty('ucFirst');
17-
});
18-
19-
it('should be use ucFirst property', () => {
20-
expect(str.ucFirst('test')).toEqual('Test');
21-
});
22-
23-
it('ucFirst not affected more word than first', () => {
24-
expect(str.ucFirst('hello world!')).toEqual('Hello world!');
25-
});
26-
});
27-
28-
describe('Property contains', () => {
29-
it('should be have property contain', () => {
30-
expect(str).toHaveProperty('contains');
31-
});
32-
33-
it('should be use contains have value', () => {
34-
expect(str.contains('test', 'tes')).toEqual(false);
35-
});
36-
37-
it('should be use contains have value', () => {
38-
expect(str.contains('test', 'test')).toEqual(true);
39-
});
40-
41-
it('value not exist in array', () => {
42-
expect(str.contains('hello', ['fly', 'hell', 'bye'])).toEqual(false);
43-
});
44-
45-
it('value not exist in array', () => {
46-
expect(str.contains('hello', ['fly', 'hello', 'bye'])).toEqual(true);
47-
});
48-
});
49-
50-
describe('Property lower', () => {
51-
it('should be have property lower', () => {
52-
expect(str).toHaveProperty('lower');
53-
});
54-
55-
it('should be use lower property', () => {
56-
expect(str.lower('Test')).toEqual('test');
57-
});
58-
59-
it('lower not affected more word than first', () => {
60-
expect(str.lower('Hello World!')).toEqual('hello world!');
61-
});
62-
});
6313
});

lib/str/string.ts

+2-28
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
11
import { IString } from './string.interface';
22

3-
export class Str implements IString {
4-
/**
5-
* Make a string's first character uppercase.
6-
* @method
7-
* @param {string} value
8-
* @return string
9-
*/
10-
ucFirst(value: string): string {
11-
return value.charAt(0).toUpperCase() + value.substring(1);
12-
}
13-
14-
/**
15-
* Determine if a given string contains a given substring.
16-
* @param value
17-
* @param needles
18-
* @return boolean
19-
*/
20-
contains(value: string, needles: string | string[]): boolean {
21-
return needles.includes(value);
22-
}
23-
24-
/**
25-
* Convert the given string to lower-case.
26-
* @param value
27-
*/
28-
lower(value: string): string {
29-
return value.toLowerCase();
30-
}
3+
export class Str extends String implements IString {
4+
//
315
}

0 commit comments

Comments
 (0)