@zoodogood/utils 1.2.4-change.1476 → 1.2.6-change.1486

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.
@@ -40,7 +40,10 @@ function justSendMessage(target, options) {
40
40
  setTimeout(() => message.delete(), options.delete);
41
41
  }
42
42
  if (options.reactions) {
43
- options.reactions.filter(Boolean).forEach((react) => message.react(react));
43
+ options.reactions
44
+ .filter(Boolean)
45
+ .filter((react) => !message.reactions.cache.some((compared) => compared.emoji.code === react))
46
+ .forEach((react) => message.react(react));
44
47
  }
45
48
  return message;
46
49
  });
@@ -1,13 +1,13 @@
1
1
  import { BracketsParser } from "./BracketsParser.js";
2
- interface ITextMatch {
2
+ export interface ITextMatch {
3
3
  regex: RegExp;
4
4
  name: string;
5
5
  }
6
- declare namespace BracketsNamespace {
6
+ export declare namespace BracketsNamespace {
7
7
  type Context = InstanceType<typeof BracketsParser.ParseContext>;
8
8
  type GroupElement = InstanceType<typeof BracketsManager.GroupElement>;
9
9
  }
10
- declare class BracketsManager extends BracketsParser {
10
+ export declare class BracketsManager extends BracketsParser {
11
11
  primary: BracketsNamespace.GroupElement[];
12
12
  constructor();
13
13
  parse(): BracketsNamespace.Context;
@@ -25,18 +25,18 @@ declare class BracketsManager extends BracketsParser {
25
25
  processBracketGroupFromStringStamp(raw: string): BracketsNamespace.GroupElement | null;
26
26
  replaceBracketsStamps(text: string, replacer?: (group: BracketsNamespace.GroupElement) => string): string;
27
27
  }
28
- interface IFlagCapture {
28
+ export interface IFlagCapture {
29
29
  name?: string;
30
30
  capture: string[];
31
31
  expectValue?: boolean;
32
32
  }
33
- declare class FlagsManager {
33
+ export declare class FlagsManager {
34
34
  unhandledFlags?: Array<RegExpMatchArray>;
35
35
  captureResidueFlags(context: CliParserRunContext): this;
36
36
  captureFlags(flags: IFlagCapture[], context: CliParserRunContext): this;
37
37
  }
38
- type TCaptureValue = string | RegExpMatchArray;
39
- declare class CapturedContent {
38
+ export type TCaptureValue = string | RegExpMatchArray;
39
+ export declare class CapturedContent {
40
40
  content: TCaptureValue;
41
41
  context?: CliParserRunContext;
42
42
  constructor(content: TCaptureValue);
@@ -61,7 +61,11 @@ declare class CapturedContent {
61
61
  smart?: boolean | undefined;
62
62
  }): string | undefined;
63
63
  }
64
- declare class CliParserRunContext {
64
+ export declare class CapturedContentFlagMatchArray extends CapturedContent {
65
+ content: RegExpMatchArray;
66
+ valueOfFlag(): string | null;
67
+ }
68
+ export declare class CliParserRunContext {
65
69
  parser: CliParser;
66
70
  input: string;
67
71
  captures: Map<string, CapturedContent | null>;
@@ -89,4 +93,3 @@ export declare class CliParser {
89
93
  static BracketsManager: typeof BracketsManager;
90
94
  static FlagsManager: typeof FlagsManager;
91
95
  }
92
- export {};
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-namespace */
2
2
  import { BracketsParser } from "./BracketsParser.js";
3
- class BracketsManager extends BracketsParser {
3
+ export class BracketsManager extends BracketsParser {
4
4
  constructor() {
5
5
  super();
6
6
  this.primary = [];
@@ -42,7 +42,7 @@ class BracketsManager extends BracketsParser {
42
42
  return text.replaceAll(RegExp(this.groupStampRegex, "g"), (full) => replacer(this.processBracketGroupFromStringStamp(full)));
43
43
  }
44
44
  }
45
- class FlagsManager {
45
+ export class FlagsManager {
46
46
  captureResidueFlags(context) {
47
47
  let match;
48
48
  const { parser } = context;
@@ -70,7 +70,7 @@ class FlagsManager {
70
70
  return this;
71
71
  }
72
72
  }
73
- class CapturedContent {
73
+ export class CapturedContent {
74
74
  constructor(content) {
75
75
  this.content = content;
76
76
  }
@@ -158,13 +158,13 @@ class CapturedContent {
158
158
  return value;
159
159
  }
160
160
  }
161
- class CapturedContentFlagMatchArray extends CapturedContent {
161
+ export class CapturedContentFlagMatchArray extends CapturedContent {
162
162
  valueOfFlag() {
163
163
  var _a;
164
164
  return ((_a = this.content.groups) === null || _a === void 0 ? void 0 : _a.value) || null;
165
165
  }
166
166
  }
167
- class CliParserRunContext {
167
+ export class CliParserRunContext {
168
168
  constructor(parser) {
169
169
  this.input = "";
170
170
  this.captures = new Map();
@@ -1,6 +1,6 @@
1
1
  export * from "./TextTableBuilder.js";
2
2
  export * from "./BracketsParser.js";
3
- export * from "./CliParser.js";
3
+ export { CliParser } from "./CliParser.js";
4
4
  interface IEndingOptions {
5
5
  unite?: (quantity: number, word: string) => string;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  export * from "./TextTableBuilder.js";
2
2
  export * from "./BracketsParser.js";
3
- export * from "./CliParser.js";
3
+ export { CliParser } from "./CliParser.js";
4
4
  function ending(quantity = 0, base, multiple, alone, double, options = {}) {
5
5
  if (isNaN(quantity))
6
6
  return NaN;
package/package.json CHANGED
@@ -1,27 +1,19 @@
1
1
  {
2
2
  "name": "@zoodogood/utils",
3
3
  "type": "module",
4
- "version": "1.2.4-change.1476",
4
+ "version": "1.2.6-change.1486",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "homepage": "https://zoodogood.github.io/utils",
9
- "scripts": {
10
- "test": "vitest run",
11
- "docs-build": "cd ./docs && retype build --output ./public",
12
- "docs-watch": "cd ./docs && retype watch",
13
- "prepack": "yarn build && yarn test && yarn docs-build",
14
- "build": "tsc",
15
- "tsc": "tsc",
16
- "vitest": "vitest"
17
- },
18
9
  "typings": "lib/index",
19
10
  "exports": {
20
11
  ".": "./lib/index.js",
21
12
  "./primitives": "./lib/primitives/mod.js",
22
13
  "./objectives": "./lib/objectives/mod.js",
23
14
  "./discordjs": "./lib/discordjs/mod.js",
24
- "./nodejs": "./lib/nodejs/mod.js"
15
+ "./nodejs": "./lib/nodejs/mod.js",
16
+ "./CliParser": "./lib/primitives/CliParser.js"
25
17
  },
26
18
  "repository": {
27
19
  "type": "git",
@@ -53,7 +45,7 @@
53
45
  ],
54
46
  "typesVersions": {
55
47
  ">=4.2": {
56
- "*": [
48
+ ".": [
57
49
  "lib/index.d.ts"
58
50
  ],
59
51
  "primitives": [
@@ -67,7 +59,18 @@
67
59
  ],
68
60
  "nodejs": [
69
61
  "lib/nodejs/mod.d.ts"
62
+ ],
63
+ "CliParser": [
64
+ "lib/primitives/CliParser.d.ts"
70
65
  ]
71
66
  }
67
+ },
68
+ "scripts": {
69
+ "test": "vitest run",
70
+ "docs-build": "cd ./docs && retype build --output ./public",
71
+ "docs-watch": "cd ./docs && retype watch",
72
+ "build": "tsc",
73
+ "tsc": "tsc",
74
+ "vitest": "vitest"
72
75
  }
73
- }
76
+ }