mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-15 06:56:36 +00:00
Switch _.isUndefined usage to native versions
Change-type: patch
This commit is contained in:
parent
8e23091aa9
commit
3bfdc4454e
@ -141,10 +141,7 @@ export class SplashImage extends ConfigBackend {
|
||||
|
||||
public ensureRequiredConfig(_deviceType: string, conf: ConfigOptions) {
|
||||
// If the value from the cloud is empty, it is the same as no definition
|
||||
if (
|
||||
!_.isUndefined(conf.image) &&
|
||||
_.isEmpty((conf.image as string).trim())
|
||||
) {
|
||||
if (conf.image != null && _.isEmpty((conf.image as string).trim())) {
|
||||
delete conf.image;
|
||||
}
|
||||
return conf;
|
||||
|
@ -100,7 +100,7 @@ export function isValidDeviceName(v: unknown): v is DeviceName {
|
||||
* Ensure a string is either undefined, or a non-empty string
|
||||
*/
|
||||
export function validStringOrUndefined(s: string | undefined): boolean {
|
||||
return _.isUndefined(s) || (typeof s === 'string' && !_.isEmpty(s));
|
||||
return s == null || (typeof s === 'string' && !_.isEmpty(s));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,5 +109,5 @@ export function validStringOrUndefined(s: string | undefined): boolean {
|
||||
* Ensure an object is either undefined or an actual object
|
||||
*/
|
||||
export function validObjectOrUndefined(o: object | undefined): boolean {
|
||||
return _.isUndefined(o) || _.isObject(o);
|
||||
return o == null || _.isObject(o);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user