filewisee 0.1.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.
- package/LICENSE +21 -0
- package/dist/compare.d.ts +46 -0
- package/dist/compare.d.ts.map +1 -0
- package/dist/compare.js +98 -0
- package/dist/compare.js.map +1 -0
- package/dist/constants.d.ts +15 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +15 -0
- package/dist/constants.js.map +1 -0
- package/dist/diff.d.ts +43 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +105 -0
- package/dist/diff.js.map +1 -0
- package/dist/file.d.ts +6 -0
- package/dist/file.d.ts.map +1 -0
- package/dist/file.js +37 -0
- package/dist/file.js.map +1 -0
- package/dist/format.d.ts +28 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +99 -0
- package/dist/format.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/locale.d.ts +11 -0
- package/dist/locale.d.ts.map +1 -0
- package/dist/locale.js +29 -0
- package/dist/locale.js.map +1 -0
- package/dist/manipulate.d.ts +65 -0
- package/dist/manipulate.d.ts.map +1 -0
- package/dist/manipulate.js +172 -0
- package/dist/manipulate.js.map +1 -0
- package/dist/parse.d.ts +24 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +135 -0
- package/dist/parse.js.map +1 -0
- package/dist/range.d.ts +25 -0
- package/dist/range.d.ts.map +1 -0
- package/dist/range.js +57 -0
- package/dist/range.js.map +1 -0
- package/dist/relative.d.ts +25 -0
- package/dist/relative.d.ts.map +1 -0
- package/dist/relative.js +60 -0
- package/dist/relative.js.map +1 -0
- package/dist/types.d.ts +37 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validate.d.ts +33 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +64 -0
- package/dist/validate.js.map +1 -0
- package/package.json +40 -0
package/dist/relative.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { MS_PER_DAY, MS_PER_HOUR, MS_PER_MINUTE, MS_PER_SECOND, MS_PER_WEEK, } from "./constants.js";
|
|
2
|
+
import { diffInMilliseconds } from "./diff.js";
|
|
3
|
+
// Ordered ascending: the first threshold whose limit exceeds the absolute
|
|
4
|
+
// distance wins.
|
|
5
|
+
const THRESHOLDS = [
|
|
6
|
+
{ limit: MS_PER_MINUTE, divisor: MS_PER_SECOND, unit: 'second' },
|
|
7
|
+
{ limit: MS_PER_HOUR, divisor: MS_PER_MINUTE, unit: 'minute' },
|
|
8
|
+
{ limit: MS_PER_DAY, divisor: MS_PER_HOUR, unit: 'hour' },
|
|
9
|
+
{ limit: MS_PER_WEEK, divisor: MS_PER_DAY, unit: 'day' },
|
|
10
|
+
{ limit: MS_PER_DAY * 30, divisor: MS_PER_WEEK, unit: 'week' },
|
|
11
|
+
{ limit: MS_PER_DAY * 365, divisor: MS_PER_DAY * 30, unit: 'month' },
|
|
12
|
+
{ limit: Infinity, divisor: MS_PER_DAY * 365, unit: 'year' },
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Human-friendly relative time, localised via the platform `Intl` API.
|
|
16
|
+
*
|
|
17
|
+
* @param input The date to describe.
|
|
18
|
+
* @param base The reference point (default: now).
|
|
19
|
+
* @param locale BCP-47 locale tag(s) for `Intl.RelativeTimeFormat` (default: runtime).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* formatRelative(addDays(new Date(), -3)) // "3 days ago"
|
|
23
|
+
* formatRelative(addHours(new Date(), 2)) // "in 2 hours"
|
|
24
|
+
*/
|
|
25
|
+
export function formatRelative(input, base = new Date(), locale) {
|
|
26
|
+
const deltaMs = diffInMilliseconds(input, base);
|
|
27
|
+
const abs = Math.abs(deltaMs);
|
|
28
|
+
const { divisor, unit } = THRESHOLDS.find((t) => abs < t.limit) ?? THRESHOLDS.at(-1);
|
|
29
|
+
const value = Math.round(deltaMs / divisor);
|
|
30
|
+
const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' });
|
|
31
|
+
return rtf.format(value, unit);
|
|
32
|
+
}
|
|
33
|
+
/** Alias for {@link formatRelative} reading the other way: time from `base` to `input`. */
|
|
34
|
+
export const fromNow = (input, locale) => formatRelative(input, new Date(), locale);
|
|
35
|
+
/**
|
|
36
|
+
* Formats a millisecond duration compactly, largest unit first.
|
|
37
|
+
*
|
|
38
|
+
* @param ms Duration in milliseconds (sign is ignored).
|
|
39
|
+
* @param maxUnits How many units to show (default `2`), e.g. `"1h 30m"`.
|
|
40
|
+
*
|
|
41
|
+
* @example formatDuration(90_061_000) // "1d 1h" (maxUnits: 2)
|
|
42
|
+
*/
|
|
43
|
+
export function formatDuration(ms, maxUnits = 2) {
|
|
44
|
+
let rest = Math.abs(Math.trunc(ms));
|
|
45
|
+
const units = [
|
|
46
|
+
['d', MS_PER_DAY], ['h', MS_PER_HOUR], ['m', MS_PER_MINUTE], ['s', MS_PER_SECOND],
|
|
47
|
+
];
|
|
48
|
+
const parts = [];
|
|
49
|
+
for (const [label, size] of units) {
|
|
50
|
+
if (parts.length >= maxUnits)
|
|
51
|
+
break;
|
|
52
|
+
const value = Math.floor(rest / size);
|
|
53
|
+
if (value > 0 || (parts.length === 0 && label === 's')) {
|
|
54
|
+
parts.push(`${value}${label}`);
|
|
55
|
+
rest -= value * size;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return parts.length ? parts.join(' ') : '0s';
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=relative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relative.js","sourceRoot":"","sources":["../src/relative.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,GACnE,MAAM,gBAAgB,CAAA;AACvB,OAAO,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ACH,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC9C,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anything the library can accept where a date is expected.
|
|
3
|
+
*
|
|
4
|
+
* - `Date` — used as-is (never mutated).
|
|
5
|
+
* - `number` — milliseconds since the Unix epoch.
|
|
6
|
+
* - `string` — an ISO-8601 string (or anything the native `Date` can parse).
|
|
7
|
+
*/
|
|
8
|
+
export type DateInput = Date | number | string;
|
|
9
|
+
/** A unit of time, used by diffing, rounding and manipulation helpers. */
|
|
10
|
+
export type TimeUnit = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
|
|
11
|
+
/** Day of the week, `0` = Sunday … `6` = Saturday (matches `Date.getDay`). */
|
|
12
|
+
export type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
13
|
+
/** A half-open or closed interval between two instants. */
|
|
14
|
+
export interface Interval {
|
|
15
|
+
start: DateInput;
|
|
16
|
+
end: DateInput;
|
|
17
|
+
}
|
|
18
|
+
/** A calendar/clock breakdown of a duration, as returned by {@link breakdownDuration}. */
|
|
19
|
+
export interface DurationParts {
|
|
20
|
+
years: number;
|
|
21
|
+
months: number;
|
|
22
|
+
days: number;
|
|
23
|
+
hours: number;
|
|
24
|
+
minutes: number;
|
|
25
|
+
seconds: number;
|
|
26
|
+
milliseconds: number;
|
|
27
|
+
}
|
|
28
|
+
/** Locale strings used by {@link format} and {@link formatRelative}. */
|
|
29
|
+
export interface Locale {
|
|
30
|
+
months: string[];
|
|
31
|
+
monthsShort: string[];
|
|
32
|
+
weekdays: string[];
|
|
33
|
+
weekdaysShort: string[];
|
|
34
|
+
/** AM/PM markers, e.g. `['AM', 'PM']`. */
|
|
35
|
+
meridiem: [string, string];
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;AAE9C,0EAA0E;AAC1E,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,SAAS,GACT,OAAO,GACP,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,aAAa,CAAA;AAEjB,8EAA8E;AAC9E,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAE/C,2DAA2D;AAC3D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,SAAS,CAAA;IAChB,GAAG,EAAE,SAAS,CAAA;CACf;AAED,0FAA0F;AAC1F,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,wEAAwE;AACxE,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,0CAA0C;IAC1C,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC3B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DateInput } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Returns `true` when the value is a `Date` representing a real instant
|
|
4
|
+
* (i.e. not an `Invalid Date`).
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* isValidDate(new Date()) // true
|
|
8
|
+
* isValidDate(new Date('nonsense')) // false
|
|
9
|
+
* isValidDate('2024-01-01') // false — not a Date instance
|
|
10
|
+
*/
|
|
11
|
+
export declare function isValidDate(value: unknown): value is Date;
|
|
12
|
+
/**
|
|
13
|
+
* Normalises any {@link DateInput} into a fresh `Date` instance.
|
|
14
|
+
*
|
|
15
|
+
* The input is never mutated — passing a `Date` returns a *copy*, so callers
|
|
16
|
+
* can safely keep working with the result.
|
|
17
|
+
*
|
|
18
|
+
* @throws {TypeError} if the input cannot be interpreted as a valid date.
|
|
19
|
+
*/
|
|
20
|
+
export declare function toDate(input: DateInput): Date;
|
|
21
|
+
/**
|
|
22
|
+
* Like {@link toDate} but never throws — returns `null` for invalid input.
|
|
23
|
+
* Useful when validating untrusted data.
|
|
24
|
+
*/
|
|
25
|
+
export declare function tryToDate(input: DateInput): Date | null;
|
|
26
|
+
/** Returns `true` if the given year is a leap year in the Gregorian calendar. */
|
|
27
|
+
export declare function isLeapYear(year: number): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Number of days in the given month.
|
|
30
|
+
* @param month Zero-based month (`0` = January, `11` = December).
|
|
31
|
+
*/
|
|
32
|
+
export declare function daysInMonth(year: number, month: number): number;
|
|
33
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEzD;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAkB7C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAMvD;AAED,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/D"}
|
package/dist/validate.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns `true` when the value is a `Date` representing a real instant
|
|
3
|
+
* (i.e. not an `Invalid Date`).
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* isValidDate(new Date()) // true
|
|
7
|
+
* isValidDate(new Date('nonsense')) // false
|
|
8
|
+
* isValidDate('2024-01-01') // false — not a Date instance
|
|
9
|
+
*/
|
|
10
|
+
export function isValidDate(value) {
|
|
11
|
+
return value instanceof Date && !Number.isNaN(value.getTime());
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Normalises any {@link DateInput} into a fresh `Date` instance.
|
|
15
|
+
*
|
|
16
|
+
* The input is never mutated — passing a `Date` returns a *copy*, so callers
|
|
17
|
+
* can safely keep working with the result.
|
|
18
|
+
*
|
|
19
|
+
* @throws {TypeError} if the input cannot be interpreted as a valid date.
|
|
20
|
+
*/
|
|
21
|
+
export function toDate(input) {
|
|
22
|
+
let date;
|
|
23
|
+
if (input instanceof Date) {
|
|
24
|
+
date = new Date(input.getTime());
|
|
25
|
+
}
|
|
26
|
+
else if (typeof input === 'number') {
|
|
27
|
+
date = new Date(input);
|
|
28
|
+
}
|
|
29
|
+
else if (typeof input === 'string') {
|
|
30
|
+
date = new Date(input);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw new TypeError(`Cannot convert value of type "${typeof input}" to a Date`);
|
|
34
|
+
}
|
|
35
|
+
if (Number.isNaN(date.getTime())) {
|
|
36
|
+
throw new TypeError(`Invalid date input: ${JSON.stringify(input)}`);
|
|
37
|
+
}
|
|
38
|
+
return date;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Like {@link toDate} but never throws — returns `null` for invalid input.
|
|
42
|
+
* Useful when validating untrusted data.
|
|
43
|
+
*/
|
|
44
|
+
export function tryToDate(input) {
|
|
45
|
+
try {
|
|
46
|
+
return toDate(input);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Returns `true` if the given year is a leap year in the Gregorian calendar. */
|
|
53
|
+
export function isLeapYear(year) {
|
|
54
|
+
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Number of days in the given month.
|
|
58
|
+
* @param month Zero-based month (`0` = January, `11` = December).
|
|
59
|
+
*/
|
|
60
|
+
export function daysInMonth(year, month) {
|
|
61
|
+
// Day 0 of the next month rolls back to the last day of `month`.
|
|
62
|
+
return new Date(year, month + 1, 0).getDate();
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,KAAK,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;AAChE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CAAC,KAAgB;IACrC,IAAI,IAAU,CAAA;IACd,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC1B,IAAI,GAAG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
2
|
+
"name": "filewisee",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Node utility to format date",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"date",
|
|
7
|
+
"time",
|
|
8
|
+
"datetime"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc -p tsconfig.build.json",
|
|
31
|
+
"clean": "rm -rf dist",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"test": "node --experimental-strip-types --test \"test/**/*.test.ts\"",
|
|
34
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^26.0.1",
|
|
38
|
+
"typescript": "^6.0.3"
|
|
39
|
+
}
|
|
40
|
+
}
|