Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@castlenine/utility-belt

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@castlenine/utility-belt - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

dist/modules.d.ts

67

dist/index.d.ts

@@ -1,67 +0,1 @@

import * as atomicUnit from './utils/atomic-unit';
import * as cookie from './utils/cookie';
import * as cryptocurrency from './utils/cryptocurrency';
import * as currency from './utils/currency';
import delay from './utils/delay';
import * as email from './utils/email';
import * as number from './utils/number';
import * as object from './utils/object';
import * as string from './utils/string';
import * as time from './utils/time';
declare const utilityBelt: {
getStringDifferenceFromNow: (date: import("dayjs").ConfigType, lang?: Locales, withoutSuffix?: boolean) => string;
getStringDifferenceToNow: (date: import("dayjs").ConfigType, lang?: Locales, withoutSuffix?: boolean) => string;
getStringDifferenceFromDateTime: (from: import("dayjs").ConfigType, baseDate?: import("dayjs").ConfigType, lang?: Locales, withoutSuffix?: boolean) => string;
getStringDifferenceToDateTime: (to: import("dayjs").ConfigType, baseDate?: import("dayjs").ConfigType, lang?: Locales, withoutSuffix?: boolean) => string;
isDateBetween: (date: import("dayjs").ConfigType, startDate: import("dayjs").ConfigType, endDate: import("dayjs").ConfigType, granularity?: import("dayjs").UnitTypeLong, inclusiveCheck?: "()" | "[]" | "[)" | "(]") => boolean;
isDateSame: (date: import("dayjs").ConfigType, dateToCompare: import("dayjs").ConfigType, granularity?: import("dayjs").UnitTypeLong) => boolean;
isDateSameOrBefore: (date: import("dayjs").ConfigType, dateToCompare: import("dayjs").ConfigType, granularity?: import("dayjs").UnitTypeLong) => boolean;
isDateSameOrAfter: (date: import("dayjs").ConfigType, dateToCompare: import("dayjs").ConfigType, granularity?: import("dayjs").UnitTypeLong) => boolean;
isDateYesterday: (date: import("dayjs").ConfigType) => boolean;
isDateToday: (date: import("dayjs").ConfigType) => boolean;
isDateTomorrow: (date: import("dayjs").ConfigType) => boolean;
isDateLeapYear: (date: import("dayjs").ConfigType) => boolean;
howManyLeapDayInLastYears: (years: number, fromToday?: boolean) => number;
daysInCurrentYear: () => number;
daysSinceStartOfCurrentYear: () => number;
guessUserTimezone: () => string;
changeTimezone: (date: import("dayjs").ConfigType, timezone: string, haveSameTime?: boolean) => string;
currentUtcTime: () => string;
isDateUtc: (date: import("dayjs").Dayjs) => boolean;
convertDateToUTC: (date: import("dayjs").ConfigType) => string;
convertDateToLocalTime: (date: import("dayjs").ConfigType) => string;
capitalizeFirstLetterOnly: (string: string, isRestBecomeLowercase?: boolean) => string;
replaceLastCommaByDot: (string: string, removeTheExtraCommas?: boolean) => string;
isStringContainsNumber: (string: string) => boolean;
removeNonNumericCharactersFromString: (string: string, haveReplaceLastCommaByDot?: boolean) => string;
removeNumbersFromString: (string: string) => string;
numberToString: (number: number | import("bignumber.js").BigNumber | undefined) => string;
normalizeString: (string: string, spaceReplacementType?: "remove" | "underscore" | "dash" | "", haveRemoveDiacritic?: boolean, haveRemoveEmoji?: boolean, haveRemoveNonLatin?: boolean, haveRemoveNumber?: boolean, haveRemovePunctuation?: boolean, haveRemoveSpecialCharacters?: boolean) => string;
slugifyString: (string: string, isBecomeLowercase?: boolean) => string;
isObjectEmpty: (object: object | null | undefined) => boolean;
countValueInArrayOfObjects: (arrayOfObjectsToCount: Array<Record<string, unknown>>, keyName: string, valueToCount: unknown) => number;
isNumber: (value: string | number | import("bignumber.js").BigNumber | null | undefined) => boolean;
stringToBigNumber: (stringNumber: string | undefined) => import("bignumber.js").BigNumber;
absoluteToBigNumber: (number: number | string | import("bignumber.js").BigNumber | undefined) => import("bignumber.js").BigNumber;
truncateNumberToBigNumber: (number: number | string | import("bignumber.js").BigNumber | undefined, decimal?: number) => import("bignumber.js").BigNumber;
roundNumberToBigNumber: (number: number | string | import("bignumber.js").BigNumber | undefined, decimal?: number) => import("bignumber.js").BigNumber;
roundUpNumberToBigNumber: (number: number | string | import("bignumber.js").BigNumber | undefined, decimal?: number) => import("bignumber.js").BigNumber;
roundDownNumberToBigNumber: (number: number | string | import("bignumber.js").BigNumber | undefined, decimal?: number) => import("bignumber.js").BigNumber;
formatNumber: (number: number | string | import("bignumber.js").BigNumber | undefined, isRounded?: boolean, maximumDecimal?: number, minimumDecimal?: number) => string;
countDecimalPlaces: (number: number | string | import("bignumber.js").BigNumber | undefined) => number;
labelNumber: (number: number | string | import("bignumber.js").BigNumber | undefined, lang?: Locales, shortLabel?: boolean, isRounded?: boolean, maximumDecimal?: number, minimumDecimal?: number) => string;
isEmailValid: (email: string | undefined) => boolean;
delay: (milliseconds: number) => Promise<void>;
getCurrencyFullName: (currency: Currency, lang?: Locales, plural?: boolean) => string;
getCurrencySymbol: (currency: Currency) => string;
formatAndAddCurrencySymbol: (amount: string | number | import("bignumber.js").BigNumber | undefined, currency?: Currency, isRounded?: boolean, maximumDecimal?: number, minimumDecimal?: number, useIsoCurrencyCode?: boolean, haveShortSymbol?: boolean) => string;
labelCurrency: (amount: string | number | import("bignumber.js").BigNumber | undefined, lang?: Locales, currency?: Currency, shortLabel?: boolean, haveCurrencyText?: boolean, haveShortCurrencySymbol?: boolean, isRounded?: boolean, maximumDecimal?: number, minimumDecimal?: number) => string;
cryptoMinusShiftedToBigNumberType: (amount: number | import("bignumber.js").BigNumber | string | undefined, shiftFactor?: number) => import("bignumber.js").BigNumber;
cryptoShiftedToBigNumberType: (amount: number | import("bignumber.js").BigNumber | string | undefined, shiftFactor?: number) => import("bignumber.js").BigNumber;
parseValueFromCookie: (cookieValue: string, searchKey: string) => string;
convertNumberToAtomicUnit: (number: number | import("bignumber.js").BigNumber | string | undefined) => AtomicUnit;
convertAtomicUnitToBigNumber: ({ value, precision, isValid, originalValue }: AtomicUnit, haveCompareOriginalValue?: boolean) => import("bignumber.js").BigNumber;
};
export default utilityBelt;
export { atomicUnit, cookie, cryptocurrency, currency, delay, email, number, object, string, time };
export { convertNumberToAtomicUnit, convertAtomicUnitToBigNumber } from './utils/atomic-unit';

