---
title: "Utils | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-js/reference/design-atoms-model/Utils-2/"
---

# Utils

> `boolean`

## Interfaces

### IEqualsReady

#### Methods

##### equals()

```ts
equals(object): boolean;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `object` | `Object` |

###### Returns

## Variables

### delay

```ts
const delay: (delay?) => Promise<void> = timeout;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `delay?` | `number` |

#### Returns

`Promise`\<`void`\>

## Functions

### applyNullableValue()

```ts
function applyNullableValue<T>(actual, redefined): T;
```

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `actual` | `T` |
| `redefined` | `T` |

#### Returns

`T`

***

### applyUndefinedValue()

```ts
function applyUndefinedValue<T>(actual, redefined): T;
```

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `actual` | `T` |
| `redefined` | `T` |

#### Returns

`T`

***

### ~~arrayEquals()~~

```ts
function arrayEquals(obj1, obj2): boolean;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `obj1` | `equalsBasicType`[] |
| `obj2` | `equalsBasicType`[] |

#### Returns

`boolean`

#### Deprecated

use arrayIsEquals from `@aurigma/utils-js/algorithms/array`

***

### arrayReferenceEquals()

```ts
function arrayReferenceEquals(obj1, obj2): boolean;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `obj1` | `Object`[] |
| `obj2` | `Object`[] |

#### Returns

`boolean`

***

### assign()

```ts
function assign<T>(
   target, 
   sources, 
   options?): T;
```

#### Type Parameters

| Type Parameter |
| ------ |
| `T` *extends* `Object` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `target` | `T` |
| `sources` | `any`[] |
| `options?` | \{ `deep?`: `boolean`; `ignoreNull?`: `boolean`; \} |
| `options.deep?` | `boolean` |
| `options.ignoreNull?` | `boolean` |

#### Returns

`T`

***

### assignProperties()

```ts
function assignProperties<T>(target, propObject): T;
```

#### Type Parameters

| Type Parameter |
| ------ |
| `T` *extends* `Object` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `target` | `T` |
| `propObject` | `Partial`\<`T`\> |

#### Returns

`T`

***

### createCssDataUri()

```ts
function createCssDataUri(css): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `css` | `string` |

#### Returns

`string`

***

### enableMoveDropDownFocus()

```ts
function enableMoveDropDownFocus(element, getFocusElement): void;
```

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `element` | `HTMLElement` | Element contains twitter bootstrap dropdown |
| `getFocusElement` | () => `any` | Function returns element to be focused after dropdown expand |

#### Returns

`void`

***

### equals()

```ts
function equals(obj1, obj2): any;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `obj1` | `equalsType` |
| `obj2` | `equalsType` |

#### Returns

`any`

***

### escapeXml()

```ts
function escapeXml(str): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `str` | `string` |

#### Returns

`string`

***

### ~~flatten()~~

```ts
function flatten<T>(nestedCollec): T[];
```

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `nestedCollec` | `T`[][] |

#### Returns

`T`[]

#### Deprecated

use native JS array flatten

***

### getCurrentLineInTextArea()

```ts
function getCurrentLineInTextArea(element): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `element` | `HTMLTextAreaElement` |

#### Returns

`string`

***

### getExtension()

```ts
function getExtension(fileName): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `fileName` | `string` |

#### Returns

`string`

***

### getFontNames()

```ts
function getFontNames(text): string[];
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `text` | `string` |

#### Returns

`string`[]

***

### getHiddenElemenHeight()

```ts
function getHiddenElemenHeight(el): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `el` | `HTMLElement` |

#### Returns

`number`

***

### getLastPathSegment()

```ts
function getLastPathSegment(path): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `path` | `string` |

#### Returns

`string`

***

### getNameWithoutExtension()

```ts
function getNameWithoutExtension(fileName): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `fileName` | `string` |

#### Returns

`string`

***

### getStringEnumValue()

```ts
function getStringEnumValue(enumObject, enumValue): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `enumObject` | `Object` |
| `enumValue` | `string` |

#### Returns

`string`

***

### getTextFromXml()

```ts
function getTextFromXml(xmlFormattedText, replaceParagraphString?): string;
```

#### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `xmlFormattedText` | `string` | `undefined` |
| `replaceParagraphString` | `string` | `" "` |

#### Returns

`string`

***

### getUniqueId()

```ts
function getUniqueId(object): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `object` | `Object` |

#### Returns

`string`

***

### isEmpty()

```ts
function isEmpty<T>(value): boolean;
```

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `T` |

#### Returns

`boolean`

***

### isEqual()

```ts
function isEqual(a, b): boolean;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `a` | `any` |
| `b` | `any` |

#### Returns

`boolean`

***

### isFocused()

```ts
function isFocused(element): any;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `element` | `Element` |

#### Returns

`any`

***

### isNullOrEmptyOrWhiteSpace()

```ts
function isNullOrEmptyOrWhiteSpace(str): boolean;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `str` | `string` |

#### Returns

`boolean`

***

### isNumber()

```ts
function isNumber(value): value is number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `any` |

#### Returns

`value is number`

***

### isObject()

```ts
function isObject(value): boolean;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `any` |

#### Returns

`boolean`

***

### isValidXml()

```ts
function isValidXml(str, fixAmpsEnabled?): boolean;
```

#### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `str` | `string` | `undefined` |
| `fixAmpsEnabled` | `boolean` | `true` |

#### Returns

`boolean`

***

### localStorageEnabled()

```ts
function localStorageEnabled(): boolean;
```

#### Returns

`boolean`

***

### measureScrollbar()

```ts
function measureScrollbar(): number;
```

#### Returns

`number`

***

### mmToPoint()

```ts
function mmToPoint(millimeters): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `millimeters` | `number` |

#### Returns

`number`

***

### normalize()

```ts
function normalize<T>(paramObject, def): T;
```

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `paramObject` | `T` |
| `def` | `Partial`\<`T`\> |

#### Returns

`T`

***

### parsePercentOrPointValue()

```ts
function parsePercentOrPointValue(point, printAreaSize): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `point` | `string` \| `number` |
| `printAreaSize` | `number` |

#### Returns

`number`

***

### parseXmlStyle()

```ts
function parseXmlStyle(element): Map<string, string>;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `element` | `Element` |

#### Returns

`Map`\<`string`, `string`\>

***

### stringFormat()

```ts
function stringFormat(str): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `str` | `string` |

#### Returns

`string`

***

### stripForJson()

```ts
function stripForJson(obj, omitProperties?): object;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `obj` | `any` |
| `omitProperties?` | `string` \| `string`[] |

#### Returns

`object`

***

### strToInt()

```ts
function strToInt(str): number;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `str` | `string` |

#### Returns

`number`

***

### timeout()

```ts
function timeout(delay?): Promise<void>;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `delay?` | `number` |

#### Returns

`Promise`\<`void`\>

***

### toDashedStyle()

```ts
function toDashedStyle(camleCase): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `camleCase` | `string` |

#### Returns

`string`

***

### unescapeXml()

```ts
function unescapeXml(str): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `str` | `string` |

#### Returns

`string`

***

### urlCombine()

```ts
function urlCombine(startUrl, ...urlParts): string;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `startUrl` | `string` |
| ...`urlParts` | `string`[] |

#### Returns

`string`

***

### walkNodes()

```ts
function walkNodes(
   gmXml, 
   nodeNames, 
   parseNode): void;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `gmXml` | `string` |
| `nodeNames` | `string`[] |
| `parseNode` | (`node`) => `void` |

#### Returns

`void`
