dtg-js 1.1.0 → 1.1.1

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/README.md CHANGED
@@ -11,7 +11,7 @@ npm install dtg-js
11
11
  ### Usage
12
12
 
13
13
  ```js
14
- const { toBase60, toJSDate } = require("dtg-js");
14
+ import { toBase60, toJSDate } = from "dtg-js";
15
15
 
16
16
  console.log(toBase60(new Date()));
17
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtg-js",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "engines": {
@@ -1,44 +0,0 @@
1
- name: Test
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- pull_request:
8
- branches:
9
- - main
10
- paths:
11
- - "**.js"
12
- - ".github/workflows/*.yml"
13
- - package.json
14
-
15
- jobs:
16
- format:
17
- name: Format Check
18
- runs-on: ubuntu-slim
19
- steps:
20
- - uses: actions/checkout@v4
21
- - name: Setup Node.js
22
- uses: actions/setup-node@v4
23
- with:
24
- node-version: 24
25
- - run: npm install
26
- - name: Check format
27
- run: npm run prettier:check
28
- build:
29
- name: Testing
30
- needs: format
31
- strategy:
32
- matrix:
33
- os: [ubuntu-latest, ubuntu-24.04-arm, ubuntu-slim]
34
- node-version: [20, 22, 24]
35
- runs-on: ${{ matrix.os }}
36
- steps:
37
- - uses: actions/checkout@v4
38
- - name: Setup Node.js ${{ matrix.node-version }}
39
- uses: actions/setup-node@v4
40
- with:
41
- node-version: ${{ matrix.node-version }}
42
- - run: npm install
43
- - name: Run tests
44
- run: npm test
@@ -1,28 +0,0 @@
1
- import { describe, expect, test } from "vitest";
2
- import { toBase60, toJSDate } from "../index";
3
-
4
- describe("dtg-js", () => {
5
- test("invalid base 60 string", () => {
6
- expect(() => toJSDate("foobar")).toThrow(
7
- "It\'s not a valid base 60 string",
8
- );
9
- });
10
-
11
- test("invalid datetime object", () => {
12
- expect(() => toBase60(null)).toThrow(
13
- '"datetime" is not a valid Date object',
14
- );
15
- });
16
-
17
- test("convert datetime to base 60", () => {
18
- const datetime = new Date(Date.UTC(2025, 4, 22, 10, 15, 13));
19
- expect(toBase60(datetime)).toBe("Xj4LAFD");
20
- });
21
-
22
- test("convert base 60 to datetime", () => {
23
- const base60 = "Xj4LAFD";
24
- expect(toJSDate(base60)).toEqual(
25
- new Date(Date.UTC(2025, 4, 22, 10, 15, 13)),
26
- );
27
- });
28
- });