@@ -71,2 +5,3 @@ export { parseValueFromCookie } from './utils/cookie';

export { getCurrencyFullName, getCurrencySymbol, formatAndAddCurrencySymbol, labelCurrency } from './utils/currency';
export { default as delay } from './utils/delay';
export { isEmailValid } from './utils/email';

@@ -73,0 +8,0 @@ export { isNumber, stringToBigNumber, absoluteToBigNumber, truncateNumberToBigNumber, roundNumberToBigNumber, roundUpNumberToBigNumber, roundDownNumberToBigNumber, formatNumber, countDecimalPlaces, labelNumber, } from './utils/number';

{
"name": "@castlenine/utility-belt",
"version": "0.0.4",
"version": "0.0.5",
"description": "Utility Belt is a versatile and lightweight collection of essential JavaScript utilities designed to streamline and simplify my development workflow",

@@ -36,3 +36,3 @@ "license": "MIT",

"main": "./dist/index.js",
"import": "dist/index.js",
"module": "./dist/index.js",
"exports": {

@@ -43,2 +43,7 @@ ".": {

"default": "./dist/index.js"
},
"./modules": {
"types": "./dist/modules.d.ts",
"import": "./dist/modules.js",
"default": "./dist/modules.js"
}

@@ -45,0 +50,0 @@ },

@@ -42,34 +42,4 @@ <div align="center">

You can import the utility belt as a whole or import individual utilities
TODO: Add documentation for each utility (scheduled for version 1.0.0)
### Import the whole utility belt
```typescript
import utilityBelt from '@castlenine/utility-belt';
```
### Import individual utilities
```typescript
import { atomicUnit } from '@castlenine/utility-belt';
import { cookie } from '@castlenine/utility-belt';
import { cryptocurrency } from '@castlenine/utility-belt';
import { currency } from '@castlenine/utility-belt';
import { delay } from '@castlenine/utility-belt';
import { email } from '@castlenine/utility-belt';
import { number } from '@castlenine/utility-belt';
import { object } from '@castlenine/utility-belt';
import { string } from '@castlenine/utility-belt';
import { time } from '@castlenine/utility-belt';
```
## Documentation

@@ -76,0 +46,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc