squint-cljs 0.1.21 → 0.1.22

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
@@ -2,7 +2,7 @@
2
2
  "name": "squint-cljs",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.1.21",
5
+ "version": "0.1.22",
6
6
  "files": [
7
7
  "core.js",
8
8
  "src/squint/core.js",
@@ -545,7 +545,7 @@ export function keep_indexed(f, coll) {
545
545
  let fret = f(i, x);
546
546
  if (!!fret) {
547
547
  ret.push(fret);
548
- };
548
+ }
549
549
  i++;
550
550
  }
551
551
  return ret;
@@ -1250,24 +1250,24 @@ export function max(x, y, ...more) {
1250
1250
  if (y == undefined) {
1251
1251
  return x;
1252
1252
  }
1253
- if ( more.length == 0) {
1254
- return ( x > y ) ? x : y;
1253
+ if (more.length == 0) {
1254
+ return x > y ? x : y;
1255
1255
  }
1256
- return max(max(x,y),...more);
1256
+ return max(max(x, y), ...more);
1257
1257
  }
1258
1258
 
1259
1259
  export function min(x, y, ...more) {
1260
1260
  if (y == undefined) {
1261
1261
  return x;
1262
1262
  }
1263
- if ( more.length == 0) {
1264
- return ( x < y ) ? x : y;
1263
+ if (more.length == 0) {
1264
+ return x < y ? x : y;
1265
1265
  }
1266
- return min(min(x,y),...more);
1266
+ return min(min(x, y), ...more);
1267
1267
  }
1268
1268
 
1269
1269
  export function map_QMARK_(x) {
1270
- return (x instanceof Object);
1270
+ return x instanceof Object;
1271
1271
  }
1272
1272
 
1273
1273
  export function every_pred(...preds) {
@@ -1302,3 +1302,35 @@ export function into_array(type, aseq) {
1302
1302
  let theSeq = aseq || type;
1303
1303
  return vec(theSeq);
1304
1304
  }
1305
+
1306
+ export function iterate(f, x) {
1307
+ var current = x;
1308
+ return lazy(function* () {
1309
+ while (true) {
1310
+ yield current;
1311
+ current = f(current);
1312
+ }
1313
+ });
1314
+ }
1315
+
1316
+ export function juxt(...fs) {
1317
+ return (...args) => {
1318
+ let ret = [];
1319
+ for (let f of fs) {
1320
+ ret.push(f(...args));
1321
+ }
1322
+ return ret;
1323
+ };
1324
+ }
1325
+
1326
+ export function next(x) {
1327
+ if (x instanceof Array) {
1328
+ let ret = x.slice(1);
1329
+ if (ret.length > 0) {
1330
+ return ret;
1331
+ } else {
1332
+ return null;
1333
+ }
1334
+ }
1335
+ throw new Error('next not implement for non-arrays yet');
1336
+ }