semantic-typescript 0.3.7 → 0.4.1

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/utility.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  export type Invalid<T> = T extends null | undefined ? T : never;
2
2
  export type Valid<T> = T extends null | undefined ? never : T;
3
3
  export type MaybeInvalid<T> = T | null | undefined;
4
+ export type MaybeUndefined<T> = T | undefined;
5
+ export type MaybeNull<T> = T | null;
4
6
  export declare let validate: <T>(t: MaybeInvalid<T>) => t is T;
5
7
  export declare let invalidate: <T>(t: MaybeInvalid<T>) => t is (null | undefined);
6
- export type Primitive = string | number | boolean | symbol | bigint | Function | ((...args: any[]) => any);
8
+ export type Type = "undefined" | "null" | "boolean" | "number" | "bigint" | "symbol" | "string" | "function" | "object";
9
+ export declare let typeOf: <T>(t: T) => Type;
10
+ export type Primitive = null | undefined | string | number | boolean | symbol | bigint | Function | ((...args: any[]) => any);
7
11
  export type MaybePrimitive<T> = T | Primitive;
8
12
  export type AsyncFunction = (...args: any[]) => Promise<unknown>;
9
13
  export type DeepPropertyKey<T extends object> = {
@@ -12,6 +16,9 @@ export type DeepPropertyKey<T extends object> = {
12
16
  export type DeepPropertyValue<T extends object> = {
13
17
  [K in keyof T]: T[K] extends object ? DeepPropertyValue<T[K]> : T[K];
14
18
  };
19
+ export interface Constructor<T> {
20
+ new (...args: any[]): T;
21
+ }
15
22
  export interface Runnable {
16
23
  (): void;
17
24
  }
package/dist/utility.js CHANGED
@@ -4,6 +4,15 @@ export let validate = (t) => {
4
4
  export let invalidate = (t) => {
5
5
  return t === null || t === (void 0);
6
6
  };
7
+ export let typeOf = (t) => {
8
+ if (typeof t === "object") {
9
+ if (t === null) {
10
+ return "null";
11
+ }
12
+ return "object";
13
+ }
14
+ return typeof t;
15
+ };
7
16
  ;
8
17
  ;
9
18
  ;
package/dist/window.js CHANGED
@@ -7,6 +7,15 @@ export class WindowCollectable extends OrderedCollectable {
7
7
  WindowCollectable = WindowCollectableSymbol;
8
8
  constructor(parameter, comparator = useCompare) {
9
9
  super(parameter, comparator);
10
+ Object.defineProperties(this, {
11
+ "WindowCollectable": {
12
+ value: WindowCollectableSymbol,
13
+ writable: false,
14
+ enumerable: false,
15
+ configurable: false
16
+ }
17
+ });
18
+ Object.freeze(this);
10
19
  }
11
20
  *[Symbol.iterator]() {
12
21
  try {
@@ -58,3 +67,6 @@ export class WindowCollectable extends OrderedCollectable {
58
67
  }
59
68
  }
60
69
  ;
70
+ Object.freeze(WindowCollectable);
71
+ Object.freeze(WindowCollectable.prototype);
72
+ Object.freeze(Object.getPrototypeOf(WindowCollectable));
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/eloyhere"
7
7
  },
8
8
  "description": "A modern type-safe stream processing library inspired by JavaScript Generator, Java Stream, and MySQL Index. Supports lazy evaluation, async streams, statistics, and IO-like operations.",
9
- "version": "0.3.7",
9
+ "version": "0.4.1",
10
10
  "type": "module",
11
11
  "readme": "readme.md",
12
12
  "main": "dist/index.js",
@@ -52,10 +52,6 @@
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsc",
55
- "dev": "vite",
56
55
  "prepublishOnly": "npm run build"
57
- },
58
- "devDependencies": {
59
- "typescript": "~5.9.3"
60
56
  }
61
57
  }