@hellpig/anarchy-shared 1.4.5 → 1.5.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.
- package/CHANGELOG.md +1 -0
- package/dist/Constants/CssUnits.d.ts +7 -0
- package/dist/Constants/FallBackFonts.d.ts +1 -0
- package/dist/Constants/FileSizes.d.ts +11 -0
- package/dist/Constants/Json.d.ts +15 -0
- package/dist/Constants/index.d.ts +4 -0
- package/dist/Constants/index.es.js +6 -0
- package/dist/Constants/index.es.js.map +1 -0
- package/dist/Models/TBrowserInfo.d.ts +2 -0
- package/dist/Models/TDeferredPromise.d.ts +5 -0
- package/dist/Models/index.d.ts +2 -0
- package/dist/Models/index.es.js +2 -0
- package/dist/Models/index.es.js.map +1 -0
- package/dist/Plugins/EmitDefineVitePlugin.d.ts +7 -0
- package/dist/Plugins/index.d.ts +1 -0
- package/dist/Plugins/index.es.js +17 -0
- package/dist/Plugins/index.es.js.map +1 -0
- package/dist/Utils/ArrayUtils.d.ts +8 -0
- package/dist/Utils/AsyncUtils.d.ts +2 -0
- package/dist/Utils/CheckUtils.d.ts +6 -0
- package/dist/Utils/CssUtils.d.ts +5 -0
- package/dist/Utils/DetectUtils.d.ts +2 -0
- package/dist/Utils/EnvSchemaUtils.d.ts +2 -0
- package/dist/Utils/FileUtils.d.ts +3 -0
- package/dist/Utils/MapUtils.d.ts +3 -0
- package/dist/Utils/MathUtils.d.ts +1 -0
- package/dist/Utils/ObjectUtils.d.ts +9 -0
- package/dist/Utils/RxJsUtils.d.ts +2 -0
- package/dist/Utils/SanitizeUtils.d.ts +4 -0
- package/dist/Utils/StringUtils.d.ts +2 -0
- package/dist/Utils/TrackingUtils.d.ts +4 -0
- package/dist/Utils/TypesUtils.d.ts +28 -0
- package/dist/Utils/UrlUtils.d.ts +2 -0
- package/dist/Utils/WebGlUtils.d.ts +2 -0
- package/dist/Utils/index.d.ts +17 -0
- package/dist/Utils/index.es.js +3687 -0
- package/dist/Utils/index.es.js.map +1 -0
- package/dist/assets/_constants.scss +18 -0
- package/dist/assets/_utils.scss +6 -0
- package/dist/chunks/Json.js +57 -0
- package/dist/chunks/Json.js.map +1 -0
- package/package.json +27 -2
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FallBackFonts: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const DefaultBannedInJsonKeys: ReadonlyArray<string>;
|
|
2
|
+
export declare enum JsonSpecialCharactersAscii {
|
|
3
|
+
TAB = 9,
|
|
4
|
+
LF = 10,
|
|
5
|
+
CR = 13,
|
|
6
|
+
MAX_CONTROL = 31,
|
|
7
|
+
DEL = 127
|
|
8
|
+
}
|
|
9
|
+
export declare enum JsonSpecialCharactersUnicode {
|
|
10
|
+
BOM = 65279,
|
|
11
|
+
QUOTE = 34,
|
|
12
|
+
BACKSLASH = 92,
|
|
13
|
+
LINE_SEPARATOR = 8232,
|
|
14
|
+
PARAGRAPH_SEPARATOR = 8233
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { C as CssUnits, D as DefaultBannedInJsonKeys, F as FileSizes, J as JsonSpecialCharactersAscii, a as JsonSpecialCharactersUnicode } from '../chunks/Json.js';
|
|
2
|
+
|
|
3
|
+
const FallBackFonts = 'system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif';
|
|
4
|
+
|
|
5
|
+
export { FallBackFonts };
|
|
6
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../src/Constants/FallBackFonts.ts"],"sourcesContent":["export const FallBackFonts: string = 'system-ui, -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif';\n"],"names":[],"mappings":";;AAAO,MAAM,aAAA,GAAwB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './EmitDefineVitePlugin';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function emitDefineJson({ fileName, value }) {
|
|
2
|
+
return {
|
|
3
|
+
name: "emit-define-json",
|
|
4
|
+
apply: "build",
|
|
5
|
+
generateBundle() {
|
|
6
|
+
const out = value;
|
|
7
|
+
this.emitFile({
|
|
8
|
+
type: "asset",
|
|
9
|
+
fileName,
|
|
10
|
+
source: JSON.stringify(out, null, 2)
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { emitDefineJson };
|
|
17
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../src/Plugins/EmitDefineVitePlugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\n\ntype TOpts = Readonly<{\n value: Record<string, string>;\n fileName: string;\n}>;\n\nexport function emitDefineJson({ fileName, value }: TOpts): Plugin {\n return {\n name: 'emit-define-json',\n apply: 'build',\n generateBundle(): void {\n const out: Record<string, unknown> = value;\n\n this.emitFile({\n type: 'asset',\n fileName,\n source: JSON.stringify(out, null, 2)\n });\n }\n };\n}\n"],"names":[],"mappings":"AAOO,SAAS,cAAA,CAAe,EAAE,QAAA,EAAU,KAAA,EAAM,EAAkB;AACjE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,kBAAA;AAAA,IACN,KAAA,EAAO,OAAA;AAAA,IACP,cAAA,GAAuB;AACrB,MAAA,MAAM,GAAA,GAA+B,KAAA;AAErC,MAAA,IAAA,CAAK,QAAA,CAAS;AAAA,QACZ,IAAA,EAAM,OAAA;AAAA,QACN,QAAA;AAAA,QACA,MAAA,EAAQ,IAAA,CAAK,SAAA,CAAU,GAAA,EAAK,MAAM,CAAC;AAAA,OACpC,CAAA;AAAA,IACH;AAAA,GACF;AACF;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function omitInArray<T>(array: ReadonlyArray<T>, item: T): ReadonlyArray<T>;
|
|
2
|
+
export declare function forEachEnum<T extends Record<string | number, string | number>>(enumType: T, callback: (value: number | string, key: number | string, index: number) => void): void;
|
|
3
|
+
export declare function removeDuplicates<T extends {
|
|
4
|
+
id: string;
|
|
5
|
+
}>(array: ReadonlyArray<T>): ReadonlyArray<T>;
|
|
6
|
+
export declare const removeDuplicatesStr: (arr: ReadonlyArray<string>) => ReadonlyArray<string>;
|
|
7
|
+
export declare function asRecord<T, K extends keyof T, V extends string | number | symbol = T[K] & (string | number | symbol)>(key: K, list: ReadonlyArray<T>): Record<V, T>;
|
|
8
|
+
export declare function findDuplicateString(arr: ReadonlyArray<string>): string | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const isDefined: <T>(value: T | undefined | null) => value is T;
|
|
2
|
+
export declare const isAllDefined: <T>(values: ReadonlyArray<T | undefined | null>) => values is ReadonlyArray<T>;
|
|
3
|
+
export declare const isNotDefined: <T>(value: T | undefined | null) => value is undefined | null;
|
|
4
|
+
export declare const isAllNotDefined: <T>(values: ReadonlyArray<T | undefined | null>) => values is ReadonlyArray<undefined | null>;
|
|
5
|
+
export declare const isString: (value: unknown) => value is string;
|
|
6
|
+
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function getBaseTextSize(): number;
|
|
2
|
+
export declare function toPx(value: string | number | undefined): string;
|
|
3
|
+
export declare function toRem(value: string | number | undefined): string;
|
|
4
|
+
export declare const stripUnits: (value: string) => number;
|
|
5
|
+
export declare function getUnitsFromCssValue(value: string): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const toBool: import('valibot').SchemaWithPipe<readonly [import('valibot').StringSchema<undefined>, import('valibot').TransformAction<string, boolean>]>;
|
|
2
|
+
export declare const toInt: import('valibot').SchemaWithPipe<readonly [import('valibot').StringSchema<undefined>, import('valibot').TransformAction<string, number>]>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function findInMap<K, V>(map: Map<K, V>, cb: (value: V, key: K) => boolean): V | undefined;
|
|
2
|
+
export declare function findKeyInMap<K, V>(map: Map<K, V>, cb: (value: V, key: K) => boolean): K | undefined;
|
|
3
|
+
export declare function findKeyWithValue<K, V>(map: Map<K, V>, value: V): K | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function clamp(val: number, minimum: number, maximum: number): number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TDeepPartial } from './TypesUtils';
|
|
2
|
+
export declare function cleanObject<T extends Record<string, unknown>>(obj: T): void;
|
|
3
|
+
export declare function isObject(obj: unknown, shouldAllowCustomObjects?: boolean): obj is Record<string, unknown>;
|
|
4
|
+
export declare const isEmptyObject: (obj: Record<string, unknown>) => boolean;
|
|
5
|
+
export declare const omitInObjectWithoutMutation: <T extends Readonly<Record<string, unknown>>, K extends keyof T>(obj: T, keys: ReadonlyArray<K>) => Omit<T, K>;
|
|
6
|
+
export declare const omitInObjectWithMutation: <T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: ReadonlyArray<K>) => Omit<T, K>;
|
|
7
|
+
export declare function filterOutEmptyFields<T extends Record<string, unknown> | ReadonlyArray<unknown>>(item: T): T;
|
|
8
|
+
export declare function filterOutEmptyFieldsRecursive<T extends Record<string, unknown> | ReadonlyArray<unknown>>(input: T): T;
|
|
9
|
+
export declare function patchObject<T extends Record<string, any>>(base: T, patch?: TDeepPartial<T>): T;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type TWriteable<T> = {
|
|
2
|
+
-readonly [P in keyof T]: T[P];
|
|
3
|
+
};
|
|
4
|
+
export type TDeepWriteable<T> = {
|
|
5
|
+
-readonly [P in keyof T]: TDeepWriteable<T[P]>;
|
|
6
|
+
};
|
|
7
|
+
export type TOptional<T> = {
|
|
8
|
+
[P in keyof T]?: T[P];
|
|
9
|
+
};
|
|
10
|
+
export type TWithNull<T> = {
|
|
11
|
+
[P in keyof T]: T[P] | null;
|
|
12
|
+
};
|
|
13
|
+
export type TWithUndefined<T> = {
|
|
14
|
+
[P in keyof T]: T[P] | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type TWithoutNull<T> = {
|
|
17
|
+
[K in keyof T]: Exclude<T[K], null> extends never ? undefined : Exclude<T[K], null> | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type TWithMandatoryField<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
20
|
+
export type TValueOf<T> = T[keyof T];
|
|
21
|
+
export type TNullToUndefined<T> = {
|
|
22
|
+
[K in keyof T]: T[K] extends null ? undefined : T[K] extends null | infer U ? U | undefined : T[K];
|
|
23
|
+
};
|
|
24
|
+
export declare function nullsToUndefined<T extends Record<string, any>>(obj: T): TNullToUndefined<T>;
|
|
25
|
+
export type TUnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
26
|
+
export type TDeepPartial<T> = T extends ReadonlyArray<infer U> ? ReadonlyArray<TDeepPartial<U>> : T extends object ? {
|
|
27
|
+
readonly [K in keyof T]?: TDeepPartial<T[K]>;
|
|
28
|
+
} : T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './ArrayUtils';
|
|
2
|
+
export * from './AsyncUtils';
|
|
3
|
+
export * from './CheckUtils';
|
|
4
|
+
export * from './CssUtils';
|
|
5
|
+
export * from './DetectUtils';
|
|
6
|
+
export * from './EnvSchemaUtils';
|
|
7
|
+
export * from './FileUtils';
|
|
8
|
+
export * from './MapUtils';
|
|
9
|
+
export * from './MathUtils';
|
|
10
|
+
export * from './ObjectUtils';
|
|
11
|
+
export * from './RxJsUtils';
|
|
12
|
+
export * from './SanitizeUtils';
|
|
13
|
+
export * from './StringUtils';
|
|
14
|
+
export * from './TrackingUtils';
|
|
15
|
+
export * from './TypesUtils';
|
|
16
|
+
export * from './UrlUtils';
|
|
17
|
+
export * from './WebGlUtils';
|