lenix 1.5.0 → 1.6.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.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Checks if the value is one of the values in the array
3
+ * @param value - The value to check
4
+ * @param from - The array of values to check from
5
+ * @returns boolean, True if the value is one of the values in the array, False otherwise
6
+ * @example
7
+ * guard(1, [1, 2, 3]): true
8
+ * guard(4, [1, 2, 3]): false
9
+ */
10
+ export const guard = <T>(value: unknown, from: readonly T[]): value is T =>
11
+ (from as readonly unknown[]).includes(value)
@@ -2,9 +2,9 @@
2
2
  "strict": {
3
3
  "accessor-pairs": "error",
4
4
  "array-callback-return": "warn",
5
- "arrow-body-style": "error",
5
+ "arrow-body-style": "warn",
6
6
  "block-scoped-var": "error",
7
- "camelcase": "error",
7
+ "camelcase": "warn",
8
8
  "capitalized-comments": "warn",
9
9
  "class-methods-use-this": "error",
10
10
  "complexity": "warn",
@@ -260,7 +260,7 @@
260
260
  "@typescript-eslint/no-unsafe-function-type": "error",
261
261
  "@typescript-eslint/no-unused-expressions": "warn",
262
262
  "@typescript-eslint/no-unused-private-class-members": "error",
263
- "@typescript-eslint/no-unused-vars": "error",
263
+ "@typescript-eslint/no-unused-vars": "off",
264
264
  "@typescript-eslint/no-use-before-define": "error",
265
265
  "@typescript-eslint/no-useless-constructor": "error",
266
266
  "@typescript-eslint/no-useless-empty-export": "error",
@@ -274,7 +274,7 @@
274
274
  "@typescript-eslint/triple-slash-reference": "error",
275
275
  "@typescript-eslint/unified-signatures": "error",
276
276
  "@typescript-eslint/await-thenable": "warn",
277
- "@typescript-eslint/consistent-return": "error",
277
+ "@typescript-eslint/consistent-return": "off",
278
278
  "@typescript-eslint/consistent-type-exports": "error",
279
279
  "@typescript-eslint/dot-notation": "error",
280
280
  "@typescript-eslint/naming-convention": [
@@ -305,11 +305,11 @@
305
305
  "@typescript-eslint/no-unnecessary-type-assertion": "error",
306
306
  "@typescript-eslint/no-unnecessary-type-conversion": "error",
307
307
  "@typescript-eslint/no-unnecessary-type-parameters": "error",
308
- "@typescript-eslint/no-unsafe-argument": "error",
309
- "@typescript-eslint/no-unsafe-assignment": "error",
310
- "@typescript-eslint/no-unsafe-call": "error",
311
- "@typescript-eslint/no-unsafe-enum-comparison": "error",
312
- "@typescript-eslint/no-unsafe-member-access": "error",
308
+ "@typescript-eslint/no-unsafe-argument": "warn",
309
+ "@typescript-eslint/no-unsafe-assignment": "warn",
310
+ "@typescript-eslint/no-unsafe-call": "warn",
311
+ "@typescript-eslint/no-unsafe-enum-comparison": "error",
312
+ "@typescript-eslint/no-unsafe-member-access": "warn",
313
313
  "@typescript-eslint/no-unsafe-return": "error",
314
314
  "@typescript-eslint/no-unsafe-type-assertion": "error",
315
315
  "@typescript-eslint/no-unsafe-unary-minus": "warn",
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Throws an error.
3
+ * @param error - The error to throw, can be a source of the error.
4
+ * @param cause - The cause of the error.
5
+ * @returns never, will crash the runtime.
6
+ * @example
7
+ * foo().catch(raise)
8
+ */
9
+ export const raise = (error: unknown, cause?: unknown): never => { throw new Error(String(error), { cause }) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lenix",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "The All-in-one Package",
5
5
  "author": "Lenix",
6
6
  "license": "GPL-3.0",