moderndash 0.0.16 → 0.0.18

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.
Files changed (66) hide show
  1. package/README.md +16 -75
  2. package/dist/index.cjs +66 -73
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.ts +125 -113
  5. package/dist/index.js +62 -69
  6. package/dist/index.js.map +1 -1
  7. package/package.json +6 -5
  8. package/src/array/chunk.ts +0 -31
  9. package/src/array/difference.ts +0 -21
  10. package/src/array/differenceBy.ts +0 -30
  11. package/src/array/differenceWith.ts +0 -31
  12. package/src/array/dropRightWhile.ts +0 -28
  13. package/src/array/dropWhile.ts +0 -24
  14. package/src/array/index.ts +0 -21
  15. package/src/array/intersection.ts +0 -20
  16. package/src/array/intersectionBy.ts +0 -26
  17. package/src/array/intersectionWith.ts +0 -33
  18. package/src/array/sample.ts +0 -18
  19. package/src/array/sampleSize.ts +0 -31
  20. package/src/array/shuffle.ts +0 -33
  21. package/src/array/takeRightWhile.ts +0 -33
  22. package/src/array/takeWhile.ts +0 -33
  23. package/src/array/uniq.ts +0 -18
  24. package/src/array/uniqBy.ts +0 -25
  25. package/src/array/uniqWith.ts +0 -20
  26. package/src/array/unzip.ts +0 -20
  27. package/src/array/unzipWith.ts +0 -26
  28. package/src/array/zip.ts +0 -17
  29. package/src/array/zipWith.ts +0 -28
  30. package/src/collection/countBy.ts +0 -38
  31. package/src/collection/groupBy.ts +0 -32
  32. package/src/collection/index.ts +0 -3
  33. package/src/collection/sortBy.ts +0 -15
  34. package/src/function/after.ts +0 -29
  35. package/src/function/before.ts +0 -31
  36. package/src/function/debounce.ts +0 -125
  37. package/src/function/index.ts +0 -7
  38. package/src/function/memoize.ts +0 -63
  39. package/src/function/once.ts +0 -22
  40. package/src/function/throttle.ts +0 -13
  41. package/src/function/times.ts +0 -24
  42. package/src/helpers/collections.ts +0 -5
  43. package/src/helpers/shortHands.ts +0 -17
  44. package/src/helpers/stringModifiers.ts +0 -18
  45. package/src/helpers/typeofChecks.ts +0 -3
  46. package/src/index.ts +0 -7
  47. package/src/lang/index.ts +0 -4
  48. package/src/lang/isEmpty.ts +0 -51
  49. package/src/lang/isEqual.ts +0 -80
  50. package/src/lang/isEqualWith.ts +0 -34
  51. package/src/lang/isPlainObject.ts +0 -3
  52. package/src/object/index.ts +0 -1
  53. package/src/object/pick.ts +0 -21
  54. package/src/string/camelCase.ts +0 -30
  55. package/src/string/capitalize.ts +0 -14
  56. package/src/string/deburr.ts +0 -20
  57. package/src/string/escape.ts +0 -21
  58. package/src/string/escapeRegExp.ts +0 -15
  59. package/src/string/index.ts +0 -11
  60. package/src/string/kebabCase.ts +0 -25
  61. package/src/string/pascalCase.ts +0 -26
  62. package/src/string/snakeCase.ts +0 -30
  63. package/src/string/startCase.ts +0 -25
  64. package/src/string/stripSpecialChars.ts +0 -17
  65. package/src/string/unescape.ts +0 -22
  66. package/src/types.ts +0 -15
