Skip to content

Commit 917c432

Browse files
committed
docs: documentation for separate imports
1 parent 1fd4b5c commit 917c432

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

readme.md

+31-31
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The `partitionObjectsByKey` function splits an array of objects into two separat
8989

9090
### Example Usage
9191
```typescript
92-
import { partitionObjectsByKey } from '@xmanscript/utils';
92+
import partitionObjectsByKey from '@xmanscript/utils/partitionObjectsByKey';
9393

9494
const array = [
9595
{ id: 1, name: 'Alice' },
@@ -125,7 +125,7 @@ The `convertNestedKeysToObject` function converts an input object with nested ke
125125

126126
### Example Usage
127127
```typescript
128-
import { convertNestedKeysToObject } from '@xmanscript/utils';
128+
import convertNestedKeysToObject from '@xmanscript/utils/convertNestedKeysToObject';
129129

130130
const input = {
131131
'user[0].name': 'Alice',
@@ -161,7 +161,7 @@ The `markCheckedByStringMatch` function adds a "checked" field to each object in
161161

162162
### Example Usage
163163
```typescript
164-
import { markCheckedByStringMatch } from '@xmanscript/utils';
164+
import markCheckedByStringMatch from '@xmanscript/utils/markCheckedByStringMatch';
165165

166166
interface Item {
167167
id: number;
@@ -199,7 +199,7 @@ The `intersectObjects` function takes two objects as input and returns a new obj
199199

200200
### Example Usage
201201
```typescript
202-
import { intersectObjects } from '@xmanscript/utils';
202+
import intersectObjects from '@xmanscript/utils/intersectObjects';
203203

204204
const object1 = {
205205
name: 'John',
@@ -230,7 +230,7 @@ The `containsBinaryData` function recursively checks if an object or any of its
230230

231231
### Example Usage
232232
```typescript
233-
import { containsBinaryData } from '@xmanscript/utils';
233+
import containsBinaryData from '@xmanscript/utils/containsBinaryData';
234234

235235
const objectWithBinaryData = {
236236
image: new Blob(['binary data'], { type: 'image/png' }),
@@ -263,7 +263,7 @@ The `isJSONObject` function checks if a given string is a valid JSON object.
263263

264264
### Example Usage
265265
```typescript
266-
import { isJSONObject } from '@xmanscript/utils';
266+
import isJSONObject from '@xmanscript/utils/isJSONObject';
267267
268268
const jsonString1 = '{"name": "John", "age": 30}';
269269
const jsonString2 = 'This is not a JSON object';
@@ -284,7 +284,7 @@ The `objectToFormDataWithFiles` function converts a JSON object into a FormData
284284

285285
### Example Usage
286286
```typescript
287-
import { objectToFormDataWithFiles } from '@xmanscript/utils';
287+
import objectToFormDataWithFiles from '@xmanscript/utils/objectToFormDataWithFiles';
288288
289289
const formData = objectToFormDataWithFiles({
290290
name: 'John',
@@ -312,7 +312,7 @@ The `areObjectsEqual` function checks if two objects are equal by comparing thei
312312

313313
### Example Usage
314314
```typescript
315-
import { areObjectsEqual } from '@xmanscript/utils';
315+
import areObjectsEqual from '@xmanscript/utils/areObjectsEqual';
316316
317317
const obj1 = { name: 'John', age: 30 };
318318
const obj2 = { age: 30, name: 'John' };
@@ -333,7 +333,7 @@ The `abbreviateCurrencyValue` function converts a number into a currency system
333333

334334
### Example Usage
335335
```typescript
336-
import { abbreviateCurrencyValue } from '@xmanscript/utils';
336+
import abbreviateCurrencyValue from '@xmanscript/utils/abbreviateCurrencyValue';
337337
338338
const value1 = 1500000000; // 1.5 billion
339339
const value2 = 7500000; // 7.5 million
@@ -359,7 +359,7 @@ The `omitKey` function removes a specified key from an object and returns a new
359359

360360
### Example Usage
361361
```typescript
362-
import { omitKey } from '@xmanscript/utils';
362+
import omitKey from '@xmanscript/utils/omitKey';
363363
364364
const user = {
365365
id: 1,
@@ -386,7 +386,7 @@ The `setKeysToValueInObjects` function takes an array of objects and an array of
386386

387387
### Example Usage
388388
```typescript
389-
import { setKeysToValueInObjects } from '@xmanscript/utils';
389+
import setKeysToValueInObjects from '@xmanscript/utils/setKeysToValueInObjects';
390390
391391
const data = [
392392
{ id: 1, value1: 10, value2: 20 },
@@ -414,7 +414,7 @@ The `toggleStringInArray` function removes the target string from the array if i
414414

415415
### Example Usage
416416
```typescript
417-
import { toggleStringInArray } from '@xmanscript/utils';
417+
import toggleStringInArray from '@xmanscript/utils/toggleStringInArray';
418418
419419
const myArray = ['apple', 'banana', 'cherry'];
420420
@@ -440,7 +440,7 @@ The `toggleObjectInArray` function removes the target object from the array if i
440440

441441
### Example Usage
442442
```typescript
443-
import { toggleObjectInArray } from '@xmanscript/utils';
443+
import toggleObjectInArray from '@xmanscript/utils/toggleObjectInArray';
444444
445445
const data = [
446446
{ id: 1, name: 'Alice' },
@@ -468,7 +468,7 @@ The `calculateAndInjectPercentageByMaxValue` function calculates the percentage
468468

469469
### Example Usage
470470
```typescript
471-
import { calculateAndInjectPercentageByMaxValue } from '@xmanscript/utils';
471+
import calculateAndInjectPercentageByMaxValue from '@xmanscript/utils/calculateAndInjectPercentageByMaxValue';
472472
473473
const data = [
474474
{ name: 'A', value: 50 },
@@ -499,7 +499,7 @@ The `calculateAndInjectPercentageBySum` function calculates the percentage of a
499499

500500
### Example Usage
501501
```typescript
502-
import { calculateAndInjectPercentageBySum } from '@xmanscript/utils';
502+
import calculateAndInjectPercentageBySum from '@xmanscript/utils/calculateAndInjectPercentageBySum';
503503
504504
const data = [
505505
{ name: 'A', value: 25 },
@@ -532,7 +532,7 @@ The `calculateSumOfKey` function calculates the sum of a specified key in an arr
532532

533533
### Example Usage
534534
```typescript
535-
import { calculateSumOfKey } from '@xmanscript/utils';
535+
import calculateSumOfKey from '@xmanscript/utils/calculateSumOfKey';
536536
537537
const data = [
538538
{ value: 10 },
@@ -561,7 +561,7 @@ The `setValueOfKeyForMatchingValuesOfAKey` function changes the 'value' property
561561

562562
### Example Usage
563563
```typescript
564-
import { setValueOfKeyForMatchingValuesOfAKey } from '@xmanscript/utils';
564+
import setValueOfKeyForMatchingValuesOfAKey from '@xmanscript/utils/setValueOfKeyForMatchingValuesOfAKey';
565565
566566
const data = [
567567
{ name: 'A', code: 'x', value:100 },
@@ -594,7 +594,7 @@ The `scrollToComponent` function scrolls to a specified component on the page an
594594

595595
### Example Usage
596596
```typescript
597-
import { scrollToComponent } from '@xmanscript/utils';
597+
import scrollToComponent from '@xmanscript/utils/scrollToComponent';
598598
599599
// Scroll to component with id "myComponent" and focus on it after scrolling. There is no delay in scrolling and focusing by default.
600600
scrollToComponent({ componentId: 'myComponent', focusAfterScroll: true, scrollDelay:100, focusDelay:100 });
@@ -613,7 +613,7 @@ The `distributePercentageEquallyWithRemainder` function divides a given percenta
613613

614614
### Example Usage
615615
```typescript
616-
import { distributePercentageEquallyWithRemainder } from '@xmanscript/utils';
616+
import distributePercentageEquallyWithRemainder from '@xmanscript/utils/distributePercentageEquallyWithRemainder';
617617
618618
const partsToDivide = [
619619
{ id: 30 },
@@ -643,7 +643,7 @@ The `splitArrayIntoChunks` function splits an array into multiple arrays of a sp
643643

644644
### Example Usage
645645
```typescript
646-
import { splitArrayIntoChunks } from '@xmanscript/utils';
646+
import splitArrayIntoChunks from '@xmanscript/utils/splitArrayIntoChunks';
647647
648648
const originalArray = [
649649
{ id: 1, name: 'Item 1' },
@@ -677,7 +677,7 @@ The `getFileExtension` function takes a URL as input and returns the file extens
677677

678678
### Example Usage
679679
```typescript
680-
import { getFileExtension } from '@xmanscript/utils';
680+
import getFileExtension from '@xmanscript/utils/getFileExtension';
681681
682682
const url1 = 'https://example.com/image.jpg';
683683
const url2 = 'https://example.com/document.pdf';
@@ -702,7 +702,7 @@ The `removeObjectFromArray` function removes a specified object from an array of
702702

703703
### Example Usage
704704
```typescript
705-
import { removeObjectFromArray } from '@xmanscript/utils';
705+
import removeObjectFromArray from '@xmanscript/utils/removeObjectFromArray';
706706
707707
const array = [
708708
{ id: 1, name: 'Alice' },
@@ -733,7 +733,7 @@ The `parseToBoolean` function takes a string value and returns a boolean value b
733733

734734
### Example Usage
735735
```typescript
736-
import { parseToBoolean } from '@xmanscript/utils';
736+
import parseToBoolean from '@xmanscript/utils/parseToBoolean';
737737
738738
const result1 = parseToBoolean('true');
739739
// Result: true
@@ -757,7 +757,7 @@ The `groupArrayOfObjectsByValueOfAKey` function takes an array of objects and a
757757

758758
### Example Usage
759759
```typescript
760-
import { groupArrayOfObjectsByValueOfAKey } from '@xmanscript/utils';
760+
import groupArrayOfObjectsByValueOfAKey from '@xmanscript/utils/groupArrayOfObjectsByValueOfAKey';
761761
762762
const data = [
763763
{ category: 'A', value: 1 },
@@ -784,7 +784,7 @@ The `countKeyOccurrences` function counts the number of occurrences of a specifi
784784

785785
### Example Usage
786786
```typescript
787-
import { countKeyOccurrences } from '@xmanscript/utils';
787+
import countKeyOccurrences from '@xmanscript/utils/countKeyOccurrences';
788788
789789
const jsonObject = {
790790
key1: 'value',
@@ -811,7 +811,7 @@ The `distributePercentageEqually` function takes a JSON object and a key, and up
811811

812812
### Example Usage
813813
```typescript
814-
import { distributePercentageEqually } from '@xmanscript/utils';
814+
import distributePercentageEqually from '@xmanscript/utils/distributePercentageEqually';
815815
816816
const jsonObject = {
817817
items: [
@@ -841,7 +841,7 @@ The `uniqueValuesOfKey` function is used to extract unique string values from a
841841
### Example Usage
842842

843843
```typescript
844-
import { uniqueValuesOfKey } from '@xmanscript/utils';
844+
import uniqueValuesOfKey from '@xmanscript/utils/uniqueValuesOfKey';
845845
846846
const data = [
847847
{ id: 1, name: 'John' },
@@ -865,7 +865,7 @@ The `formatNumberToCommaString` function converts a number to a comma-separated
865865

866866
### Example Usage
867867
```typescript
868-
import { formatNumberToCommaString } from '@xmanscript/utils';
868+
import formatNumberToCommaString from '@xmanscript/utils/formatNumberToCommaString';
869869
870870
const number = 1234567.89;
871871
const formattedNumber = formatNumberToCommaString(number);
@@ -888,7 +888,7 @@ The `getMinMax` function finds the minimum and maximum values of a specified key
888888

889889
### Example Usage
890890
```typescript
891-
import { getMinMax } from '@xmanscript/utils';
891+
import getMinMax from '@xmanscript/utils/getMinMax';
892892
893893
const data = [
894894
{ age: 25 },
@@ -914,7 +914,7 @@ The `getDifferenceObject` function finds the minimum and maximum values of a spe
914914

915915
### Example Usage
916916
```typescript
917-
import { getDifferenceObject } from '@xmanscript/utils';
917+
import getDifferenceObject from '@xmanscript/utils/getDifferenceObject';
918918
919919
const obj1 = { name: 'john', family: 'deo' };
920920
const obj1 = { name: 'john', family: { familyName: 'deo' } };
@@ -940,7 +940,7 @@ The `strictIntersectObjects` takes two objects as input and returns a new object
940940

941941
### Example Usage
942942
```typescript
943-
import { strictIntersectObjects } from '@xmanscript/utils';
943+
import strictIntersectObjects from '@xmanscript/utils/strictIntersectObjects';
944944
945945
const object1 = {
946946
name: 'John',

0 commit comments

Comments
 (0)