@calcit/procs 0.25.1 → 0.26.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.
@@ -1148,7 +1148,7 @@ export let _$n_number_$o_fits_$q_ = (value, target) => {
1148
1148
  }
1149
1149
  };
1150
1150
  export let round_$q_ = (a) => {
1151
- return a === Math.round(a);
1151
+ return Number.isInteger(a);
1152
1152
  };
1153
1153
  export let _$n_str_$o_concat = (a, b) => {
1154
1154
  // Optimize string concatenation by avoiding unnecessary toString calls
@@ -1363,7 +1363,16 @@ export let _$n_str_$o_slice = (xs, m, n) => {
1363
1363
  return xs.slice(start, end);
1364
1364
  };
1365
1365
  export let _$n_str_$o_find_index = (x, y) => {
1366
- return x.indexOf(y);
1366
+ const index = x.indexOf(y);
1367
+ if (index <= 0 || !/[\uD800-\uDBFF]/.test(x))
1368
+ return index;
1369
+ // Count only the matched prefix, without allocating a character array.
1370
+ // Lone host surrogates retain the same one-unit behavior as stringScalarOffset.
1371
+ let scalar = 0;
1372
+ for (let offset = 0; offset < index; scalar += 1) {
1373
+ offset += x.codePointAt(offset) > 0xffff ? 2 : 1;
1374
+ }
1375
+ return scalar;
1367
1376
  };
1368
1377
  export let _$n_parse_float = (x) => {
1369
1378
  if (!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(x)) {
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.25.1",
3
+ "version": "0.26.0",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "files": [
6
6
  "lib/",
@@ -21,7 +21,7 @@
21
21
  "test-rs": "cargo test -q",
22
22
  "test-fail": "cargo test -q --bin calcit type_fail_",
23
23
  "test-snippets": "cargo test -q snippets::tests",
24
- "check-js-runtime": "node scripts/check-js-runtime-identity.mjs && cargo build --bin calcit && node scripts/check-string-unicode.mjs && node scripts/check-helper-inference.mjs",
24
+ "check-js-runtime": "node scripts/check-js-runtime-identity.mjs && cargo build --bin calcit && node scripts/check-string-unicode.mjs && node scripts/check-numeric-predicate.mjs && node scripts/check-nil-predicate.mjs && node scripts/check-helper-inference.mjs",
25
25
  "check-js-ffi-source": "cargo build --bin calcit && node scripts/check-js-ffi-source.mjs",
26
26
  "check-literal-paths": "cargo run --bin calcit -- calcit/bench-literal-paths.cirru && cargo run --bin calcit -- --emit-path target/literal-path-js calcit/bench-literal-paths.cirru js && node scripts/bench-literal-paths.mjs",
27
27
  "check-typed-method-rem": "cargo run --bin calcit -- calcit/fibo.cirru && cargo run --bin calcit -- --emit-path target/typed-method-rem-js calcit/fibo.cirru js && node scripts/bench-typed-method-rem.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.25.1",
3
+ "version": "0.26.0",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "files": [
6
6
  "lib/",
@@ -21,7 +21,7 @@
21
21
  "test-rs": "cargo test -q",
22
22
  "test-fail": "cargo test -q --bin calcit type_fail_",
23
23
  "test-snippets": "cargo test -q snippets::tests",
24
- "check-js-runtime": "node scripts/check-js-runtime-identity.mjs && cargo build --bin calcit && node scripts/check-string-unicode.mjs && node scripts/check-helper-inference.mjs",
24
+ "check-js-runtime": "node scripts/check-js-runtime-identity.mjs && cargo build --bin calcit && node scripts/check-string-unicode.mjs && node scripts/check-numeric-predicate.mjs && node scripts/check-nil-predicate.mjs && node scripts/check-helper-inference.mjs",
25
25
  "check-js-ffi-source": "cargo build --bin calcit && node scripts/check-js-ffi-source.mjs",
26
26
  "check-literal-paths": "cargo run --bin calcit -- calcit/bench-literal-paths.cirru && cargo run --bin calcit -- --emit-path target/literal-path-js calcit/bench-literal-paths.cirru js && node scripts/bench-literal-paths.mjs",
27
27
  "check-typed-method-rem": "cargo run --bin calcit -- calcit/fibo.cirru && cargo run --bin calcit -- --emit-path target/typed-method-rem-js calcit/fibo.cirru js && node scripts/bench-typed-method-rem.mjs",