@leancodepl/api-date-utils 8.3.6 → 8.5.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/package.json CHANGED
@@ -1,20 +1,57 @@
1
1
  {
2
2
  "name": "@leancodepl/api-date-utils",
3
- "version": "8.3.6",
3
+ "version": "8.5.0",
4
4
  "license": "Apache-2.0",
5
5
  "dependencies": {
6
- "@leancodepl/api-date": "8.3.6"
6
+ "@leancodepl/api-date": "8.5.0"
7
7
  },
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "registry": "https://registry.npmjs.org/"
11
+ },
12
+ "engines": {
13
+ "node": ">=18.0.0"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/leancodepl/js_corelibrary.git",
18
+ "directory": "packages/cqrs-clients/custom-types/date/api-date-utils"
19
+ },
20
+ "homepage": "https://github.com/leancodepl/js_corelibrary",
21
+ "bugs": {
22
+ "url": "https://github.com/leancodepl/js_corelibrary/issues"
23
+ },
24
+ "description": "Utility functions for API date parsing and validation",
25
+ "keywords": [
26
+ "date",
27
+ "parsing",
28
+ "validation",
29
+ "api",
30
+ "utilities",
31
+ "typescript",
32
+ "javascript",
33
+ "leancode"
34
+ ],
35
+ "author": {
36
+ "name": "LeanCode",
37
+ "url": "https://leancode.co"
38
+ },
39
+ "files": [
40
+ "dist",
41
+ "README.md",
42
+ "CHANGELOG.md"
43
+ ],
44
+ "sideEffects": false,
8
45
  "exports": {
9
46
  "./package.json": "./package.json",
10
47
  ".": {
11
48
  "module": "./index.esm.js",
12
- "types": "./index.esm.d.ts",
49
+ "types": "./index.d.ts",
13
50
  "import": "./index.cjs.mjs",
14
51
  "default": "./index.cjs.js"
15
52
  }
16
53
  },
17
54
  "module": "./index.esm.js",
18
55
  "main": "./index.cjs.js",
19
- "types": "./index.esm.d.ts"
56
+ "types": "./index.d.ts"
20
57
  }
package/index.cjs.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src/index";
@@ -1 +0,0 @@
1
- exports._default = require('./index.cjs.js').default;
package/index.cjs.js DELETED
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- const parseIntMatched = (value)=>parseInt(value != null ? value : "0");
4
- function parseApiTimeSpan(timespan) {
5
- /**
6
- * This regex returns tuple of matched strings (either of string type or undefined) and default match function parameters
7
- * following [timeSpan, sign, days, hours, minutes, seconds, milliseconds, index of search at which the result was found, input (search string), groups] schema
8
- */ const matched = timespan.match(/^(-)?([0-9]+)?\.?([0-9]{2}):([0-9]{2}):([0-9]{2})\.?([0-9]{3})?$/);
9
- return {
10
- sign: matched == null ? void 0 : matched[1],
11
- values: {
12
- days: parseIntMatched(matched == null ? void 0 : matched[2]),
13
- hours: parseIntMatched(matched == null ? void 0 : matched[3]),
14
- minutes: parseIntMatched(matched == null ? void 0 : matched[4]),
15
- seconds: parseIntMatched(matched == null ? void 0 : matched[5]),
16
- milliseconds: parseIntMatched(matched == null ? void 0 : matched[6])
17
- }
18
- };
19
- }
20
-
21
- exports.parseApiTimeSpan = parseApiTimeSpan;
package/index.cjs.mjs DELETED
@@ -1,2 +0,0 @@
1
- export * from './index.cjs.js';
2
- export { _default as default } from './index.cjs.default.js';
package/index.esm.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src/index";
package/index.esm.js DELETED
@@ -1,19 +0,0 @@
1
- const parseIntMatched = (value)=>parseInt(value != null ? value : "0");
2
- function parseApiTimeSpan(timespan) {
3
- /**
4
- * This regex returns tuple of matched strings (either of string type or undefined) and default match function parameters
5
- * following [timeSpan, sign, days, hours, minutes, seconds, milliseconds, index of search at which the result was found, input (search string), groups] schema
6
- */ const matched = timespan.match(/^(-)?([0-9]+)?\.?([0-9]{2}):([0-9]{2}):([0-9]{2})\.?([0-9]{3})?$/);
7
- return {
8
- sign: matched == null ? void 0 : matched[1],
9
- values: {
10
- days: parseIntMatched(matched == null ? void 0 : matched[2]),
11
- hours: parseIntMatched(matched == null ? void 0 : matched[3]),
12
- minutes: parseIntMatched(matched == null ? void 0 : matched[4]),
13
- seconds: parseIntMatched(matched == null ? void 0 : matched[5]),
14
- milliseconds: parseIntMatched(matched == null ? void 0 : matched[6])
15
- }
16
- };
17
- }
18
-
19
- export { parseApiTimeSpan };
package/src/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./lib/parseApiTimeSpan";
@@ -1,11 +0,0 @@
1
- import type { ApiTimeSpan } from "@leancodepl/api-date";
2
- export declare function parseApiTimeSpan(timespan: ApiTimeSpan): {
3
- sign: any;
4
- values: {
5
- days: number;
6
- hours: number;
7
- minutes: number;
8
- seconds: number;
9
- milliseconds: number;
10
- };
11
- };