Skip to content

Commit 1d1230a

Browse files
committed
Remove duplicate documentation, fix date getter test titles, fix linting issues
1 parent 129a51d commit 1d1230a

16 files changed

+20
-43
lines changed

README.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ A collection of useful utility functions with associated TypeScript types.
4141
- [getStartOfSecond](#getstartofsecond)
4242
- [getStartOfWeek](#getstartofweek)
4343
- [getStartOfYear](#getstartofyear)
44-
- [DOM helpers](#dom-helpers)
45-
- [getScrollParent](#getscrollparent)
4644
- [setEndOfDay](#setendofday)
4745
- [setEndOfHour](#setendofhour)
4846
- [setEndOfMinute](#setendofminute)
@@ -57,8 +55,8 @@ A collection of useful utility functions with associated TypeScript types.
5755
- [setStartOfSecond](#setstartofsecond)
5856
- [setStartOfWeek](#setstartofweek)
5957
- [setStartOfYear](#setstartofyear)
60-
- [DOM helpers](#dom-helpers-1)
61-
- [getScrollParent](#getscrollparent-1)
58+
- [DOM helpers](#dom-helpers)
59+
- [getScrollParent](#getscrollparent)
6260

6361
## Install
6462

@@ -680,28 +678,6 @@ import { getStartOfYear } from '@qntm-code/utils';
680678
const startOfCurrentYear: Date = getStartOfYear();
681679
```
682680

683-
### DOM helpers
684-
685-
---
686-
687-
#### getScrollParent
688-
689-
Gets the scrollable parent element of a node.
690-
691-
| Parameter | Type | Optional | Default value | Description |
692-
| --------- | ----------- | -------- | ------------- | -------------------------------------------------------- |
693-
| node | HTMLElement | false | | The HTML element you want to find the scroll parent for |
694-
| x | boolean | true | true | Whether to check if the element can scroll on the x axis |
695-
| y | boolean | true | true | Whether to check if the element can scroll on the y axis |
696-
697-
**Example**
698-
699-
```typescript
700-
import { getScrollParent } from '@qntm-code/utils';
701-
702-
const scrollParent = getScrollParent(document.getElementById('my-element'));
703-
```
704-
705681
---
706682

707683
#### setEndOfDay

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"build": " yarn lint && tsc -p tsconfig.json --outDir dist/",
7474
"lint": "yarn tidy-clean && yarn tslint --project tsconfig.lint.json",
7575
"test": "KARMA_SINGLE_RUN=false karma start ./karma.conf.js",
76-
"test-single": "yarn tidy-clean && yarn karma start ./karma.conf.js",
76+
"test-single": "yarn tidy-clean && yarn lint && yarn karma start ./karma.conf.js",
7777
"tidy-clean": "rm -rf dist coverage"
7878
},
7979
"lint-staged": {

tests/dates/getters/getEndOfDay.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getEndOfDay, setEndOfDay } from '../../../src';
22

33
describe('getEndOfDay', () => {
4-
it('hours should be set to 23, minutes and seconds to 59, and milliseconds to 999and the result should be a new Object', () => {
4+
it('hours should be set to 23, minutes and seconds to 59, and milliseconds to 999 and the result should be a new Object', () => {
55
const value = new Date(2020, 8, 3, 15, 31, 22, 123);
66

77
const expected = new Date(2020, 8, 3, 23, 59, 59, 999);

tests/dates/getters/getEndOfHour.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getEndOfHour, setEndOfHour } from '../../../src';
22

33
describe('getEndOfHour', () => {
4-
it('minutes and seconds should be set to 59 and milliseconds to 999and the result should be a new Object', () => {
4+
it('minutes and seconds should be set to 59 and milliseconds to 999 and the result should be a new Object', () => {
55
const value = new Date(2020, 8, 3, 15, 31, 22, 123);
66

77
const expected = new Date(2020, 8, 3, 15, 59, 59, 999);

tests/dates/getters/getEndOfMinute.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getEndOfMinute, setEndOfMinute } from '../../../src';
22

33
describe('getEndOfMinute', () => {
4-
it('seconds should be set to 59 and milliseconds to 999and the result should be a new Object', () => {
4+
it('seconds should be set to 59 and milliseconds to 999 and the result should be a new Object', () => {
55
const value = new Date(2020, 8, 3, 15, 31, 22, 123);
66

77
const expected = new Date(2020, 8, 3, 15, 31, 59, 999);

tests/dates/getters/getEndOfMonth.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getEndOfMonth, setEndOfMonth } from '../../../src';
22

33
describe('getEndOfMonth', () => {
4-
it('hours should be set to 23, minutes and seconds to 59, milliseconds to 999, and day to the last of the monthand the result should be a new Object', () => {
4+
it('hours should be set to 23, minutes and seconds to 59, milliseconds to 999, and day to the last of the month and the result should be a new Object', () => {
55
const value = new Date(2020, 8, 3, 15, 31, 22, 123);
66

77
const expected = new Date(2020, 8, 30, 23, 59, 59, 999);

tests/dates/getters/getEndOfSecond.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getEndOfSecond, setEndOfSecond } from '../../../src';
22

33
describe('getEndOfSecond', () => {
4-
it('milliseconds should be set to 999and the result should be a new Object', () => {
4+
it('milliseconds should be set to 999 and the result should be a new Object', () => {
55
const value = new Date(2020, 8, 3, 15, 31, 22, 123);
66

77
const expected = new Date(2020, 8, 3, 15, 31, 22, 999);

tests/dates/getters/getEndOfWeek.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getEndOfWeek, setEndOfWeek } from '../../../src';
22

33
describe('getEndOfWeek', () => {
4-
it('hours should be set to 23, minutes and seconds should be set to 59, milliseconds to 999, and day to last day of weekand the result should be a new Object', () => {
4+
it('hours should be set to 23, minutes and seconds should be set to 59, milliseconds to 999, and day to last day of week and the result should be a new Object', () => {
55
const value = new Date(2020, 8, 3, 15, 31, 22, 123);
66

77
const expected = new Date(2020, 8, 6, 23, 59, 59, 999);
@@ -13,7 +13,7 @@ describe('getEndOfWeek', () => {
1313
expect(result).not.toBe(value);
1414
});
1515

16-
it('On a Monday it should go forward Sunday of same weekand the result should be a new Object', () => {
16+
it('On a Monday it should go forward Sunday of same week and the result should be a new Object', () => {
1717
const value = new Date(2020, 7, 24, 15, 31, 22, 123);
1818

1919
const expected = new Date(2020, 7, 30, 23, 59, 59, 999);

tests/dates/getters/getEndOfYear.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getEndOfYear, setEndOfYear } from '../../../src';
22

33
describe('getEndOfYear', () => {
4-
it('month should be set to 11, day to 31, hours to 23, minutes and seconds should be set to 59, and milliseconds to 999and the result should be a new Object', () => {
4+
it('month should be set to 11, day to 31, hours to 23, minutes and seconds should be set to 59, and milliseconds to 999 and the result should be a new Object', () => {
55
const value = new Date(2020, 8, 3, 15, 31, 22, 123);
66

77
const expected = new Date(2020, 11, 31, 23, 59, 59, 999);

tests/dates/getters/getStartOfDay.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getStartOfDay, setStartOfDay } from '../../../src';
22

33
describe('getStartOfDay', () => {
4-
it('milliseconds, seconds, minutes, and hour should be set to 0and the result should be a new Object', () => {
4+
it('milliseconds, seconds, minutes, and hour should be set to 0 and the result should be a new Object', () => {
55
const value = new Date(2020, 8, 3, 15, 31, 22, 123);
66

77
const expected = new Date(2020, 8, 3, 0, 0, 0, 0);

0 commit comments

Comments
 (0)