clientnode 4.0.1435 → 4.0.1437

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.
Files changed (142) hide show
  1. package/dist/Lock.js +83 -94
  2. package/dist/Logger.js +163 -715
  3. package/dist/Semaphore.js +46 -81
  4. package/dist/array.js +337 -568
  5. package/dist/cli.js +37 -71
  6. package/dist/constants.js +110 -209
  7. package/dist/context.js +25 -229
  8. package/dist/cookie.js +48 -226
  9. package/dist/data-transfer.js +166 -725
  10. package/dist/datetime.js +241 -1059
  11. package/dist/domNode.js +277 -441
  12. package/dist/expression/evaluators.js +234 -1112
  13. package/dist/expression/helper.js +82 -135
  14. package/dist/expression/index.js +10 -1245
  15. package/dist/expression/indicator-functions.js +21 -239
  16. package/dist/expression/type.js +4 -34
  17. package/dist/filesystem.js +323 -309
  18. package/dist/function.js +51 -125
  19. package/dist/index.js +26 -2709
  20. package/dist/indicators.js +68 -440
  21. package/dist/module.js +78 -164
  22. package/dist/number.js +25 -423
  23. package/dist/object.js +771 -852
  24. package/dist/process.js +39 -245
  25. package/dist/property-types.js +96 -157
  26. package/dist/scope.js +56 -1825
  27. package/dist/string.js +603 -909
  28. package/dist/test-helper.js +171 -541
  29. package/dist/type.js +8 -37
  30. package/dist/utility.js +91 -336
  31. package/package.json +2 -2
  32. package/dist/Lock.d.ts +0 -39
  33. package/dist/Logger.d.ts +0 -102
  34. package/dist/Semaphore.d.ts +0 -29
  35. package/dist/array.d.ts +0 -150
  36. package/dist/bundle/Lock.js +0 -111
  37. package/dist/bundle/Logger.js +0 -705
  38. package/dist/bundle/Semaphore.js +0 -100
  39. package/dist/bundle/array.js +0 -648
  40. package/dist/bundle/cli.js +0 -85
  41. package/dist/bundle/constants.js +0 -225
  42. package/dist/bundle/context.js +0 -243
  43. package/dist/bundle/cookie.js +0 -262
  44. package/dist/bundle/data-transfer.js +0 -741
  45. package/dist/bundle/datetime.js +0 -1064
  46. package/dist/bundle/domNode.js +0 -471
  47. package/dist/bundle/expression/evaluators.js +0 -1115
  48. package/dist/bundle/expression/helper.js +0 -106
  49. package/dist/bundle/expression/index.js +0 -1223
  50. package/dist/bundle/expression/indicator-functions.js +0 -235
  51. package/dist/bundle/expression/type.js +0 -50
  52. package/dist/bundle/filesystem.js +0 -374
  53. package/dist/bundle/function.js +0 -105
  54. package/dist/bundle/index.js +0 -2686
  55. package/dist/bundle/indicators.js +0 -459
  56. package/dist/bundle/module.js +0 -180
  57. package/dist/bundle/number.js +0 -425
  58. package/dist/bundle/object.js +0 -1004
  59. package/dist/bundle/process.js +0 -275
  60. package/dist/bundle/property-types.js +0 -167
  61. package/dist/bundle/scope.js +0 -1808
  62. package/dist/bundle/string.js +0 -1095
  63. package/dist/bundle/test-helper.js +0 -690
  64. package/dist/bundle/type.js +0 -50
  65. package/dist/bundle/utility.js +0 -362
  66. package/dist/cli.d.ts +0 -31
  67. package/dist/compatible/Lock.js +0 -111
  68. package/dist/compatible/Logger.js +0 -705
  69. package/dist/compatible/Semaphore.js +0 -100
  70. package/dist/compatible/array.js +0 -648
  71. package/dist/compatible/cli.js +0 -85
  72. package/dist/compatible/constants.js +0 -225
  73. package/dist/compatible/context.js +0 -243
  74. package/dist/compatible/cookie.js +0 -262
  75. package/dist/compatible/data-transfer.js +0 -741
  76. package/dist/compatible/datetime.js +0 -1064
  77. package/dist/compatible/domNode.js +0 -471
  78. package/dist/compatible/expression/evaluators.js +0 -1115
  79. package/dist/compatible/expression/helper.js +0 -106
  80. package/dist/compatible/expression/index.js +0 -1223
  81. package/dist/compatible/expression/indicator-functions.js +0 -235
  82. package/dist/compatible/expression/type.js +0 -50
  83. package/dist/compatible/filesystem.js +0 -374
  84. package/dist/compatible/function.js +0 -105
  85. package/dist/compatible/index.js +0 -2686
  86. package/dist/compatible/indicators.js +0 -459
  87. package/dist/compatible/module.js +0 -180
  88. package/dist/compatible/number.js +0 -425
  89. package/dist/compatible/object.js +0 -1004
  90. package/dist/compatible/process.js +0 -275
  91. package/dist/compatible/property-types.js +0 -167
  92. package/dist/compatible/scope.js +0 -1808
  93. package/dist/compatible/string.js +0 -1095
  94. package/dist/compatible/test-helper.js +0 -690
  95. package/dist/compatible/type.js +0 -50
  96. package/dist/compatible/utility.js +0 -362
  97. package/dist/constants.d.ts +0 -99
  98. package/dist/context.d.ts +0 -8
  99. package/dist/cookie.d.ts +0 -31
  100. package/dist/data-transfer.d.ts +0 -45
  101. package/dist/datetime.d.ts +0 -37
  102. package/dist/domNode.d.ts +0 -82
  103. package/dist/expression/evaluators.d.ts +0 -55
  104. package/dist/expression/helper.d.ts +0 -4
  105. package/dist/expression/index.d.ts +0 -7
  106. package/dist/expression/indicator-functions.d.ts +0 -14
  107. package/dist/expression/type.d.ts +0 -70
  108. package/dist/filesystem.d.ts +0 -143
  109. package/dist/function.d.ts +0 -20
  110. package/dist/index.d.ts +0 -23
  111. package/dist/indicators.d.ts +0 -68
  112. package/dist/module.d.ts +0 -8
  113. package/dist/number.d.ts +0 -35
  114. package/dist/object.d.ts +0 -231
  115. package/dist/process.d.ts +0 -22
  116. package/dist/property-types.d.ts +0 -460
  117. package/dist/scope.d.ts +0 -44
  118. package/dist/string.d.ts +0 -312
  119. package/dist/test/Lock.d.ts +0 -1
  120. package/dist/test/Logger.d.ts +0 -1
  121. package/dist/test/Semaphore.d.ts +0 -1
  122. package/dist/test/array.d.ts +0 -1
  123. package/dist/test/cookie.d.ts +0 -1
  124. package/dist/test/data-transfer.d.ts +0 -1
  125. package/dist/test/datetime.d.ts +0 -1
  126. package/dist/test/domNode.d.ts +0 -1
  127. package/dist/test/expression/evaluators.d.ts +0 -1
  128. package/dist/test/expression/helper.d.ts +0 -1
  129. package/dist/test/expression/indicator-functions.d.ts +0 -1
  130. package/dist/test/filesystem.d.ts +0 -1
  131. package/dist/test/function.d.ts +0 -1
  132. package/dist/test/indicators.d.ts +0 -1
  133. package/dist/test/number.d.ts +0 -1
  134. package/dist/test/object.d.ts +0 -1
  135. package/dist/test/process.d.ts +0 -1
  136. package/dist/test/property-types.d.ts +0 -1
  137. package/dist/test/scope.d.ts +0 -1
  138. package/dist/test/string.d.ts +0 -1
  139. package/dist/test/utility.d.ts +0 -1
  140. package/dist/test-helper.d.ts +0 -143
  141. package/dist/type.d.ts +0 -230
  142. package/dist/utility.d.ts +0 -44
