Last change
on this file since 6fe77af was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | /**
|
---|
9 | * Coerces a value to an array of trimmed non-empty strings.
|
---|
10 | * Any input that is not an array, `null` or `undefined` will be turned into a string
|
---|
11 | * via `toString()` and subsequently split with the given separator.
|
---|
12 | * `null` and `undefined` will result in an empty array.
|
---|
13 | * This results in the following outcomes:
|
---|
14 | * - `null` -> `[]`
|
---|
15 | * - `[null]` -> `["null"]`
|
---|
16 | * - `["a", "b ", " "]` -> `["a", "b"]`
|
---|
17 | * - `[1, [2, 3]]` -> `["1", "2,3"]`
|
---|
18 | * - `[{ a: 0 }]` -> `["[object Object]"]`
|
---|
19 | * - `{ a: 0 }` -> `["[object", "Object]"]`
|
---|
20 | *
|
---|
21 | * Useful for defining CSS classes or table columns.
|
---|
22 | * @param value the value to coerce into an array of strings
|
---|
23 | * @param separator split-separator if value isn't an array
|
---|
24 | */
|
---|
25 | export declare function coerceStringArray(value: any, separator?: string | RegExp): string[];
|
---|
Note:
See
TracBrowser
for help on using the repository browser.