revdev 0.318.0 → 0.319.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/back/word/entity.d.ts +3 -3
- package/lib/back/word/request.d.ts +3 -11
- package/lib/common/exception.d.ts +1 -0
- package/lib/common/exception.js +2 -0
- package/lib/shared/word/request.d.ts +3 -0
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/string.js +6 -0
- package/lib/utils/tests/string.test.js +6 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EntryStatus } from "../../common";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { WordDataGen } from "../../front";
|
|
3
|
+
import { WordGen } from "../../shared";
|
|
4
|
+
export interface BoWordRecord extends WordDataGen {
|
|
4
5
|
status?: EntryStatus;
|
|
5
6
|
created: string;
|
|
6
7
|
mode?: string;
|
|
@@ -10,7 +11,6 @@ export interface BoWordRecord extends WordGen {
|
|
|
10
11
|
tableTotal: number;
|
|
11
12
|
imageTotal: number;
|
|
12
13
|
tagTotal: number;
|
|
13
|
-
audios?: WordAudioRecord[];
|
|
14
14
|
}
|
|
15
15
|
export interface BoWordEntity extends WordGen {
|
|
16
16
|
created: string;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { EntryStatus } from "../../common";
|
|
2
2
|
import { FeedRequest, WordFeedExtension } from "../../feed";
|
|
3
|
-
import {
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
rate?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface BoCreateWordRequest extends CreateWordRequest {
|
|
9
|
-
}
|
|
10
|
-
export interface BoUpdateWordRequest extends BoCreateWordRequest {
|
|
11
|
-
id: string;
|
|
12
|
-
}
|
|
13
|
-
export interface BoWordModifier extends BoUpdateWordRequest {
|
|
3
|
+
import { UpdateWordRequest } from "../../shared";
|
|
4
|
+
export interface BoWordModifier extends UpdateWordRequest {
|
|
5
|
+
audioTotal: number;
|
|
14
6
|
}
|
|
15
7
|
export interface BoUpdateWordTagRequest {
|
|
16
8
|
wordId: string | string[];
|
|
@@ -19,6 +19,7 @@ export declare enum ExceptionCodes {
|
|
|
19
19
|
CodeAlreadyExists = "CodeAlreadyExists",
|
|
20
20
|
CodeRequired = "CodeRequired",
|
|
21
21
|
TagWordInvalidUserId = "TagWordInvalidUserId",
|
|
22
|
+
WordAlreadyExists = "WordAlreadyExists",
|
|
22
23
|
LinkToOwn = "LinkToOwn",
|
|
23
24
|
LinkToPrivate = "LinkToPrivate",
|
|
24
25
|
LinkResourceNotFound = "LinkResourceNotFound",
|
package/lib/common/exception.js
CHANGED
|
@@ -20,6 +20,8 @@ var ExceptionCodes;
|
|
|
20
20
|
ExceptionCodes["CodeAlreadyExists"] = "CodeAlreadyExists";
|
|
21
21
|
ExceptionCodes["CodeRequired"] = "CodeRequired";
|
|
22
22
|
ExceptionCodes["TagWordInvalidUserId"] = "TagWordInvalidUserId";
|
|
23
|
+
// word
|
|
24
|
+
ExceptionCodes["WordAlreadyExists"] = "WordAlreadyExists";
|
|
23
25
|
// link
|
|
24
26
|
ExceptionCodes["LinkToOwn"] = "LinkToOwn";
|
|
25
27
|
ExceptionCodes["LinkToPrivate"] = "LinkToPrivate";
|
package/lib/utils/string.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export declare class StringUtil {
|
|
|
2
2
|
static isEqual(obj1: any, obj2: any): boolean;
|
|
3
3
|
static isSame<TLiteral extends string = string>(str1: TLiteral, str2: string): boolean;
|
|
4
4
|
static isNumeric(text: string | undefined): boolean;
|
|
5
|
+
static capitalize(text: string | undefined): string;
|
|
5
6
|
}
|
package/lib/utils/string.js
CHANGED
|
@@ -13,6 +13,12 @@ var StringUtil = /** @class */ (function () {
|
|
|
13
13
|
StringUtil.isNumeric = function (text) {
|
|
14
14
|
return (text || "").match(/^\d+$/gi) !== null;
|
|
15
15
|
};
|
|
16
|
+
StringUtil.capitalize = function (text) {
|
|
17
|
+
if (text) {
|
|
18
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
19
|
+
}
|
|
20
|
+
return text || "";
|
|
21
|
+
};
|
|
16
22
|
return StringUtil;
|
|
17
23
|
}());
|
|
18
24
|
exports.StringUtil = StringUtil;
|
|
@@ -7,4 +7,10 @@ describe("StringUtil", function () {
|
|
|
7
7
|
expect(string_1.StringUtil.isNumeric("10")).toBeTruthy();
|
|
8
8
|
expect(string_1.StringUtil.isNumeric("a1")).toBeFalsy();
|
|
9
9
|
});
|
|
10
|
+
test("capitalize", function () {
|
|
11
|
+
expect(string_1.StringUtil.capitalize("word")).toBe("Word");
|
|
12
|
+
expect(string_1.StringUtil.capitalize("Word")).toBe("Word");
|
|
13
|
+
expect(string_1.StringUtil.capitalize("")).toBe("");
|
|
14
|
+
expect(string_1.StringUtil.capitalize(undefined)).toBe("");
|
|
15
|
+
});
|
|
10
16
|
});
|