@@ -1,25 +0,0 @@
1
- import { splitWords } from '@helpers/stringModifiers';
2
-
3
- /**
4
- * Converts a string to kebab-case.
5
- *
6
- * @example
7
- * kebabCase('Foo Bar')
8
- * // => 'foo-bar'
9
- * kebabCase('fooBar')
10
- * // => 'foo-bar'
11
- * kebabCase('__FOO_BAR__')
12
- * // => 'foo-bar'
13
- * @category String
14
- * @param str - The string to convert.
15
- * @returns Returns the kebab cased string.
16
- */
17
-
18
- export function kebabCase(str: string): string {
19
- const words = splitWords(str);
20
- let kebabCase = '';
21
- for (const word of words) {
22
- kebabCase += word.toLowerCase() + '-';
23
- }
24
- return kebabCase.slice(0, -1);
25
- }
@@ -1,26 +0,0 @@
1
- import { splitWords } from '@helpers/stringModifiers';
2
-
3
-
4
- /**
5
- * Converts a string to PascalCase.
6
- *
7
- * @example
8
- * kebabCase('Foo Bar')
9
- * // => 'FooBar'
10
- * kebabCase('fooBar')
11
- * // => 'FooBar'
12
- * kebabCase('__FOO_BAR__')
13
- * // => 'FooBar'
14
- * @category String
15
- * @param str - The string to convert.
16
- * @returns Returns the pascal cased string.
17
- */
18
-
19
- export function pascalCase(str: string): string {
20
- const words = splitWords(str);
21
- let pascalCase = '';
22
- for (const word of words) {
23
- pascalCase += word.charAt(0).toUpperCase() + word.slice(1);
24
- }
25
- return pascalCase;
26
- }
@@ -1,30 +0,0 @@
1
- import { splitWords } from '@helpers/stringModifiers';
2
-
3
- /**
4
- * Converts a string to snake_case.
5
- *
6
- * @example
7
- * snakeCase('Foo Bar')
8
- * // => 'foo_bar'
9
- * snakeCase('fooBar')
10
- * // => 'foo_bar'
11
- * snakeCase('--FOO-BAR--')
12
- * // => 'foo_bar'
13
- * snakeCase('foo2bar')
14
- * // => 'foo_2_bar'
15
- * @category String
16
- * @param str - The string to convert.
17
- * @returns Returns the snake cased string.
18
- */
19
-
20
- export function snakeCase(str: string): string {
21
- const words = splitWords(str);
22
- let snakeCase = '';
23
- for (const word of words) {
24
- if (snakeCase.length > 0) {
25
- snakeCase += '_';
26
- }
27
- snakeCase += word.toLowerCase();
28
- }
29
- return snakeCase;
30
- }
@@ -1,25 +0,0 @@
1
- import { splitWords } from '@helpers/stringModifiers';
2
-
3
- /**
4
- * Converts a string to Start Case.
5
- *
6
- * @example
7
- * startCase('--foo-bar--')
8
- * // => 'Foo Bar'
9
- * startCase('fooBar')
10
- * // => 'Foo Bar'
11
- * startCase('__FOO_BAR__')
12
- * // => 'Foo Bar'
13
- * @category String
14
- * @param str - The string to convert.
15
- * @returns Returns the start cased string.
16
- */
17
-
18
- export function startCase(str: string): string {
19
- const words = splitWords(str);
20
- let startCase = '';
21
- for (const word of words) {
22
- startCase += word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() + ' ';
23
- }
24
- return startCase.trimEnd();
25
- }
@@ -1,17 +0,0 @@
1
- import { deburr } from '@string/deburr';
2
-
3
- /**
4
- * Removes all special characters from a string.
5
- *
6
- * @example
7
- * stripSpecialChars('Héllo! World #$%&*!')
8
- * // => 'Hello World'
9
- * @category String
10
- * @param str - The string to remove special characters from.
11
- * @returns Returns the string with special characters removed.
12
- */
13
-
14
- export function stripSpecialChars(str: string): string {
15
- str = deburr(str);
16
- return str.replace(/[^\s\w]/gi, '');
17
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * Converts the HTML entities `&`, `<`, `>`, `"` and `'`
3
- * in a string to their corresponding characters.
4
- *
5
- * @example
6
- * unescape('fred, barney, & pebbles')
7
- * // => 'fred, barney, & pebbles'
8
- * @category String
9
- * @param str - The string to unescape.
10
- * @returns Returns the unescaped string.
11
- */
12
-
13
- export function unescape(str: string): string {
14
- const entityMap: Record<string, string> = {
15
- '&amp;': '&',
16
- '&lt;': '<',
17
- '&gt;': '>',
18
- '&quot;': '"',
19
- '&#39;': '\''
20
- };
21
- return str.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g, (entity: string) => entityMap[entity] || entity);
22
- }
package/src/types.ts DELETED
@@ -1,15 +0,0 @@
1
- export type MinimumTwoArrays<TInput> = [TInput[], TInput[], ...TInput[][]];
2
-
3
- export type IterateeFunction<T> = (value: T) => unknown;
4
- export type PropertyShorthand<T> = keyof T;
5
-
6
- export type RecordKey = string | number | symbol;
7
- export type ArrayOrRecord<TInput> = TInput[] | Record<RecordKey, TInput>;
8
-
9
- export type NoUnion<T, U = T> = T extends U ? [U] extends [T] ? T : never : never;
10
-
11
- /**
12
- * @description Generic function type, should fit any function
13
- * @typeParam TFunc - The input function type
14
- */
15
- export type GenericFunction<TFunc extends (...args: Parameters<TFunc>) => ReturnType<TFunc>> = (...args: Parameters<TFunc>) => ReturnType<TFunc>;