
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
dd360-utils
Advanced tools
This is DD360 library of utils functions based on Typescript.
npm i dd360-utils
import { formatCurrency, formatDecimal, unFormatCurrency, getLeftAndTopScreen, getQueryParams } from 'dd360-utils'
const { formatCurrency, formatDecimal, unFormatCurrency, getLeftAndTopScreen, getQueryParams } = require('dd360-utils')
Use format currency:
import { formatCurrency, unFormatCurrency, formatDecimal } from 'dd360-utils'
formatCurrency(4000) // return 4,000
unFormatCurrency('4,000') // return 4000
formatDecimal(4000) // return 4,000.00
Use input format currency:
The format
and formatCents
methods expose a couple internal helper functions.
import { inputCurrency } from 'dd360-utils'
inputCurrency.format('2500') // $2,500.00
inputCurrency.format(200) // $200.00
inputCurrency.format(200, { removeSymbol: true, removeCents: true }) // 200
inputCurrency.formatCents('$2,500.55') // 250055
formatCurrencyInput.formatCents(2) // 200
Use getQueryParams
// get queryparams from url
const type = getQueryParams('type')
Use ObjectIsEmpty
import { objectIsEmpty } from 'dd360-utils'
objectIsEmpty({}) // true
objectIsEmpty({ name: 'John' }) // false
Use removeAccents
import { removeAccents } from 'dd360-utils'
removeAccents('ananá') // anana
import { sum, subtract, multiply } from 'dd360-utils'
sum(4, 4) // 8
subtract(4, 2) // 2
multiply(2, 2) // 4
LocalStorage Helpers
import { setLocalStorage, getLocalStorage, removeLocalStorage, removeKeysFromLocalStorage, clearLocalStorage } from 'dd360-utils'
setLocalStorage('theme', 'dark')
getLocalStorage('theme') // dark
removeLocalStorage('theme') // delete theme from localStorage
removeKeysFromLocalStorage(['theme', 'access_token', 'etc']) // remove this keys from localStorage
clearLocalStorage() // clear all keys from localStorage
SessionStorage Helpers
import { setSessionStorage, getSessionStorage, removeSessionStorage, removeKeysFromSessionStorage, clearSessionStorage } from 'dd360-utils'
setSessionStorage('theme', 'dark')
getSessionStorage('theme') // dark
removeSessionStorage('theme') // delete theme from sessionStorage
removeKeysFromSessionStorage(['theme', 'access_token', 'etc']) // remove this keys from sessionStorage
clearSessionStorage() // clear all keys from sessionStorage
Use password validations
import { passwordValidations } from 'dd360-utils'
passwordValidations.isValidPasswordlowerUpper('Asd') // true
passwordValidations.isValidPasswordNumbers(4) // true
passwordValidations.isValidPasswordCharacters('$') // true
Other validations
import { isValidEmail, isValidNumberPhone, isValidCURP, isValidRFC, userAgentIsMobile } from 'dd360-utils'
isValidEmail('correo@correo.com') // true
isValidEmail('correo') // false
isValidNumberPhone(1132678476) // true
isValidNumberPhone(223) // false
isValidCURP(YOUR_CURP) // true or false
isValidRFC(YOUR_RFC) // true or false
userAgentIsMobile() // if its mobile, return true
Use Name of months
import { getNameMonth } from 'dd360-utils'
getNameMonth(1, 'es') // Enero
getNameMonth(1, 'en') // January
Use screen events
// get left and top of screen
const { left, top } = getLeftAndTopScreen(event)
FAQs
This library is a utils functions
The npm package dd360-utils receives a total of 288 weekly downloads. As such, dd360-utils popularity was classified as not popular.
We found that dd360-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.