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.
@@ -7,5 +7,5 @@ export interface FeWordRelationIdParams {
7
7
  relationId: string;
8
8
  }
9
9
  export interface FeUserInfoParams {
10
- wordStates?: [number, UserWordState][];
10
+ wordStates?: [string, UserWordState][];
11
11
  }
@@ -7,7 +7,7 @@ export interface FeDiscoverProveData {
7
7
  translations: FeWord[];
8
8
  }
9
9
  export interface FeDiscoverStateData {
10
- words?: [number, UserWordState][];
10
+ words?: [string, UserWordState][];
11
11
  tags?: [string, string, FeWordKnowledge][];
12
12
  lists?: [string, FeWordKnowledge][];
13
13
  tables?: [string, FeWordKnowledge][];
@@ -33,6 +33,3 @@ export interface FeDiscoverStateParams {
33
33
  export interface FeDiscoverWordFeedParams extends FeDiscoverMetaParams, FeedParams {
34
34
  state?: UserWordState;
35
35
  }
36
- export interface FeAnonymousDataParams {
37
- wordStates: [number, UserWordState][];
38
- }
@@ -0,0 +1,4 @@
1
+ export declare class SlugUtil {
2
+ private static slugRegex;
3
+ static isSlug(slug: string): boolean;
4
+ }
@@ -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
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",