@base-framework/base 3.0.190 → 3.0.192
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/base.js +1 -1
- package/dist/base.js.map +3 -3
- package/dist/types/shared/objects.d.ts +30 -30
- package/dist/types/shared/strings.d.ts +19 -20
- package/package.json +1 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
export namespace Objects {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Creates a new object, optionally extending from another object.
|
|
4
4
|
*
|
|
5
|
-
* @param {object} [
|
|
6
|
-
* @returns {object}
|
|
5
|
+
* @param {object} [prototype] - The prototype object to extend from.
|
|
6
|
+
* @returns {object} The newly created object.
|
|
7
7
|
*/
|
|
8
|
-
function create(
|
|
8
|
+
function create(prototype?: any): any;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Extends properties from the source object to the target object.
|
|
11
|
+
* Only copies properties that are not already defined on the target object.
|
|
11
12
|
*
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {
|
|
14
|
-
* @returns {object}
|
|
13
|
+
* @param {object} sourceObj - The source object.
|
|
14
|
+
* @param {object} targetObj - The target object to extend.
|
|
15
|
+
* @returns {object|false} The extended target object or false if invalid.
|
|
15
16
|
*/
|
|
16
17
|
function extendObject(sourceObj: any, targetObj: any): any;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* Deep clones an object in a safe and scalable manner.
|
|
19
20
|
*
|
|
20
|
-
* @param {object} obj
|
|
21
|
-
* @returns {object}
|
|
21
|
+
* @param {object} obj - The object to clone.
|
|
22
|
+
* @returns {object} A deep clone of the object.
|
|
22
23
|
*/
|
|
23
24
|
function clone(obj: any): any;
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
+
* Retrieves the prototype of a class or object.
|
|
26
27
|
*
|
|
27
|
-
* @
|
|
28
|
-
* @
|
|
29
|
-
* @returns {object}
|
|
28
|
+
* @param {function|object} entity - The class or object.
|
|
29
|
+
* @returns {object} The prototype of the entity.
|
|
30
30
|
*/
|
|
31
|
-
function getClassObject(
|
|
31
|
+
function getClassObject(entity: any): any;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Extends a class or object with the properties of another class or object.
|
|
34
34
|
*
|
|
35
|
-
* @param {function|object} sourceClass
|
|
36
|
-
* @param {function|object} targetClass
|
|
37
|
-
* @returns {object}
|
|
35
|
+
* @param {function|object} sourceClass - The source class or object.
|
|
36
|
+
* @param {function|object} targetClass - The target class or object.
|
|
37
|
+
* @returns {object|false} The resulting extended object or false if invalid.
|
|
38
38
|
*/
|
|
39
39
|
function extendClass(sourceClass: any, targetClass: any): any;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Checks if an object has a specific property.
|
|
42
42
|
*
|
|
43
|
-
* @param {object} obj
|
|
44
|
-
* @param {string} prop
|
|
45
|
-
* @returns {boolean}
|
|
43
|
+
* @param {object} obj - The object to check.
|
|
44
|
+
* @param {string} prop - The property to check for.
|
|
45
|
+
* @returns {boolean} True if the object has the property.
|
|
46
46
|
*/
|
|
47
47
|
function hasOwnProp(obj: any, prop: string): boolean;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Determines if a value is a plain object.
|
|
50
50
|
*
|
|
51
|
-
* @param {object} obj
|
|
52
|
-
* @returns {boolean}
|
|
51
|
+
* @param {object} obj - The value to check.
|
|
52
|
+
* @returns {boolean} True if the value is a plain object.
|
|
53
53
|
*/
|
|
54
54
|
function isPlainObject(obj: any): boolean;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Checks if an object is empty.
|
|
57
57
|
*
|
|
58
|
-
* @param {object} obj
|
|
59
|
-
* @returns {boolean}
|
|
58
|
+
* @param {object} obj - The object to check.
|
|
59
|
+
* @returns {boolean} True if the object has no own properties.
|
|
60
60
|
*/
|
|
61
61
|
function isEmpty(obj: any): boolean;
|
|
62
62
|
}
|
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Strings
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Contains utility methods for working with strings.
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
* @name Strings
|
|
8
8
|
*/
|
|
9
9
|
export class Strings {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Limits the length of a string.
|
|
12
12
|
*
|
|
13
|
-
* @param {string} str
|
|
14
|
-
* @param {number} [maxLength]
|
|
15
|
-
* @returns {string}
|
|
13
|
+
* @param {string} str - The string to limit.
|
|
14
|
+
* @param {number} [maxLength=1000] - The maximum length of the string.
|
|
15
|
+
* @returns {string} The truncated string.
|
|
16
16
|
*/
|
|
17
17
|
static limit(str: string, maxLength?: number): string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Parses a query string into an object.
|
|
20
20
|
*
|
|
21
|
-
* @param {string} [str] The string to parse
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
24
|
-
* @returns {object}
|
|
21
|
+
* @param {string} [str=window.location.search] - The string to parse.
|
|
22
|
+
* @param {boolean} [decode=true] - Whether to decode the query values.
|
|
23
|
+
* @returns {object} An object representing the query string parameters.
|
|
25
24
|
*/
|
|
26
25
|
static parseQueryString(str?: string, decode?: boolean): object;
|
|
27
26
|
/**
|
|
28
|
-
*
|
|
27
|
+
* Converts a string to camelCase.
|
|
29
28
|
*
|
|
30
|
-
* @param {string} str
|
|
31
|
-
* @returns {string} The string
|
|
29
|
+
* @param {string} str - The string to convert.
|
|
30
|
+
* @returns {string} The camelCased string.
|
|
32
31
|
*/
|
|
33
32
|
static camelCase(str: string): string;
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
34
|
+
* Converts a camelCase string to a delimited format.
|
|
36
35
|
*
|
|
37
|
-
* @param {string} str
|
|
38
|
-
* @param {string} [delimiter]
|
|
39
|
-
* @returns {string} The string.
|
|
36
|
+
* @param {string} str - The camelCase string.
|
|
37
|
+
* @param {string} [delimiter="-"] - The delimiter to use.
|
|
38
|
+
* @returns {string} The uncamelCased string.
|
|
40
39
|
*/
|
|
41
40
|
static uncamelCase(str: string, delimiter?: string): string;
|
|
42
41
|
/**
|
|
43
|
-
*
|
|
42
|
+
* Converts a string to Title Case.
|
|
44
43
|
*
|
|
45
|
-
* @param {string} str
|
|
46
|
-
* @returns {string} The string.
|
|
44
|
+
* @param {string} str - The string to convert.
|
|
45
|
+
* @returns {string} The title-cased string.
|
|
47
46
|
*/
|
|
48
47
|
static titleCase(str: string): string;
|
|
49
48
|
}
|