revdev 0.10.0 → 0.12.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/units/common/params.d.ts +1 -1
- package/lib/units/discover/entity.d.ts +1 -1
- package/lib/units/discover/params.d.ts +0 -3
- package/lib/utils/slug.d.ts +4 -0
- package/lib/utils/slug.js +15 -0
- package/lib/utils/tests/slug.test.d.ts +1 -0
- package/lib/utils/tests/slug.test.js +22 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ export interface FeDiscoverProveData {
|
|
|
7
7
|
translations: FeWord[];
|
|
8
8
|
}
|
|
9
9
|
export interface FeDiscoverStateData {
|
|
10
|
-
words?: [
|
|
10
|
+
words?: [string, UserWordState][];
|
|
11
11
|
tags?: [string, string, FeWordKnowledge][];
|
|
12
12
|
lists?: [string, FeWordKnowledge][];
|
|
13
13
|
tables?: [string, FeWordKnowledge][];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlugUtil = void 0;
|
|
4
|
+
var SlugUtil = /** @class */ (function () {
|
|
5
|
+
function SlugUtil() {
|
|
6
|
+
}
|
|
7
|
+
SlugUtil.isSlug = function (slug) {
|
|
8
|
+
this.slugRegex.lastIndex = 0;
|
|
9
|
+
return this.slugRegex.test(slug);
|
|
10
|
+
};
|
|
11
|
+
// min: 6, max: 50
|
|
12
|
+
SlugUtil.slugRegex = /^[a-z][a-z0-9\-]{4,48}[a-z0-9]$/g;
|
|
13
|
+
return SlugUtil;
|
|
14
|
+
}());
|
|
15
|
+
exports.SlugUtil = SlugUtil;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var slug_1 = require("../slug");
|
|
4
|
+
function trueSlug(slug) {
|
|
5
|
+
expect(slug_1.SlugUtil.isSlug(slug)).toBe(true);
|
|
6
|
+
}
|
|
7
|
+
function falseSlug(slug) {
|
|
8
|
+
expect(slug_1.SlugUtil.isSlug(slug)).toBe(false);
|
|
9
|
+
}
|
|
10
|
+
describe("slug", function () {
|
|
11
|
+
test("true", function () {
|
|
12
|
+
trueSlug("my-list");
|
|
13
|
+
trueSlug("mylist");
|
|
14
|
+
trueSlug("mylist-25");
|
|
15
|
+
trueSlug("m12345");
|
|
16
|
+
});
|
|
17
|
+
test("false", function () {
|
|
18
|
+
falseSlug("my");
|
|
19
|
+
falseSlug("-mylist");
|
|
20
|
+
falseSlug("1mylist");
|
|
21
|
+
});
|
|
22
|
+
});
|