2018-11-08 09:47:44 +01:00
|
|
|
// Compiled by ClojureScript 1.10.439 {:static-fns true, :optimize-constants true}
|
2018-08-31 17:05:18 +02:00
|
|
|
goog.provide('clojure.data');
|
|
|
|
|
goog.require('cljs.core');
|
|
|
|
|
goog.require('cljs.core.constants');
|
|
|
|
|
goog.require('clojure.set');
|
|
|
|
|
/**
|
|
|
|
|
* Internal helper for diff.
|
|
|
|
|
*/
|
|
|
|
|
clojure.data.atom_diff = (function clojure$data$atom_diff(a,b){
|
|
|
|
|
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a,b)){
|
|
|
|
|
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null,a], null);
|
|
|
|
|
} else {
|
|
|
|
|
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [a,b,null], null);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
/**
|
|
|
|
|
* Convert an associative-by-numeric-index collection into
|
|
|
|
|
* an equivalent vector, with nil for any missing keys
|
|
|
|
|
*/
|
|
|
|
|
clojure.data.vectorize = (function clojure$data$vectorize(m){
|
|
|
|
|
if(cljs.core.seq(m)){
|
2018-11-08 09:47:44 +01:00
|
|
|
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (result,p__4737){
|
|
|
|
|
var vec__4738 = p__4737;
|
|
|
|
|
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__4738,(0),null);
|
|
|
|
|
var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__4738,(1),null);
|
2018-08-31 17:05:18 +02:00
|
|
|
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(result,k,v);
|
|
|
|
|
}),cljs.core.vec(cljs.core.repeat.cljs$core$IFn$_invoke$arity$2(cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.max,cljs.core.keys(m)),null)),m);
|
|
|
|
|
} else {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
/**
|
|
|
|
|
* Diff associative things a and b, comparing only the key k.
|
|
|
|
|
*/
|
|
|
|
|
clojure.data.diff_associative_key = (function clojure$data$diff_associative_key(a,b,k){
|
|
|
|
|
var va = cljs.core.get.cljs$core$IFn$_invoke$arity$2(a,k);
|
|
|
|
|
var vb = cljs.core.get.cljs$core$IFn$_invoke$arity$2(b,k);
|
2018-11-08 09:47:44 +01:00
|
|
|
var vec__4741 = clojure.data.diff(va,vb);
|
|
|
|
|
var a_STAR_ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__4741,(0),null);
|
|
|
|
|
var b_STAR_ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__4741,(1),null);
|
|
|
|
|
var ab = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__4741,(2),null);
|
2018-08-31 17:05:18 +02:00
|
|
|
var in_a = cljs.core.contains_QMARK_(a,k);
|
|
|
|
|
var in_b = cljs.core.contains_QMARK_(b,k);
|
2018-11-08 09:47:44 +01:00
|
|
|
var same = ((in_a) && (in_b) && ((((!((ab == null)))) || ((((va == null)) && ((vb == null)))))));
|
|
|
|
|
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [((((in_a) && ((((!((a_STAR_ == null)))) || ((!(same)))))))?cljs.core.PersistentArrayMap.createAsIfByAssoc([k,a_STAR_]):null),((((in_b) && ((((!((b_STAR_ == null)))) || ((!(same)))))))?cljs.core.PersistentArrayMap.createAsIfByAssoc([k,b_STAR_]):null),((same)?cljs.core.PersistentArrayMap.createAsIfByAssoc([k,ab]):null)], null);
|
2018-08-31 17:05:18 +02:00
|
|
|
});
|
|
|
|
|
/**
|
|
|
|
|
* Diff associative things a and b, comparing only keys in ks (if supplied).
|
|
|
|
|
*/
|
|
|
|
|
clojure.data.diff_associative = (function clojure$data$diff_associative(var_args){
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4745 = arguments.length;
|
|
|
|
|
switch (G__4745) {
|
2018-08-31 17:05:18 +02:00
|
|
|
case 2:
|
|
|
|
|
return clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
return clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$2 = (function (a,b){
|
|
|
|
|
return clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$3(a,b,clojure.set.union.cljs$core$IFn$_invoke$arity$2(cljs.core.keys(a),cljs.core.keys(b)));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$3 = (function (a,b,ks){
|
|
|
|
|
return cljs.core.reduce.cljs$core$IFn$_invoke$arity$3((function (diff1,diff2){
|
|
|
|
|
return cljs.core.doall.cljs$core$IFn$_invoke$arity$1(cljs.core.map.cljs$core$IFn$_invoke$arity$3(cljs.core.merge,diff1,diff2));
|
|
|
|
|
}),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null,null], null),cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.partial.cljs$core$IFn$_invoke$arity$3(clojure.data.diff_associative_key,a,b),ks));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
clojure.data.diff_associative.cljs$lang$maxFixedArity = 3;
|
|
|
|
|
|
|
|
|
|
clojure.data.diff_sequential = (function clojure$data$diff_sequential(a,b){
|
2018-11-08 09:47:44 +01:00
|
|
|
return cljs.core.vec(cljs.core.map.cljs$core$IFn$_invoke$arity$2(clojure.data.vectorize,clojure.data.diff_associative.cljs$core$IFn$_invoke$arity$3(((cljs.core.vector_QMARK_(a))?a:cljs.core.vec(a)),((cljs.core.vector_QMARK_(b))?b:cljs.core.vec(b)),cljs.core.range.cljs$core$IFn$_invoke$arity$1((function (){var x__4135__auto__ = cljs.core.count(a);
|
|
|
|
|
var y__4136__auto__ = cljs.core.count(b);
|
|
|
|
|
return ((x__4135__auto__ > y__4136__auto__) ? x__4135__auto__ : y__4136__auto__);
|
2018-08-31 17:05:18 +02:00
|
|
|
})()))));
|
|
|
|
|
});
|
|
|
|
|
clojure.data.diff_set = (function clojure$data$diff_set(a,b){
|
|
|
|
|
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.not_empty(clojure.set.difference.cljs$core$IFn$_invoke$arity$2(a,b)),cljs.core.not_empty(clojure.set.difference.cljs$core$IFn$_invoke$arity$2(b,a)),cljs.core.not_empty(clojure.set.intersection.cljs$core$IFn$_invoke$arity$2(a,b))], null);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implementation detail. Subject to change.
|
|
|
|
|
* @interface
|
|
|
|
|
*/
|
|
|
|
|
clojure.data.EqualityPartition = function(){};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implementation detail. Subject to change.
|
|
|
|
|
*/
|
|
|
|
|
clojure.data.equality_partition = (function clojure$data$equality_partition(x){
|
2018-11-08 09:47:44 +01:00
|
|
|
if((((!((x == null)))) && ((!((x.clojure$data$EqualityPartition$equality_partition$arity$1 == null)))))){
|
2018-08-31 17:05:18 +02:00
|
|
|
return x.clojure$data$EqualityPartition$equality_partition$arity$1(x);
|
|
|
|
|
} else {
|
2018-11-08 09:47:44 +01:00
|
|
|
var x__4347__auto__ = (((x == null))?null:x);
|
|
|
|
|
var m__4348__auto__ = (clojure.data.equality_partition[goog.typeOf(x__4347__auto__)]);
|
|
|
|
|
if((!((m__4348__auto__ == null)))){
|
|
|
|
|
return (m__4348__auto__.cljs$core$IFn$_invoke$arity$1 ? m__4348__auto__.cljs$core$IFn$_invoke$arity$1(x) : m__4348__auto__.call(null,x));
|
2018-08-31 17:05:18 +02:00
|
|
|
} else {
|
2018-11-08 09:47:44 +01:00
|
|
|
var m__4348__auto____$1 = (clojure.data.equality_partition["_"]);
|
|
|
|
|
if((!((m__4348__auto____$1 == null)))){
|
|
|
|
|
return (m__4348__auto____$1.cljs$core$IFn$_invoke$arity$1 ? m__4348__auto____$1.cljs$core$IFn$_invoke$arity$1(x) : m__4348__auto____$1.call(null,x));
|
2018-08-31 17:05:18 +02:00
|
|
|
} else {
|
|
|
|
|
throw cljs.core.missing_protocol("EqualityPartition.equality-partition",x);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implementation detail. Subject to change.
|
|
|
|
|
* @interface
|
|
|
|
|
*/
|
|
|
|
|
clojure.data.Diff = function(){};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implementation detail. Subject to change.
|
|
|
|
|
*/
|
|
|
|
|
clojure.data.diff_similar = (function clojure$data$diff_similar(a,b){
|
2018-11-08 09:47:44 +01:00
|
|
|
if((((!((a == null)))) && ((!((a.clojure$data$Diff$diff_similar$arity$2 == null)))))){
|
2018-08-31 17:05:18 +02:00
|
|
|
return a.clojure$data$Diff$diff_similar$arity$2(a,b);
|
|
|
|
|
} else {
|
2018-11-08 09:47:44 +01:00
|
|
|
var x__4347__auto__ = (((a == null))?null:a);
|
|
|
|
|
var m__4348__auto__ = (clojure.data.diff_similar[goog.typeOf(x__4347__auto__)]);
|
|
|
|
|
if((!((m__4348__auto__ == null)))){
|
|
|
|
|
return (m__4348__auto__.cljs$core$IFn$_invoke$arity$2 ? m__4348__auto__.cljs$core$IFn$_invoke$arity$2(a,b) : m__4348__auto__.call(null,a,b));
|
2018-08-31 17:05:18 +02:00
|
|
|
} else {
|
2018-11-08 09:47:44 +01:00
|
|
|
var m__4348__auto____$1 = (clojure.data.diff_similar["_"]);
|
|
|
|
|
if((!((m__4348__auto____$1 == null)))){
|
|
|
|
|
return (m__4348__auto____$1.cljs$core$IFn$_invoke$arity$2 ? m__4348__auto____$1.cljs$core$IFn$_invoke$arity$2(a,b) : m__4348__auto____$1.call(null,a,b));
|
2018-08-31 17:05:18 +02:00
|
|
|
} else {
|
|
|
|
|
throw cljs.core.missing_protocol("Diff.diff-similar",a);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.EqualityPartition,"null",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4747_4771 = clojure.data.equality_partition;
|
|
|
|
|
var G__4748_4772 = "null";
|
|
|
|
|
var G__4749_4773 = ((function (G__4747_4771,G__4748_4772){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (x){
|
|
|
|
|
return cljs.core.cst$kw$atom;
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4747_4771,G__4748_4772))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4747_4771,G__4748_4772,G__4749_4773);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.EqualityPartition,"string",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4750_4774 = clojure.data.equality_partition;
|
|
|
|
|
var G__4751_4775 = "string";
|
|
|
|
|
var G__4752_4776 = ((function (G__4750_4774,G__4751_4775){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (x){
|
|
|
|
|
return cljs.core.cst$kw$atom;
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4750_4774,G__4751_4775))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4750_4774,G__4751_4775,G__4752_4776);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.EqualityPartition,"number",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4753_4777 = clojure.data.equality_partition;
|
|
|
|
|
var G__4754_4778 = "number";
|
|
|
|
|
var G__4755_4779 = ((function (G__4753_4777,G__4754_4778){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (x){
|
|
|
|
|
return cljs.core.cst$kw$atom;
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4753_4777,G__4754_4778))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4753_4777,G__4754_4778,G__4755_4779);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.EqualityPartition,"array",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4756_4780 = clojure.data.equality_partition;
|
|
|
|
|
var G__4757_4781 = "array";
|
|
|
|
|
var G__4758_4782 = ((function (G__4756_4780,G__4757_4781){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (x){
|
|
|
|
|
return cljs.core.cst$kw$sequential;
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4756_4780,G__4757_4781))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4756_4780,G__4757_4781,G__4758_4782);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.EqualityPartition,"function",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4759_4783 = clojure.data.equality_partition;
|
|
|
|
|
var G__4760_4784 = "function";
|
|
|
|
|
var G__4761_4785 = ((function (G__4759_4783,G__4760_4784){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (x){
|
|
|
|
|
return cljs.core.cst$kw$atom;
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4759_4783,G__4760_4784))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4759_4783,G__4760_4784,G__4761_4785);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.EqualityPartition,"boolean",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4762_4786 = clojure.data.equality_partition;
|
|
|
|
|
var G__4763_4787 = "boolean";
|
|
|
|
|
var G__4764_4788 = ((function (G__4762_4786,G__4763_4787){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (x){
|
|
|
|
|
return cljs.core.cst$kw$atom;
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4762_4786,G__4763_4787))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4762_4786,G__4763_4787,G__4764_4788);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.EqualityPartition,"_",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4765_4789 = clojure.data.equality_partition;
|
|
|
|
|
var G__4766_4790 = "_";
|
|
|
|
|
var G__4767_4791 = ((function (G__4765_4789,G__4766_4790){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (x){
|
2018-11-08 09:47:44 +01:00
|
|
|
if((((!((x == null))))?(((((x.cljs$lang$protocol_mask$partition0$ & (1024))) || ((cljs.core.PROTOCOL_SENTINEL === x.cljs$core$IMap$))))?true:(((!x.cljs$lang$protocol_mask$partition0$))?cljs.core.native_satisfies_QMARK_(cljs.core.IMap,x):false)):cljs.core.native_satisfies_QMARK_(cljs.core.IMap,x))){
|
2018-08-31 17:05:18 +02:00
|
|
|
return cljs.core.cst$kw$map;
|
|
|
|
|
} else {
|
2018-11-08 09:47:44 +01:00
|
|
|
if((((!((x == null))))?(((((x.cljs$lang$protocol_mask$partition0$ & (4096))) || ((cljs.core.PROTOCOL_SENTINEL === x.cljs$core$ISet$))))?true:(((!x.cljs$lang$protocol_mask$partition0$))?cljs.core.native_satisfies_QMARK_(cljs.core.ISet,x):false)):cljs.core.native_satisfies_QMARK_(cljs.core.ISet,x))){
|
2018-08-31 17:05:18 +02:00
|
|
|
return cljs.core.cst$kw$set;
|
|
|
|
|
} else {
|
2018-11-08 09:47:44 +01:00
|
|
|
if((((!((x == null))))?(((((x.cljs$lang$protocol_mask$partition0$ & (16777216))) || ((cljs.core.PROTOCOL_SENTINEL === x.cljs$core$ISequential$))))?true:(((!x.cljs$lang$protocol_mask$partition0$))?cljs.core.native_satisfies_QMARK_(cljs.core.ISequential,x):false)):cljs.core.native_satisfies_QMARK_(cljs.core.ISequential,x))){
|
2018-08-31 17:05:18 +02:00
|
|
|
return cljs.core.cst$kw$sequential;
|
|
|
|
|
} else {
|
|
|
|
|
return cljs.core.cst$kw$atom;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4765_4789,G__4766_4790))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4765_4789,G__4766_4790,G__4767_4791);
|
2018-08-31 17:05:18 +02:00
|
|
|
goog.object.set(clojure.data.Diff,"null",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4792_4816 = clojure.data.diff_similar;
|
|
|
|
|
var G__4793_4817 = "null";
|
|
|
|
|
var G__4794_4818 = ((function (G__4792_4816,G__4793_4817){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (a,b){
|
|
|
|
|
return clojure.data.atom_diff(a,b);
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4792_4816,G__4793_4817))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4792_4816,G__4793_4817,G__4794_4818);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.Diff,"string",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4795_4819 = clojure.data.diff_similar;
|
|
|
|
|
var G__4796_4820 = "string";
|
|
|
|
|
var G__4797_4821 = ((function (G__4795_4819,G__4796_4820){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (a,b){
|
|
|
|
|
return clojure.data.atom_diff(a,b);
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4795_4819,G__4796_4820))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4795_4819,G__4796_4820,G__4797_4821);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.Diff,"number",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4798_4822 = clojure.data.diff_similar;
|
|
|
|
|
var G__4799_4823 = "number";
|
|
|
|
|
var G__4800_4824 = ((function (G__4798_4822,G__4799_4823){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (a,b){
|
|
|
|
|
return clojure.data.atom_diff(a,b);
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4798_4822,G__4799_4823))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4798_4822,G__4799_4823,G__4800_4824);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.Diff,"array",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4801_4825 = clojure.data.diff_similar;
|
|
|
|
|
var G__4802_4826 = "array";
|
|
|
|
|
var G__4803_4827 = ((function (G__4801_4825,G__4802_4826){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (a,b){
|
|
|
|
|
return clojure.data.diff_sequential(a,b);
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4801_4825,G__4802_4826))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4801_4825,G__4802_4826,G__4803_4827);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.Diff,"function",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4804_4828 = clojure.data.diff_similar;
|
|
|
|
|
var G__4805_4829 = "function";
|
|
|
|
|
var G__4806_4830 = ((function (G__4804_4828,G__4805_4829){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (a,b){
|
|
|
|
|
return clojure.data.atom_diff(a,b);
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4804_4828,G__4805_4829))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4804_4828,G__4805_4829,G__4806_4830);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.Diff,"boolean",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4807_4831 = clojure.data.diff_similar;
|
|
|
|
|
var G__4808_4832 = "boolean";
|
|
|
|
|
var G__4809_4833 = ((function (G__4807_4831,G__4808_4832){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (a,b){
|
|
|
|
|
return clojure.data.atom_diff(a,b);
|
2018-11-08 09:47:44 +01:00
|
|
|
});})(G__4807_4831,G__4808_4832))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4807_4831,G__4808_4832,G__4809_4833);
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
goog.object.set(clojure.data.Diff,"_",true);
|
|
|
|
|
|
2018-11-08 09:47:44 +01:00
|
|
|
var G__4810_4834 = clojure.data.diff_similar;
|
|
|
|
|
var G__4811_4835 = "_";
|
|
|
|
|
var G__4812_4836 = ((function (G__4810_4834,G__4811_4835){
|
2018-08-31 17:05:18 +02:00
|
|
|
return (function (a,b){
|
2018-11-08 09:47:44 +01:00
|
|
|
var fexpr__4814 = (function (){var G__4815 = clojure.data.equality_partition(a);
|
|
|
|
|
var G__4815__$1 = (((G__4815 instanceof cljs.core.Keyword))?G__4815.fqn:null);
|
|
|
|
|
switch (G__4815__$1) {
|
2018-08-31 17:05:18 +02:00
|
|
|
case "atom":
|
|
|
|
|
return clojure.data.atom_diff;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case "set":
|
|
|
|
|
return clojure.data.diff_set;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case "sequential":
|
|
|
|
|
return clojure.data.diff_sequential;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case "map":
|
|
|
|
|
return clojure.data.diff_associative;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2018-11-08 09:47:44 +01:00
|
|
|
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__4815__$1)].join('')));
|
2018-08-31 17:05:18 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})();
|
2018-11-08 09:47:44 +01:00
|
|
|
return (fexpr__4814.cljs$core$IFn$_invoke$arity$2 ? fexpr__4814.cljs$core$IFn$_invoke$arity$2(a,b) : fexpr__4814.call(null,a,b));
|
|
|
|
|
});})(G__4810_4834,G__4811_4835))
|
2018-08-31 17:05:18 +02:00
|
|
|
;
|
2018-11-08 09:47:44 +01:00
|
|
|
goog.object.set(G__4810_4834,G__4811_4835,G__4812_4836);
|
2018-08-31 17:05:18 +02:00
|
|
|
/**
|
|
|
|
|
* Recursively compares a and b, returning a tuple of
|
|
|
|
|
* [things-only-in-a things-only-in-b things-in-both].
|
|
|
|
|
* Comparison rules:
|
|
|
|
|
*
|
|
|
|
|
* * For equal a and b, return [nil nil a].
|
|
|
|
|
* * Maps are subdiffed where keys match and values differ.
|
|
|
|
|
* * Sets are never subdiffed.
|
|
|
|
|
* * All sequential things are treated as associative collections
|
|
|
|
|
* by their indexes, with results returned as vectors.
|
|
|
|
|
* * Everything else (including strings!) is treated as
|
|
|
|
|
* an atom and compared for equality.
|
|
|
|
|
*/
|
|
|
|
|
clojure.data.diff = (function clojure$data$diff(a,b){
|
|
|
|
|
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(a,b)){
|
|
|
|
|
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null,a], null);
|
|
|
|
|
} else {
|
|
|
|
|
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(clojure.data.equality_partition(a),clojure.data.equality_partition(b))){
|
|
|
|
|
return clojure.data.diff_similar(a,b);
|
|
|
|
|
} else {
|
|
|
|
|
return clojure.data.atom_diff(a,b);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|