@@ -1,37 +0,0 @@
1
- import type { SecondParameter } from './type';
2
- export declare const DATE_TIME_PATTERN_CACHE: Array<RegExp>;
3
- /**
4
- * Formats given date or current via given format specification.
5
- * @param format - Format specification.
6
- * @param dateTime - Date time to format.
7
- * @param options - Additional configuration options for "Intl.DateTimeFormat".
8
- * @param locales - Locale or list of locales to use for formatting. First one
9
- * take precedence of latter ones.
10
- * @returns Formatted date time string.
11
- */
12
- export declare const dateTimeFormat: (format?: string, dateTime?: Date | number | string, options?: SecondParameter<typeof Intl.DateTimeFormat>, locales?: Array<string> | string) => string;
13
- /**
14
- * Interprets given content string as date time.
15
- * @param value - Date time string to interpret.
16
- * @param interpretAsUTC - Identifies if given date should be interpreted as
17
- * utc. If not set given strings will be interpreted as it is depended on
18
- * given format and number like string as utc.
19
- * @returns Interpret date time object.
20
- */
21
- export declare const interpretDateTime: (value: string, interpretAsUTC?: boolean | null) => Date | null;
22
- /**
23
- * Interprets a date object from given artefact.
24
- * @param value - To interpret.
25
- * @param interpretAsUTC - Identifies if given date should be interpreted as
26
- * utc. If not set given strings will be interpreted as it is dependent on
27
- * given format and numbers as utc.
28
- * @returns Interpreted date object or "null" if given value couldn't be
29
- * interpreted.
30
- */
31
- export declare const normalizeDateTime: (value?: string | null | number | Date, interpretAsUTC?: boolean | null) => Date | null;
32
- /**
33
- * Slice weekday from given date representation.
34
- * @param value - String to process.
35
- * @returns Sliced given string.
36
- */
37
- export declare const sliceWeekday: (value: string) => string;
package/dist/domNode.d.ts DELETED
@@ -1,82 +0,0 @@
1
- import type { GivenInterruptableScrollToOptions, KnownEventName } from './type';
2
- export declare const createDomNodes: <Type extends Node = Node>(html: string) => Type;
3
- export declare const fade: (domNode: HTMLElement, intervalInMilliseconds?: number, out?: boolean) => Promise<void> & {
4
- clear: () => void;
5
- resetStyles: () => void;
6
- };
7
- export declare const fadeIn: (domNode: HTMLElement, intervalInMilliseconds?: number) => Promise<void> & {
8
- clear: () => void;
9
- resetStyles: () => void;
10
- };
11
- export declare const fadeOut: (domNode: HTMLElement, intervalInMilliseconds?: number) => Promise<void> & {
12
- clear: () => void;
13
- resetStyles: () => void;
14
- };
15
- export declare const STOP_AUTO_SCROLLING: {
16
- value: import("./type").AnyFunction;
17
- };
18
- export declare const MANUAL_SCROLL_EVENT_NAMES: Array<KnownEventName>;
19
- export declare const SCROLL_EVENT_NAMES: Array<KnownEventName>;
20
- /**
21
- * Smoothly scrolls both horizontally and vertically to a target DOM node.
22
- * Cancels instantly if the user interacts with the mouse, touch, or keys.
23
- * @param givenOptions - Configuration options.
24
- * @param givenOptions.targetDomNode - The DOM node you want to scroll to.
25
- * @param givenOptions.containerDomNode - The scrollable parent.
26
- * @param givenOptions.durationInMilliseconds - Animation duration in
27
- * milliseconds.
28
- * @param givenOptions.interruptOnManualScroll - Whether to stop the animation
29
- * if the user starts to scroll manually.
30
- * @param givenOptions.offset - Pixel offsets.
31
- * @param givenOptions.offset.top - Vertical offset in pixels.
32
- * @param givenOptions.offset.left - Horizontal offset in pixels.
33
- */
34
- export declare const interruptableScrollTo: (givenOptions?: GivenInterruptableScrollToOptions) => void;
35
- /**
36
- * Scrolls to the given DomNode's location or tio of the page.
37
- * @param targetDomNode - DomNode to scroll to. If not given, scrolls to the
38
- * top of the page.
39
- * @param behavior - Scroll behavior to use.
40
- */
41
- export declare const scrollTo: (targetDomNode?: Node | null, behavior?: ScrollToOptions["behavior"]) => void;
42
- export declare const getAll: (root: Node) => Node[];
43
- export declare const closest: (node: Node, selector: string, startWithParent?: boolean) => Element | null;
44
- export declare const getParents: (node: Node) => Array<Node>;
45
- export declare const getText: (root: Node, recursive?: boolean) => Array<string>;
46
- /**
47
- * Checks whether given html or text strings are equal.
48
- * @param first - First html, selector to dom node or text to compare.
49
- * @param second - Second html, selector to dom node or text to compare.
50
- * @param forceHTMLString - Indicates whether given contents are
51
- * interpreted as html string (otherwise automatic detection will be
52
- * triggered).
53
- * @returns Returns true if both dom representations are equivalent.
54
- */
55
- export declare const isEquivalent: (first: Node | string, second: Node | string, forceHTMLString?: boolean) => boolean;
56
- /**
57
- * Checks whether the given dom node is visible or takes space in the document
58
- * flow.
59
- * Elements with visibility: hidden or opacity: 0 are considered to be visible,
60
- * since they still consume space in the layout. During animations that hide an
61
- * element, the element is considered to be visible until the end of the
62
- * animation.
63
- * @param domNode - To inspect.
64
- * @returns A boolean indicating the visibility.
65
- */
66
- export declare const isHidden: (domNode: HTMLElement) => boolean;
67
- export declare const onDocumentReady: (callback?: () => void) => Promise<void>;
68
- /**
69
- * Replaces a given dom node with given nodes.
70
- * @param domNodeToReplace - Node to replace its children.
71
- * @param replacementDomNodes - Node or array of nodes to use as replacement.
72
- * @param skipEmptyTextNodes - Configures whether to trim text.
73
- */
74
- export declare const replace: (domNodeToReplace: HTMLElement, replacementDomNodes: Array<Node> | Node, skipEmptyTextNodes?: boolean) => void;
75
- export declare const wrap: (domNodes: Node | NodeListOf<Node>, wrapper: HTMLElement) => void;
76
- /**
77
- * Moves the content of a given dom node one level up and removes the given
78
- * node.
79
- * @param domNode - Node to unwrap.
80
- * @returns List of unwrapped nodes.
81
- */
82
- export declare const unwrap: (domNode: HTMLElement) => Array<ChildNode>;
@@ -1,55 +0,0 @@
1
- import type { Mapping, Options } from '../';
2
- import type { NormalizedSelector, Selector, ArrayContainsExpression, AndExpression, OrExpression, ConcatExpression, Expression, IfExpression, SwitchExpression, CaseExpression, UnaryOperation, Operation, Condition, BasicScopeType, RecursiveKeyOf, MappingExpression } from './type';
3
- export declare const SELECTOR_KEY_NAMES: Set<string>;
4
- export declare const NO_ITEM_FOUND_SYMBOL: unique symbol;
5
- export declare const DEFAULT_OPTIONS: {
6
- skipMissingLevel: boolean;
7
- contextReplacements: {};
8
- delimiter: string;
9
- };
10
- export declare const normalizeSelector: <ScopeType extends BasicScopeType>(selector: Selector<ScopeType>, givenOptions?: Partial<Options<ScopeType> & {
11
- scope: ScopeType;
12
- }>) => NormalizedSelector<ScopeType>;
13
- export declare const selectArrayItem: (data: Array<unknown>, keyOrIndex: number | string) => unknown;
14
- /**
15
- * Retrieves substructure in given object referenced by given selector
16
- * path.
17
- * @param selector - Selector path.
18
- * @param scope - Object to search in.
19
- * @param givenOptions - Object to configure evaluation.
20
- * @param givenOptions.contextReplacements - Configuration how to replace
21
- * "this" and "thisParent" keywords in selectors.
22
- * @param givenOptions.delimiter - Delimiter to delimit given selector
23
- * components.
24
- * @param givenOptions.skipMissingLevel - Indicates to skip missing level in
25
- * given path.
26
- * @returns Determined sub structure of given data or "undefined".
27
- */
28
- export declare const evaluateSelectorUntilLastObject: <ScopeType extends BasicScopeType>(selector: Selector<ScopeType>, scope?: ScopeType, givenOptions?: Partial<Options<ScopeType>>) => [ScopeType, RecursiveKeyOf];
29
- /**
30
- * Retrieves substructure in given object referenced by given selector
31
- * path.
32
- * @param selector - Selector path.
33
- * @param scope - Object to search in.
34
- * @param options - Options object to configure evaluation.
35
- * @param options.contextReplacements - Configuration how to replace "this"
36
- * and "thisParent" keywords in selectors.
37
- * @param options.delimiter - Delimiter to delimit given selector components.
38
- * @param options.skipMissingLevel - Indicates to skip missing level in given
39
- * path.
40
- * @returns Determined sub structure of given data or "undefined".
41
- */
42
- export declare const evaluateSelector: <Type, ScopeType extends BasicScopeType>(selector: Selector<ScopeType>, scope?: ScopeType, options?: Partial<Options<ScopeType>>) => Type;
43
- export declare const evaluateCondition: <ScopeType extends BasicScopeType>(condition: Condition, scope: ScopeType, options: Partial<Options<ScopeType>>) => boolean;
44
- export declare const evaluateUnaryOperation: <ScopeType extends BasicScopeType>(operation: UnaryOperation, scope: ScopeType, options: Partial<Options<ScopeType>>) => boolean;
45
- export declare const evaluateOperation: <ScopeType extends BasicScopeType>(operation: Operation, scope: ScopeType, options: Partial<Options<ScopeType>>) => number;
46
- export declare const evaluateOptionalThen: <Type, ScopeType extends BasicScopeType>(expression: IfExpression<Type> | CaseExpression<Type>, scope: ScopeType, options: Partial<Options<ScopeType>>) => Type;
47
- export declare const evaluateIf: <Type, ScopeType extends BasicScopeType>(expression: IfExpression<Type>, scope: ScopeType, options: Partial<Options<ScopeType>>) => Type;
48
- export declare const evaluateSwitch: <Type, ScopeType extends BasicScopeType>(expression: SwitchExpression<Type>, scope: ScopeType, options: Partial<Options<ScopeType>>) => Type;
49
- export declare const evaluateAnd: <ScopeType extends BasicScopeType>(expression: AndExpression, scope: ScopeType, options: Partial<Options<ScopeType>>) => boolean;
50
- export declare const evaluateOr: <ScopeType extends BasicScopeType>(expression: OrExpression, scope: ScopeType, options: Partial<Options<ScopeType>>) => boolean;
51
- export declare const evaluateConcat: <ScopeType extends BasicScopeType>(expression: ConcatExpression, scope: ScopeType, options: Partial<Options<ScopeType>>) => Array<unknown> | string;
52
- export declare const evaluateMapping: <ScopeType extends BasicScopeType>(expression: MappingExpression, scope: ScopeType, options: Partial<Options<ScopeType>>) => Array<Mapping<unknown>>;
53
- export declare const evaluateArrayContains: <ScopeType extends BasicScopeType>(expression: ArrayContainsExpression, scope: ScopeType, options: Partial<Options<ScopeType>>) => boolean;
54
- export declare function evaluateExpression<Type, ScopeType extends BasicScopeType>(expression: Expression<Type, ScopeType>, scope?: ScopeType, options?: Partial<Options<ScopeType>>): Type;
55
- export default evaluateExpression;
@@ -1,4 +0,0 @@
1
- import type { Mapping } from '../';
2
- import type { BasicScopeType } from './type';
3
- export declare const viewArrayAsScope: <Type extends Array<Mapping<unknown>>, ScopeType extends BasicScopeType>(data: Type, childrenPropertyNames: Array<string>, propertyReferenceKeys: Array<string>) => ScopeType;
4
- export declare const viewObjectAsScope: <Type extends Mapping<unknown>, ScopeType extends BasicScopeType = BasicScopeType>(data: Type, childrenPropertyNames?: string[], propertyReferenceKeys?: string[]) => ScopeType;
@@ -1,7 +0,0 @@
1
- export * from './type';
2
- import evaluateExpressionFunction from './evaluators';
3
- export * from './evaluators';
4
- export * from './helper';
5
- export * from './indicator-functions';
6
- export declare const evaluateExpression: typeof evaluateExpressionFunction;
7
- export default evaluateExpression;
@@ -1,14 +0,0 @@
1
- import type { BasicScopeType, AndExpression, OrExpression, ConcatExpression, MappingExpression, Expression, IfExpression, SwitchExpression, Operation, UnaryOperation, Condition, SelectorExpression, ArrayContainsExpression } from './type';
2
- export declare const isSpecificExpression: (expression: Expression, indicatorKey: string, properties?: Array<string>) => boolean;
3
- export declare const isCondition: (expression: Expression) => expression is Condition;
4
- export declare const isAndExpression: (expression: Expression) => expression is AndExpression;
5
- export declare const isOrExpression: (expression: Expression) => expression is OrExpression;
6
- export declare const isConcatExpression: (expression: Expression) => expression is ConcatExpression;
7
- export declare const isMappingExpression: (expression: Expression) => expression is MappingExpression;
8
- export declare const isOperation: (expression: Expression) => expression is Operation;
9
- export declare const isUnaryOperation: (expression: Expression) => expression is UnaryOperation;
10
- export declare const isIfExpression: <Type>(expression: Expression<Type>) => expression is IfExpression<Type>;
11
- export declare const isSwitchExpression: <Type>(expression: Expression<Type>) => expression is SwitchExpression<Type>;
12
- export declare const isSelector: <Type, ScopeType extends BasicScopeType>(expression: Expression<Type, ScopeType>) => expression is SelectorExpression<ScopeType>;
13
- export declare const isArrayContainsExpression: <Type, ScopeType extends BasicScopeType>(expression: Expression<Type, ScopeType>) => expression is ArrayContainsExpression;
14
- export declare const isValue: <Type, ScopeType extends BasicScopeType>(expression: Expression<Type, ScopeType>) => expression is Type;
@@ -1,70 +0,0 @@
1
- import type { Mapping } from '../';
2
- export type BasicScopeType = Array<unknown> | Mapping<unknown> | unknown;
3
- export type KeyPathOf = string;
4
- export type SimpleRecursiveKeyOf = number | string;
5
- export type RecursiveKeyOf = ((scope: unknown) => unknown) | SimpleRecursiveKeyOf;
6
- export type SelectorItem<Type extends BasicScopeType> = RecursiveKeyOf | Expression<RecursiveKeyOf | number, Type>;
7
- export type NormalizedSelector<Type extends BasicScopeType> = Array<SelectorItem<Type>>;
8
- export type Selector<Type extends BasicScopeType> = SelectorItem<Type> | NormalizedSelector<Type>;
9
- export type ContextReplacements<ScopeType extends BasicScopeType> = Mapping<Selector<ScopeType>>;
10
- export interface Options<ScopeType extends BasicScopeType> {
11
- contextReplacements: ContextReplacements<ScopeType>;
12
- delimiter: string;
13
- skipMissingLevel: boolean;
14
- }
15
- export type Comparator = '==' | '!=' | '<' | '>' | '<=' | '>=';
16
- export type UnaryOperator = '!' | '!!';
17
- export type Operator = '+' | '-' | '*' | '**' | '/';
18
- export type Scope<Type = unknown> = Mapping<Type>;
19
- export interface Condition {
20
- value1: Expression;
21
- $comparator: Comparator;
22
- value2: Expression;
23
- }
24
- export interface IfExpression<Type> {
25
- $if: Expression<boolean>;
26
- then?: Expression<Type>;
27
- else?: Expression<Type>;
28
- }
29
- export interface SwitchExpression<Type> {
30
- $switch: Expression;
31
- caseExpressions: Array<CaseExpression<Type>>;
32
- default?: Expression<Type>;
33
- }
34
- export interface CaseExpression<Type> {
35
- $case: Expression;
36
- then?: Expression<Type>;
37
- }
38
- export interface ArrayContainsExpression {
39
- $arrayContains: {
40
- target?: Expression;
41
- key?: Expression<string>;
42
- value: Expression<string | number | boolean>;
43
- };
44
- }
45
- export interface AndExpression {
46
- $and: Array<Expression<boolean>>;
47
- }
48
- export interface OrExpression {
49
- $or: Array<Expression<boolean>>;
50
- }
51
- export interface ConcatExpression {
52
- $concat: Array<Expression<Array<unknown> | string>>;
53
- }
54
- export interface MappingExpression {
55
- $mapping: Expression<Mapping>;
56
- data: Expression<Mapping<Mapping<unknown>> | Array<Mapping<unknown>>>;
57
- }
58
- export interface UnaryOperation {
59
- operand: Expression;
60
- $operator: UnaryOperator;
61
- }
62
- export interface Operation {
63
- operand1: Expression<number>;
64
- $operator: Operator;
65
- operand2: Expression<number>;
66
- }
67
- export interface SelectorExpression<ScopeType extends BasicScopeType> {
68
- $select: Selector<ScopeType>;
69
- }
70
- export type Expression<Type = unknown, ScopeType extends BasicScopeType = BasicScopeType> = Condition | AndExpression | OrExpression | ConcatExpression | MappingExpression | UnaryOperation | Operation | IfExpression<Type> | SwitchExpression<Type> | ArrayContainsExpression | SelectorExpression<ScopeType> | Type;
@@ -1,143 +0,0 @@
1
- import type { ObjectEncodingOptions } from 'node:fs';
2
- import type { AnyFunction, Encoding, File, FileTraverseResult } from './type';
3
- export declare const imports: {
4
- fs: null | typeof import('fs');
5
- fsPromises: null | typeof import('fs/promises');
6
- path: null | typeof import('path');
7
- };
8
- export declare const importsPromise: Promise<[typeof import("fs") | null, typeof import("fs/promises") | null, typeof import("node:path") | null]>;
9
- /**
10
- * Copies given source directory via path to given target directory location
11
- * with same target name as source file has or copy to given complete target
12
- * directory path.
13
- * @param sourcePath - Path to directory to copy.
14
- * @param targetPath - Target directory or complete directory location to copy
15
- * in.
16
- * @param contents - Indicates whether we only want to copy content of source
17
- * path without recreating the sourcefile itself on target location.
18
- * @param callback - Function to invoke for each traversed file.
19
- * @param readOptions - Options to use for reading source file.
20
- * @param writeOptions - Options to use for writing to target file.
21
- * @returns Promise holding the determined target directory path.
22
- */
23
- export declare const copyDirectoryRecursive: (sourcePath: string, targetPath: string, contents?: boolean, callback?: AnyFunction, readOptions?: {
24
- encoding: null;
25
- flag: string;
26
- }, writeOptions?: {
27
- encoding: Encoding;
28
- flag: string;
29
- mode: number;
30
- }) => Promise<string>;
31
- /**
32
- * Copies given source directory via path to given target directory location
33
- * with same target name as source file has or copy to given complete target
34
- * directory path.
35
- * @param sourcePath - Path to directory to copy.
36
- * @param targetPath - Target directory or complete directory location to copy
37
- * in.
38
- * @param contents - Indicates whether we only want to copy content of source
39
- * path without recreating the sourcefile itself on target location.
40
- * @param callback - Function to invoke for each traversed file.
41
- * @param readOptions - Options to use for reading source file.
42
- * @param writeOptions - Options to use for writing to target file.
43
- * @returns Determined target directory path.
44
- */
45
- export declare const copyDirectoryRecursiveSync: (sourcePath: string, targetPath: string, contents?: boolean, callback?: AnyFunction, readOptions?: {
46
- encoding: null;
47
- flag: string;
48
- }, writeOptions?: {
49
- encoding: Encoding;
50
- flag: string;
51
- mode: number;
52
- }) => string;
53
- /**
54
- * Copies given source file via path to given target directory location with
55
- * same target name as source file has or copy to given complete target file
56
- * path.
57
- * @param sourcePath - Path to file to copy.
58
- * @param targetPath - Target directory or complete file location to copy to.
59
- * @param readOptions - Options to use for reading source file.
60
- * @param writeOptions - Options to use for writing to target file.
61
- * @returns Determined target file path.
62
- */
63
- export declare const copyFile: (sourcePath: string, targetPath: string, readOptions?: {
64
- encoding: null;
65
- flag: string;
66
- }, writeOptions?: {
67
- encoding: Encoding;
68
- flag: string;
69
- mode: number;
70
- }) => Promise<string>;
71
- /**
72
- * Copies given source file via path to given target directory location with
73
- * same target name as source file has or copy to given complete target file
74
- * path.
75
- * @param sourcePath - Path to file to copy.
76
- * @param targetPath - Target directory or complete file location to copy to.
77
- * @param readOptions - Options to use for reading source file.
78
- * @param writeOptions - Options to use for writing to target file.
79
- * @returns Determined target file path.
80
- */
81
- export declare const copyFileSync: (sourcePath: string, targetPath: string, readOptions?: {
82
- encoding: null;
83
- flag: string;
84
- }, writeOptions?: {
85
- encoding: Encoding;
86
- flag: string;
87
- mode: number;
88
- }) => string;
89
- /**
90
- * Checks if given path points to a valid directory.
91
- * @param filePath - Path to directory.
92
- * @returns A promise holding a boolean which indicates directory existence.
93
- */
94
- export declare const isDirectory: (filePath: string) => Promise<boolean>;
95
- /**
96
- * Checks if given path points to a valid directory.
97
- * @param filePath - Path to directory.
98
- * @returns A boolean which indicates directory existence.
99
- */
100
- export declare const isDirectorySync: (filePath: string) => boolean;
101
- /**
102
- * Checks if given path points to a valid file.
103
- * @param filePath - Path to directory.
104
- * @returns A promise holding a boolean which indicates directory existence.
105
- */
106
- export declare const isFile: (filePath: string) => Promise<boolean>;
107
- /**
108
- * Checks if given path points to a valid file.
109
- * @param filePath - Path to file.
110
- * @returns A boolean which indicates file existence.
111
- */
112
- export declare const isFileSync: (filePath: string) => boolean;
113
- /**
114
- * Iterates through given directory structure recursively and calls given
115
- * callback for each found file. Callback gets file path and corresponding stat
116
- * object as argument.
117
- * @param directoryPath - Path to directory structure to traverse.
118
- * @param callback - Function to invoke for each traversed file and potentially
119
- * manipulate further traversing in alphabetical sorted order.
120
- * If it returns "null" or a promise resolving to "null", no further files
121
- * will be traversed afterward.
122
- * If it handles a directory and returns "false" or a promise resolving to
123
- * "false" no traversing into that directory will occur.
124
- * @param options - Options to use for nested "readdir" calls.
125
- * @returns A promise holding the determined files.
126
- */
127
- export declare const walkDirectoryRecursively: (directoryPath: string, callback?: null | ((file: File) => FileTraverseResult), options?: (Encoding | (ObjectEncodingOptions & {
128
- withFileTypes?: false;
129
- recursive?: boolean;
130
- }))) => Promise<Array<File>>;
131
- /**
132
- * Iterates through given directory structure recursively and calls given
133
- * callback for each found file. Callback gets file path and corresponding
134
- * stats object as argument.
135
- * @param directoryPath - Path to directory structure to traverse.
136
- * @param callback - Function to invoke for each traversed file.
137
- * @param options - Options to use for nested "readdir" calls.
138
- * @returns Determined list if all files.
139
- */
140
- export declare const walkDirectoryRecursivelySync: (directoryPath: string, callback?: AnyFunction | null, options?: (Encoding | (ObjectEncodingOptions & {
141
- withFileTypes?: false;
142
- recursive?: boolean;
143
- }))) => Array<File>;
@@ -1,20 +0,0 @@
1
- import type { AnyFunction } from './type';
2
- /**
3
- * Determines all parameter names from given callable (function or class,
4
- * ...).
5
- * @param callable - Function or function code to inspect.
6
- * @returns List of parameter names.
7
- */
8
- export declare const getParameterNames: (callable: AnyFunction | string) => Array<string>;
9
- /**
10
- * Implements the identity function.
11
- * @param value - A value to return.
12
- * @returns Returns the given value.
13
- */
14
- export declare const identity: <T>(value: T) => T;
15
- /**
16
- * Inverted filter helper to inverse each given filter.
17
- * @param filter - A function that filters an array.
18
- * @returns The inverted filter.
19
- */
20
- export declare const invertArrayFilter: <T, D = Array<unknown>>(filter: T) => T;
package/dist/index.d.ts DELETED
@@ -1,23 +0,0 @@
1
- export * from './array';
2
- export * from './domNode';
3
- export * from './cli';
4
- export * from './constants';
5
- export * from './context';
6
- export * from './cookie';
7
- export * from './data-transfer';
8
- export * from './datetime';
9
- export * from './expression/index';
10
- export * from './filesystem';
11
- export * from './function';
12
- export * from './indicators';
13
- export * from './Lock';
14
- export * from './number';
15
- export * from './object';
16
- export * from './process';
17
- export * from './module';
18
- export * from './scope';
19
- export * from './Semaphore';
20
- export * from './string';
21
- export * from './Logger';
22
- export * from './type';
23
- export * from './utility';
@@ -1,68 +0,0 @@
1
- import type { AnyFunction, Mapping, PlainObject, ProxyType } from './type';
2
- /**
3
- * Determines whether its argument represents a JavaScript number.
4
- * @param value - Value to analyze.
5
- * @returns A boolean value indicating whether given object is numeric
6
- * like.
7
- */
8
- export declare const isNumeric: (value: unknown) => value is number;
9
- /**
10
- * Determine whether the argument is a window.
11
- * @param value - Value to check for.
12
- * @returns Boolean value indicating the result.
13
- */
14
- export declare const isWindow: (value: unknown) => value is Window;
15
- /**
16
- * Checks if given object is similar to an array and can be handled like an
17
- * array.
18
- * @param object - Object to check behavior for.
19
- * @returns A boolean value indicating whether given object is array like.
20
- */
21
- export declare const isArrayLike: (object: unknown) => boolean;
22
- /**
23
- * Checks whether one of the given pattern matches given string.
24
- * @param target - Target to check in pattern for.
25
- * @param pattern - List of pattern to check for.
26
- * @returns Value "true" if given object is matches by at leas one of the
27
- * given pattern and "false" otherwise.
28
- */
29
- export declare const isAnyMatching: (target: string, pattern: Array<RegExp | string>) => boolean;
30
- /**
31
- * Checks whether given object is a native object but not null.
32
- * @param value - Value to check.
33
- * @returns Value "true" if given object is a plain javaScript object and
34
- * "false" otherwise.
35
- */
36
- export declare const isObject: (value: unknown) => value is Mapping<unknown>;
37
- /**
38
- * Checks whether given object is a plain native object.
39
- * @param value - Value to check.
40
- * @returns Value "true" if given object is a plain javaScript object and
41
- * "false" otherwise.
42
- */
43
- export declare const isPlainObject: (value: unknown) => value is PlainObject;
44
- /**
45
- * Checks whether given object is a set.
46
- * @param value - Value to check.
47
- * @returns Value "true" if given object is a set and "false" otherwise.
48
- */
49
- export declare const isSet: (value: unknown) => value is Set<unknown>;
50
- /**
51
- * Checks whether given object is a map.
52
- * @param value - Value to check.
53
- * @returns Value "true" if given object is a map and "false" otherwise.
54
- */
55
- export declare const isMap: (value: unknown) => value is Map<unknown, unknown>;
56
- /**
57
- * Checks whether given object is a proxy.
58
- * @param value - Value to check.
59
- * @returns Value "true" if given object is a proxy and "false" otherwise.
60
- */
61
- export declare const isProxy: (value: unknown) => value is ProxyType;
62
- /**
63
- * Checks whether given object is a function.
64
- * @param value - Value to check.
65
- * @returns Value "true" if given object is a function and "false"
66
- * otherwise.
67
- */
68
- export declare const isFunction: (value: unknown) => value is AnyFunction;
package/dist/module.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import type { FirstParameter } from './type';
2
- export declare const determineGlobalContext: () => Partial<typeof globalThis>;
3
- export declare const currentRequire: null | typeof require;
4
- export declare const optionalRequire: <T = unknown>(id: string) => null | T;
5
- export declare const clearRequireCache: (cache?: typeof require.cache) => typeof require.cache;
6
- export declare const isolatedRequire: (path: FirstParameter<typeof require>, requireFunction?: typeof require) => ReturnType<typeof require>;
7
- export declare const isImportSyntaxSupported: () => boolean;
8
- export declare const optionalImport: <T = unknown>(id: string, options?: {}) => Promise<null | T>;
package/dist/number.d.ts DELETED
@@ -1,35 +0,0 @@
1
- /**
2
- * Determines corresponding utc timestamp for given date object.
3
- * @param value - Date to convert.
4
- * @param inMilliseconds - Indicates whether given number should be in
5
- * seconds (default) or milliseconds.
6
- * @returns Determined numerous value.
7
- */
8
- export declare const getUTCTimestamp: (value?: Date | null | number | string, inMilliseconds?: boolean) => number;
9
- /**
10
- * Checks if given object is java scripts native "Number.NaN" object.
11
- * @param value - Value to check.
12
- * @returns Returns whether given value is not a number or not.
13
- */
14
- export declare const isNotANumber: (value: unknown) => boolean;
15
- /**
16
- * Rounds a given number accurate to given number of digits.
17
- * @param number - The number to round.
18
- * @param digits - The number of digits after comma.
19
- * @returns Returns the rounded number.
20
- */
21
- export declare const round: (number: number, digits?: number) => number;
22
- /**
23
- * Rounds a given number up accurate to given number of digits.
24
- * @param number - The number to round.
25
- * @param digits - The number of digits after comma.
26
- * @returns Returns the rounded number.
27
- */
28
- export declare const ceil: (number: number, digits?: number) => number;
29
- /**
30
- * Rounds a given number down accurate to given number of digits.
31
- * @param number - The number to round.
32
- * @param digits - The number of digits after comma.
33
- * @returns Returns the rounded number.
34
- */
35
- export declare const floor: (number: number, digits?: number) => number;