New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

moderndash

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moderndash - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

47

dist/index.d.ts

@@ -1239,2 +1239,47 @@ /**

/**
* Trim the string from the left and right by the given characters
*
* *Use the native [trim](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) method if you want to trim whitespace.*
* @example
* ```ts
* trim('$$abc$', '$') // => 'abc'
* trim('!!abc_!', '_!') // => 'abc'
* ```
* @param str The string to trim
* @param chars The characters to trim
* @returns The trimmed string
*/
declare function trim(str: string, chars: string): string;
/**
* Trims the specified characters from the end of the string.
*
* *Use the native [trimEnd](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) method if you want to trim whitespace.*
* @example
* ```ts
* trimEnd('abc$$$', '$') // => 'abc'
* trimEnd('abc_!!_', '_!') // => 'abc'
* ```
* @param str The string to trim
* @param chars The characters to trim
* @returns The trimmed string
*/
declare function trimEnd(str: string, chars: string): string;
/**
* Trims specified characters from the start of the string.
*
* *Use the native [trimStart](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) method if you want to trim whitespace.*
* @example
* ```ts
* trimStart('$$$abc', '$') // => 'abc'
* trimStart('_!!_abc', '_!') // => 'abc'
* ```
* @param str The string to trim
* @param chars The characters to trim
* @returns The trimmed string
*/
declare function trimStart(str: string, chars: string): string;
/**
* Converts the HTML entities `&`, `<`, `>`, `"` and `'`

@@ -1325,2 +1370,2 @@ * in a string to their corresponding characters.

export { ArrayMinLength, GenericFunction, Jsonifiable, PlainObject, Queue, average, camelCase, capitalize, chunk, count, debounce, deburr, decDebounce, decMaxCalls, decMemoize, decMinCalls, decThrottle, difference, dropRightWhile, dropWhile, escapeHtml, escapeRegExp, flatKeys, group, hash, intersection, isEmpty, isEqual, isPlainObject, isUrl, kebabCase, maxCalls, median, memoize, merge, minCalls, omit, pascalCase, pick, races, randomElem, randomFloat, randomInt, randomString, range, retry, round, set, shuffle, sleep, snakeCase, sort, splitWords, sum, takeRightWhile, takeWhile, throttle, timeout, times, titleCase, toDecorator, tryCatch, unescapeHtml, unique };
export { ArrayMinLength, GenericFunction, Jsonifiable, PlainObject, Queue, average, camelCase, capitalize, chunk, count, debounce, deburr, decDebounce, decMaxCalls, decMemoize, decMinCalls, decThrottle, difference, dropRightWhile, dropWhile, escapeHtml, escapeRegExp, flatKeys, group, hash, intersection, isEmpty, isEqual, isPlainObject, isUrl, kebabCase, maxCalls, median, memoize, merge, minCalls, omit, pascalCase, pick, races, randomElem, randomFloat, randomInt, randomString, range, retry, round, set, shuffle, sleep, snakeCase, sort, splitWords, sum, takeRightWhile, takeWhile, throttle, timeout, times, titleCase, toDecorator, trim, trimEnd, trimStart, tryCatch, unescapeHtml, unique };

@@ -745,2 +745,33 @@ // src/array/chunk.ts

// src/string/trim.ts
function trim(str, chars) {
let startIndex = 0;
while (startIndex < str.length && chars.includes(str[startIndex])) {
startIndex++;
}
let endIndex = str.length - 1;
while (endIndex >= startIndex && chars.includes(str[endIndex])) {
endIndex--;
}
return str.slice(startIndex, endIndex + 1);
}
// src/string/trimEnd.ts
function trimEnd(str, chars) {
let lastIndex = str.length - 1;
while (lastIndex >= 0 && chars.includes(str[lastIndex])) {
lastIndex--;
}
return str.slice(0, lastIndex + 1);
}
// src/string/trimStart.ts
function trimStart(str, chars) {
let startIndex = 0;
while (startIndex < str.length && chars.includes(str[startIndex])) {
startIndex++;
}
return str.slice(startIndex);
}
// src/string/unescapeHtml.ts

@@ -884,2 +915,5 @@ var htmlEntitiesRegex = /&(?:amp|lt|gt|quot|#39);/g;

toDecorator,
trim,
trimEnd,
trimStart,
tryCatch,

@@ -886,0 +920,0 @@ unescapeHtml,

2

package.json
{
"name": "moderndash",
"version": "3.1.0",
"version": "3.2.0",
"type": "module",

@@ -5,0 +5,0 @@ "description": "A Typescript-First utility library inspired by Lodash. Optimized for modern browsers.",

@@ -88,2 +88,2 @@ ![ModernDash Logo](https://raw.githubusercontent.com/Maggi64/moderndash/main/website/src/assets/moderndashLogo.svg)

Check the [contribute](https://github.com/Maggi64/moderndash/blob/main/CONTRIBUTE.md) section!
Check the [contributing](https://github.com/Maggi64/moderndash/blob/main/CONTRIBUTING.md) section!

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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