@h3ravel/support 0.3.0 → 0.4.0

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.
@@ -1,4 +1,4 @@
1
- import { DotFlatten, DotNestedKeys, DotNestedValue, KeysToSnakeCase } from "../Contracts/ObjContract"
1
+ import { DotFlatten, DotNestedKeys, DotNestedValue, KeysToSnakeCase } from '../Contracts/ObjContract'
2
2
 
3
3
  /**
4
4
  * Flattens a nested object into a single-level object
@@ -116,7 +116,7 @@ export const getValue = <
116
116
  */
117
117
  export const modObj = <T extends object, R> (
118
118
  obj: T,
119
- callback: (entry: [keyof T & string, T[keyof T]]) => [string, R]
119
+ callback: (_entry: [keyof T & string, T[keyof T]]) => [string, R]
120
120
  ): Record<string, R> => {
121
121
  return Object.fromEntries(
122
122
  Object.entries(obj).map(([key, value]) =>
@@ -126,11 +126,11 @@ export const modObj = <T extends object, R> (
126
126
  }
127
127
 
128
128
 
129
- export function safeDot<T extends Record<string, any>> (data: T): T
129
+ export function safeDot<T extends Record<string, any>> (_data: T): T
130
130
  export function safeDot<
131
131
  T extends Record<string, any>,
132
132
  K extends DotNestedKeys<T>
133
- > (data: T, key?: K): DotNestedValue<T, K>
133
+ > (_data: T, _key?: K): DotNestedValue<T, K>
134
134
  export function safeDot<
135
135
  T extends Record<string, any>,
136
136
  K extends DotNestedKeys<T>
@@ -1,4 +1,4 @@
1
- import { dot } from "./Obj"
1
+ import { dot } from './Obj'
2
2
 
3
3
  /**
4
4
  * Get the portion of the string after the first occurrence of the given value.
@@ -0,0 +1,7 @@
1
+ import { pluralize } from '../src/Helpers/Str'
2
+
3
+ describe('Support Package\'s Str', () => {
4
+ test('plural of user is users', () => {
5
+ expect(pluralize('user', 2)).toBe('users')
6
+ })
7
+ })