Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ jobs:
run: |
yarn compile-page
yarn compile-server
node --test scripts/node-host-methods.test.mjs
yarn check:client-generation
yarn vite build --base=./
4 changes: 2 additions & 2 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@
:code $ quote $ defn node-data-string (raw-data)
let
data $ unsafe-coerce raw-data 'NodeDataHost
unsafe-coerce (.!to-string data) 'String
unsafe-coerce (.!toString data) 'String
:examples $ []
:schema $ :: 'Fn $ {} (:return 'String)
:args $ [] 'Dynamic
Expand Down Expand Up @@ -999,7 +999,7 @@
:code $ quote $ defn current-iso-time! ()
let
date $ unsafe-coerce (new js/Date) 'DateHost
unsafe-coerce (.!to-iso-string date) 'String
unsafe-coerce (.!toISOString date) 'String
:examples $ []
:schema $ :: 'Fn $ {} (:return 'String)
:args $ []
Expand Down
2 changes: 1 addition & 1 deletion deps.cirru
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{} (:calcit-version |0.19.1)
:version |0.0.31
:version |0.0.32
:dependencies $ {} (|Cumulo/cumulo-util.calcit |0.0.23)
|calcit-lang/js-ffi |0.1.36
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"vite": "^8.0.2",
"ws": "^8.18.2"
},
"version": "0.0.31"
"version": "0.0.32"
}
13 changes: 13 additions & 0 deletions scripts/node-host-methods.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import assert from 'node:assert/strict';
import test from 'node:test';

import { node_data_string } from '../js-out/ws-edn.server.mjs';
import { current_iso_time_$x_ } from '../js-out/ws-edn.util.mjs';

test('converts a Node message Buffer to text', () => {
assert.equal(node_data_string(Buffer.from('hello')), 'hello');
});

test('reads the host Date as an ISO string', () => {
assert.match(current_iso_time_$x_(), /^\d{4}-\d{2}-\d{2}T/);
});
Loading