xenopomp-essentials 0.0.1-beta.1 → 0.0.1-beta.2

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/dist/index.d.mts CHANGED
@@ -339,4 +339,79 @@ type MergeTypes<TypesArray extends any[], Res = EmptyObject> = TypesArray extend
339
339
  */
340
340
  type WeakOmit<Obj extends AnyObject, Keys extends keyof Obj | undefined = undefined> = Keys extends keyof Obj ? Omit<Obj, Keys> : Obj;
341
341
 
342
- export type { AnyObject, ArrayItemType, ArrayType, AsyncFC, AsyncReturnType, AsyncVariableFC, DeepInject, DeepWriteable, Defined, EmptyObject, FcProps, Fn, FunctionalChildren, Jsonish, MatchType, MergeTypes, Modify, NextErrorParams, NextParams, NextSearchParams, Nullable, OneOf, OnlyFirst, RecordKey, RecordValue, ReplaceReturnType, SelectivePartial, SetState, StrictOmit, Synchronous, Undefinable, VariableFC, WeakOmit, Writeable };
342
+ /**
343
+ * Makes types don`t merging in unions.
344
+ *
345
+ * @example
346
+ * type Languages = 'TypeScript' | 'JavaScript' | Lenient<string>;
347
+ * // ^? "TypeScript" | "JavaScript" | string
348
+ */
349
+ type Lenient<T> = T & {};
350
+ /**
351
+ * This type allows any string, but also saves compiler`s autocomplete
352
+ * feature.
353
+ *
354
+ * @example
355
+ * type Languages = 'TypeScript' | 'JavaScript';
356
+ *
357
+ * function handleLanguage(lang: LenientAutocomplete<Languages>) {
358
+ * // ^? string (but autocomplete feature is still here)
359
+ * console.log(lang);
360
+ * }
361
+ */
362
+ type LenientAutocomplete<T extends string> = T | Lenient<string>;
363
+
364
+ /**
365
+ * Creates pipelines of functions that will be executed only
366
+ * when you will call whole pipeline.
367
+ *
368
+ * @param fn
369
+ *
370
+ * @example
371
+ * const stringToDateAndTime = pipe(Date.parse)
372
+ * .pipe(n => new Date(n))
373
+ * .pipe(d => d.toDateString())
374
+ * .pipe(s => s.split('T'))
375
+ * .pipe(([date, time]) => ({ date, time }));
376
+ *
377
+ * const res = stringToDateAndTime('Jan 1, 2024');
378
+ * // ^? { date: string | undefined; time: string | undefined }
379
+ *
380
+ * @see https://youtu.be/bH61wRMqp-o?si=D-2Az-_dUFBxG9HG&t=429
381
+ */
382
+ declare function pipe<A, B>(fn: (a: A) => B): {
383
+ (a: A): B;
384
+ pipe<C>(fn2: (b: B) => C): {
385
+ (a: A): C;
386
+ pipe<C_1>(fn2: (b: C) => C_1): {
387
+ (a: A): C_1;
388
+ pipe<C_2>(fn2: (b: C_1) => C_2): {
389
+ (a: A): C_2;
390
+ pipe<C_3>(fn2: (b: C_2) => C_3): {
391
+ (a: A): C_3;
392
+ pipe<C_4>(fn2: (b: C_3) => C_4): {
393
+ (a: A): C_4;
394
+ pipe<C_5>(fn2: (b: C_4) => C_5): {
395
+ (a: A): C_5;
396
+ pipe<C_6>(fn2: (b: C_5) => C_6): {
397
+ (a: A): C_6;
398
+ pipe<C_7>(fn2: (b: C_6) => C_7): {
399
+ (a: A): C_7;
400
+ pipe<C_8>(fn2: (b: C_7) => C_8): {
401
+ (a: A): C_8;
402
+ pipe<C_9>(fn2: (b: C_8) => C_9): {
403
+ (a: A): C_9;
404
+ pipe<C_10>(fn2: (b: C_9) => C_10): /*elided*/ any;
405
+ };
406
+ };
407
+ };
408
+ };
409
+ };
410
+ };
411
+ };
412
+ };
413
+ };
414
+ };
415
+ };
416
+
417
+ export { type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DeepInject, type DeepWriteable, type Defined, type EmptyObject, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type WeakOmit, type Writeable, pipe };
package/dist/index.d.ts CHANGED
@@ -339,4 +339,79 @@ type MergeTypes<TypesArray extends any[], Res = EmptyObject> = TypesArray extend
339
339
  */
340
340
  type WeakOmit<Obj extends AnyObject, Keys extends keyof Obj | undefined = undefined> = Keys extends keyof Obj ? Omit<Obj, Keys> : Obj;
341
341
 
