@dvrd/dvr-controls 1.1.4 → 1.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvrd/dvr-controls",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Custom web controls",
5
5
  "main": "index.ts",
6
6
  "files": [
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) 2024. Dave van Rijn Development
3
3
  */
4
4
 
5
- import {IndexedObject} from "./interfaces";
6
- import React from "react";
7
- import DOMPurify from "dompurify";
5
+ import DOMPurify from 'dompurify';
6
+ import React from 'react';
7
+ import {IndexedObject} from './interfaces';
8
8
 
9
9
  declare global {
10
10
  // noinspection JSUnusedGlobalSymbols
@@ -22,7 +22,7 @@ export const getSetting = (name: string): any => {
22
22
  if (settings.hasOwnProperty(name))
23
23
  return settings[name];
24
24
  console.warn(`Global settings does not contain a value for '${name}'`);
25
- }
25
+ };
26
26
 
27
27
  export const getMode = (): 'prod' | 'test' | 'dev' | 'accept' => {
28
28
  return window.settings.mode;
@@ -74,7 +74,7 @@ export const roundTo = (number: number, digits: number = 0): string => {
74
74
 
75
75
  export const roundToNumber = (number: number, decimals: number = 0): number => {
76
76
  return Number(roundTo(number, decimals).replace(',', '.'));
77
- }
77
+ };
78
78
 
79
79
  export const parseMoney = (money: number): string => {
80
80
  let moneyString: string;
@@ -110,7 +110,7 @@ export const downloadRequiredFile = (path: string | { default: string }, fileNam
110
110
  link.type = 'download';
111
111
  link.download = name;
112
112
  link.click();
113
- }
113
+ };
114
114
 
115
115
  const getFileName = (path: string, fileName?: string): string => {
116
116
  if (fileName?.length) return fileName;
@@ -119,7 +119,7 @@ const getFileName = (path: string, fileName?: string): string => {
119
119
  if (pathName.match(cacheReg))
120
120
  pathName = pathName.replace(cacheReg, '');
121
121
  return pathName;
122
- }
122
+ };
123
123
 
124
124
  export const preventDefault = (evt: Event | React.SyntheticEvent) => {
125
125
  evt.preventDefault();
@@ -138,8 +138,8 @@ export const shuffleArray = (arr: any[]): any[] => {
138
138
 
139
139
  export function nullify<T extends string | Array<any> | Set<any> | number | bigint>(value?: T | null): T | null {
140
140
  if (typeof value === 'number' || typeof value === 'bigint') {
141
- if (value > 0) return value;
142
- return null;
141
+ if (value === 0) return null;
142
+ return value;
143
143
  }
144
144
  if (!value) return null;
145
145
  else if (Array.isArray(value) || typeof value === 'string')
@@ -163,7 +163,7 @@ export const copyToClipboard = (text: string): Promise<void> => {
163
163
 
164
164
  export const copyClipboard = (text: string): Promise<void> => {
165
165
  return window.navigator.clipboard.writeText(text);
166
- }
166
+ };
167
167
 
168
168
  export function webpSupported(): boolean {
169
169
  try {