342
- export type { AnyObject, ArrayItemType, ArrayType, AsyncFC, AsyncReturnType, AsyncVariableFC, DeepInject, DeepWriteable, Defined, EmptyObject, FcProps, Fn, FunctionalChildren, Jsonish, MatchType, MergeTypes, Modify, NextErrorParams, NextParams, NextSearchParams, Nullable, OneOf, OnlyFirst, RecordKey, RecordValue, ReplaceReturnType, SelectivePartial, SetState, StrictOmit, Synchronous, Undefinable, VariableFC, WeakOmit, Writeable };
342
+ /**
343
+ * Makes types don`t merging in unions.
344
+ *
345
+ * @example
346
+ * type Languages = 'TypeScript' | 'JavaScript' | Lenient<string>;
347
+ * // ^? "TypeScript" | "JavaScript" | string
348
+ */
349
+ type Lenient<T> = T & {};
350
+ /**
351
+ * This type allows any string, but also saves compiler`s autocomplete
352
+ * feature.
353
+ *
354
+ * @example
355
+ * type Languages = 'TypeScript' | 'JavaScript';
356
+ *
357
+ * function handleLanguage(lang: LenientAutocomplete<Languages>) {
358
+ * // ^? string (but autocomplete feature is still here)
359
+ * console.log(lang);
360
+ * }
361
+ */
362
+ type LenientAutocomplete<T extends string> = T | Lenient<string>;
363
+
364
+ /**
365
+ * Creates pipelines of functions that will be executed only
366
+ * when you will call whole pipeline.
367
+ *
368
+ * @param fn
369
+ *
370
+ * @example
371
+ * const stringToDateAndTime = pipe(Date.parse)
372
+ * .pipe(n => new Date(n))
373
+ * .pipe(d => d.toDateString())
374
+ * .pipe(s => s.split('T'))
375
+ * .pipe(([date, time]) => ({ date, time }));
376
+ *
377
+ * const res = stringToDateAndTime('Jan 1, 2024');
378
+ * // ^? { date: string | undefined; time: string | undefined }
379
+ *
380
+ * @see https://youtu.be/bH61wRMqp-o?si=D-2Az-_dUFBxG9HG&t=429
381
+ */
382
+ declare function pipe<A, B>(fn: (a: A) => B): {
383
+ (a: A): B;
384
+ pipe<C>(fn2: (b: B) => C): {
385
+ (a: A): C;
386
+ pipe<C_1>(fn2: (b: C) => C_1): {
387
+ (a: A): C_1;
388
+ pipe<C_2>(fn2: (b: C_1) => C_2): {
389
+ (a: A): C_2;
390
+ pipe<C_3>(fn2: (b: C_2) => C_3): {
391
+ (a: A): C_3;
392
+ pipe<C_4>(fn2: (b: C_3) => C_4): {
393
+ (a: A): C_4;
394
+ pipe<C_5>(fn2: (b: C_4) => C_5): {
395
+ (a: A): C_5;
396
+ pipe<C_6>(fn2: (b: C_5) => C_6): {
397
+ (a: A): C_6;
398
+ pipe<C_7>(fn2: (b: C_6) => C_7): {
399
+ (a: A): C_7;
400
+ pipe<C_8>(fn2: (b: C_7) => C_8): {
401
+ (a: A): C_8;
402
+ pipe<C_9>(fn2: (b: C_8) => C_9): {
403
+ (a: A): C_9;
404
+ pipe<C_10>(fn2: (b: C_9) => C_10): /*elided*/ any;
405
+ };
406
+ };
407
+ };
408
+ };
409
+ };
410
+ };
411
+ };
412
+ };
413
+ };
414
+ };
415
+ };
416
+
417
+ export { type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DeepInject, type DeepWriteable, type Defined, type EmptyObject, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type WeakOmit, type Writeable, pipe };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
-
1
+ function t(n){function p(e){return n(e)}return p.pipe=e=>t(i=>e(n(i))),p}export{t as pipe};
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "xenopomp-essentials",
3
- "version": "0.0.1-beta.1",
3
+ "version": "0.0.1-beta.2",
4
4
  "author": "XenoPOMP <101574433+XenoPOMP@users.noreply.github.com>",
5
5
  "license": "MIT",
6
6
  "private": false,
7
+ "engines": {
8
+ "node": "20 || >=22"
9
+ },
7
10
  "scripts": {
8
11
  "build": "unbuild --config .config/build.config.ts",
9
12
  "lint": "run-s lint:*",
10
13
  "lint:code": "eslint -c ./.config/eslint.config.mjs .",
14
+ "coverage": "vitest run --coverage -c ./.config/vitest.config.ts",
11
15
  "prepare": "husky"
12
16
  },
13
17
  "exports": {
@@ -35,14 +39,19 @@
35
39
  },
36
40
  "devDependencies": {
37
41
  "@trivago/prettier-plugin-sort-imports": "^5.2.1",
42
+ "@vitest/coverage-istanbul": "^3.0.4",
38
43
  "eslint": "^9.19.0",
39
44
  "eslint-config-xeno": "^2.0.3-rc.3",
40
45
  "husky": "^9.1.7",
41
46
  "hygen": "^6.2.11",
47
+ "jsdom": "^26.0.0",
42
48
  "lint-staged": "^15.4.2",
43
49
  "npm-run-all": "^4.1.5",
44
50
  "pinst": "^3.0.0",
45
51
  "prettier": "^3.4.2",
46
- "unbuild": "^3.3.1"
52
+ "tsd": "^0.31.2",
53
+ "unbuild": "^3.3.1",
54
+ "vite": "^6.0.11",
55
+ "vitest": "^3.0.4"
47
56
  }
48
57
  }