Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tidyjs/tidy

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tidyjs/tidy - npm Package Compare versions

Comparing version 2.5.1 to 2.5.2

2

dist/es/helpers/assignGroupKeys.js
function assignGroupKeys(d, keys) {
if (d == null || typeof d !== "object" || Array.isArray(d))
return d;
const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function"));
const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function" && key[0] != null));
return Object.assign(keysObj, d);

@@ -6,0 +6,0 @@ }

@@ -8,3 +8,3 @@ 'use strict';

return d;
const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function"));
const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function" && key[0] != null));
return Object.assign(keysObj, d);

@@ -11,0 +11,0 @@ }

@@ -271,3 +271,3 @@ (function (global, factory) {

return d;
const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function"));
const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function" && key[0] != null));
return Object.assign(keysObj, d);

@@ -274,0 +274,0 @@ }

@@ -1,2 +0,2 @@

(function(f,h){typeof exports=="object"&&typeof module!="undefined"?h(exports,require("d3-array")):typeof define=="function"&&define.amd?define(["exports","d3-array"],h):(f=typeof globalThis!="undefined"?globalThis:f||self,h(f.Tidy={},f.d3))})(this,function(f,h){"use strict";function I(n,...t){if(typeof n=="function")throw new Error("You must supply the data as the first argument to tidy()");let e=n;for(const u of t)u&&(e=u(e));return e}function ln(n){return e=>e.filter(n)}function sn(n,t){return u=>{if(typeof n=="function"){if(!n(u))return u}else if(!n)return u;return I(u,...t)}}function fn(n){return e=>e.map(n)}function j(n){return n==null?[]:Array.isArray(n)?n:[n]}function an(n){return e=>{if(n=j(n),!n.length){const o=new Set;for(const l of e)o.add(l);return Array.from(o)}const u=new Map,r=[],c=n[n.length-1];for(const o of e){let l=u,s=!1;for(const i of n){const a=typeof i=="function"?i(o):o[i];if(i===c){s=l.has(a),s||(r.push(o),l.set(a,!0));break}l.has(a)||l.set(a,new Map),l=l.get(a)}}return r}}function k(n){return e=>{const u=j(n).map(r=>typeof r=="function"?r.length===1?C(r):r:C(r));return e.slice().sort((r,c)=>{for(const o of u){const l=o(r,c);if(l)return l}return 0})}}function C(n){const t=typeof n=="function"?n:e=>e[n];return function(u,r){return P(t(u),t(r),!1)}}function L(n){const t=typeof n=="function"?n:e=>e[n];return function(u,r){return P(t(u),t(r),!0)}}function mn(n,t,e){let{position:u="start"}=e!=null?e:{};const r=u==="end"?-1:1,c=new Map;for(let l=0;l<t.length;++l)c.set(t[l],l);const o=typeof n=="function"?n:l=>l[n];return function(s,i){var a,m;const d=(a=c.get(o(s)))!=null?a:-1,y=(m=c.get(o(i)))!=null?m:-1;return d>=0&&y>=0?d-y:d>=0?r*-1:y>=0?r*1:0}}function P(n,t,e){let u=e?t:n,r=e?n:t;if(z(u)&&z(r)){const l=(u!==u?0:u===null?1:2)-(r!==r?0:r===null?1:2);return e?-l:l}return z(u)?e?-1:1:z(r)?e?1:-1:h.ascending(u,r)}function z(n){return n==null||n!==n}function W(n,t){return u=>{t=t!=null?t:{};const r={},c=Object.keys(n);for(const o of c)r[o]=n[o](u);if(t.rest&&u.length){const o=Object.keys(u[0]);for(const l of o)c.includes(l)||(r[l]=t.rest(l)(u))}return[r]}}function R(n,t,e,u){if(!n.length)return[];const r={};let c;if(u==null)c=Object.keys(n[0]);else{c=[];for(const o of j(u))typeof o=="function"?c.push(...o(n)):c.push(o)}for(const o of c){if(e){const l=n.map(s=>s[o]);if(!e(l))continue}r[o]=t(o)(n)}return[r]}function Y(n){return e=>R(e,n)}function J(n,t){return u=>R(u,t,n)}function Z(n,t){return u=>R(u,t,void 0,n)}function M(n){return e=>{const u=e.map(c=>({...c}));let r=0;for(const c of u){for(const o in n){const l=n[o],s=typeof l=="function"?l(c,r,u):l;c[o]=s}++r}return u}}function dn(n,t){return u=>{const r=W(n)(u),c=M(t)(r);return[...u,...c]}}function yn(n,t){return u=>{const r=Y(n)(u),c=M(t)(r);return[...u,...c]}}function pn(n,t,e){return r=>{const c=J(n,t)(r),o=M(e)(c);return[...r,...o]}}function hn(n,t,e){return r=>{const c=Z(n,t)(r),o=M(e)(c);return[...r,...o]}}function $(n,t){if(n==null||typeof n!="object"||Array.isArray(n))return n;const e=Object.fromEntries(t.filter(u=>typeof u[0]!="function"));return Object.assign(e,n)}function E(n,t,e,u,r,c=0){for(const[o,l]of n.entries()){const s=[...e,o];if(l instanceof Map){const i=u(t,s,c);E(l,i,s,u,r,c+1)}else r(t,s,l,c)}return t}function gn(n,t,e=u=>u[u.length-1]){function u(o,l){const s=new Map;return o.set(e(l),s),s}function r(o,l,s){o.set(e(l),t(s,l))}const c=new Map;return E(n,c,[],u,r),c}const K=n=>n;function _n(n){const t=typeof n;return n!=null&&(t==="object"||t==="function")}function v(n,t,e){return typeof t=="function"?t=[t]:arguments.length===2&&t!=null&&!Array.isArray(t)&&(e=t),r=>{const c=bn(r,n),o=vn(c,t,e==null?void 0:e.addGroupKeys);if(e==null?void 0:e.export)switch(e.export){case"grouped":return o;case"levels":return T(o,e);case"entries-obj":case"entriesObject":return T(o,{...e,export:"levels",levels:["entries-object"]});default:return T(o,{...e,export:"levels",levels:[e.export]})}return jn(o,e==null?void 0:e.addGroupKeys)}}v.grouped=n=>({...n,export:"grouped"}),v.entries=n=>({...n,export:"entries"}),v.entriesObject=n=>({...n,export:"entries-object"}),v.object=n=>({...n,export:"object"}),v.map=n=>({...n,export:"map"}),v.keys=n=>({...n,export:"keys"}),v.values=n=>({...n,export:"values"}),v.levels=n=>({...n,export:"levels"});function vn(n,t,e){let u=n;if(!(t==null?void 0:t.length))return u;for(const r of t)!r||(u=gn(u,(c,o)=>{let s=r(c,{groupKeys:o});return e!==!1&&(s=s.map(i=>$(i,o))),s}));return u}function bn(n,t){const e=j(t).map((r,c)=>{const o=typeof r=="function"?r:s=>s[r],l=new Map;return s=>{const i=o(s),a=_n(i)?i.valueOf():i;if(l.has(a))return l.get(a);const m=[r,i];return l.set(a,m),m}});return h.group(n,...e)}function jn(n,t){const e=[];return E(n,e,[],K,(u,r,c)=>{let o=c;t!==!1&&(o=c.map(l=>$(l,r))),u.push(...o)}),e}const Sn=n=>n.join("/");function kn(n){var t;const{flat:e,single:u,mapLeaf:r=K,mapLeaves:c=K,addGroupKeys:o}=n;let l;return n.flat&&(l=(t=n.compositeKey)!=null?t:Sn),{groupFn:(a,m)=>u?r(o===!1?a[0]:$(a[0],m)):c(a.map(d=>r(o===!1?d:$(d,m)))),keyFn:e?a=>l(a.map(m=>m[1])):a=>a[a.length-1][1]}}function T(n,t){const{groupFn:e,keyFn:u}=kn(t);let{mapEntry:r=K}=t;const{levels:c=["entries"]}=t,o=[];for(const a of c)switch(a){case"entries":case"entries-object":case"entries-obj":case"entriesObject":{const m=(a==="entries-object"||a==="entries-obj"||a==="entriesObject")&&t.mapEntry==null?([d,y])=>({key:d,values:y}):r;o.push({id:"entries",createEmptySubgroup:()=>[],addSubgroup:(d,y,g,b)=>{d.push(m([g,y],b))},addLeaf:(d,y,g,b)=>{d.push(m([y,g],b))}});break}case"map":o.push({id:"map",createEmptySubgroup:()=>new Map,addSubgroup:(m,d,y)=>{m.set(y,d)},addLeaf:(m,d,y)=>{m.set(d,y)}});break;case"object":o.push({id:"object",createEmptySubgroup:()=>({}),addSubgroup:(m,d,y)=>{m[y]=d},addLeaf:(m,d,y)=>{m[d]=y}});break;case"keys":o.push({id:"keys",createEmptySubgroup:()=>[],addSubgroup:(m,d,y)=>{m.push([y,d])},addLeaf:(m,d)=>{m.push(d)}});break;case"values":o.push({id:"values",createEmptySubgroup:()=>[],addSubgroup:(m,d)=>{m.push(d)},addLeaf:(m,d,y)=>{m.push(y)}});break;default:typeof a=="object"&&o.push(a)}const l=(a,m,d)=>{var y,g;if(t.flat)return a;const b=(y=o[d])!=null?y:o[o.length-1],A=((g=o[d+1])!=null?g:b).createEmptySubgroup();return b.addSubgroup(a,A,u(m),d),A},s=(a,m,d,y)=>{var g;((g=o[y])!=null?g:o[o.length-1]).addLeaf(a,u(m),e(d,m),y)},i=o[0].createEmptySubgroup();return E(n,i,[],l,s)}function Q(n){if(n==null?void 0:n.predicate){const t=n.predicate;return e=>e.reduce((u,r,c)=>t(r,c,e)?u+1:u,0)}return t=>t.length}function X(n,t){let e=typeof n=="function"?n:u=>u[n];if(t==null?void 0:t.predicate){const u=e,r=t.predicate;e=(c,o,l)=>r(c,o,l)?u(c,o,l):0}return u=>h.fsum(u,e)}function x(n){return e=>{const{name:u="n",wt:r}=n!=null?n:{};return W({[u]:r==null?Q():X(r)})(e)}}function Mn(n,t){return u=>{t=t!=null?t:{};const{name:r="n",sort:c}=t;return I(u,v(n,[x(t)]),c?k(L(r)):K)}}function wn(n){return e=>e.map(u=>{var r;const c={},o=Object.keys(u);for(const l of o){const s=(r=n[l])!=null?r:l;c[s]=u[l]}return c})}function V(n,t){return u=>u.slice(n,t)}const Fn=n=>V(0,n),On=n=>V(-n);function Kn(n,t){return u=>k(t)(u).slice(0,n)}function An(n,t){return u=>typeof t=="function"?k(t)(u).slice(-n).reverse():k(L(t))(u).slice(0,n)}function In(n,t){t=t!=null?t:{};const{replace:e}=t;return r=>{if(!r.length)return r.slice();if(e){const c=[];for(let o=0;o<n;++o)c.push(r[Math.floor(Math.random()*r.length)]);return c}return h.shuffle(r.slice()).slice(0,n)}}function U(n,t){if(n.length===0||t.length===0)return{};const e=Object.keys(n[0]),u=Object.keys(t[0]),r={};for(const c of e)u.includes(c)&&(r[c]=c);return r}function N(n){if(Array.isArray(n)){const t={};for(const e of n)t[e]=e;return t}else if(typeof n=="object")return n;return{[n]:n}}function B(n,t,e){for(const u in e){const r=e[u];if(n[r]!==t[u])return!1}return!0}function zn(n,t){return u=>{const r=(t==null?void 0:t.by)==null?U(u,n):N(t.by);return u.flatMap(o=>n.filter(s=>B(o,s,r)).map(s=>({...o,...s})))}}function nn(n,t){return u=>{if(!n.length)return u;const r=(t==null?void 0:t.by)==null?U(u,n):N(t.by),c=Object.keys(n[0]);return u.flatMap(l=>{const s=n.filter(a=>B(l,a,r));if(s.length)return s.map(a=>({...l,...a}));const i=Object.fromEntries(c.filter(a=>l[a]==null).map(a=>[a,void 0]));return{...l,...i}})}}function $n(n,t){return u=>{if(!n.length)return u;if(!u.length)return n;const r=(t==null?void 0:t.by)==null?U(u,n):N(t.by),c=new Map,o=Object.keys(n[0]),l=u.flatMap(s=>{const i=n.filter(m=>{const d=B(s,m,r);return d&&c.set(m,!0),d});if(i.length)return i.map(m=>({...s,...m}));const a=Object.fromEntries(o.filter(m=>s[m]==null).map(m=>[m,void 0]));return{...s,...a}});if(c.size<n.length){const s=Object.fromEntries(Object.keys(u[0]).map(i=>[i,void 0]));for(const i of n)c.has(i)||l.push({...s,...i})}return l}}function En(n){return e=>{const u=e.map(r=>({...r}));for(const r in n){const c=n[r],o=typeof c=="function"?c(u):c,l=(o==null?void 0:o[Symbol.iterator])&&typeof o!="string"?o:e.map(()=>o);let s=-1;for(const i of u)i[r]=l[++s]}return u}}function w(n){return n.length<1?[]:Object.keys(n[0])}function tn(){return n=>w(n)}function en(n,t){let e=[];for(const c of j(t))typeof c=="function"?e.push(...c(n)):e.push(c);e.length&&e[0][0]==="-"&&(e=[...tn()(n),...e]);const u={},r=[];for(let c=e.length-1;c>=0;c--){const o=e[c];if(o[0]==="-"){u[o.substring(1)]=!0;continue}if(u[o]){u[o]=!1;continue}r.unshift(o)}return e=Array.from(new Set(r)),e}function G(n){return e=>{let u=en(e,n);return u.length?e.map(r=>{const c={};for(const o of u)c[o]=r[o];return c}):e}}function Dn(n){return e=>{const u=M(n)(e);return G(Object.keys(n))(u)}}function un(n){return e=>typeof n=="function"?[...e,...j(n(e))]:[...e,...j(n)]}function qn(n){return e=>{const{namesFrom:u,valuesFrom:r,valuesFill:c,valuesFillMap:o,namesSep:l="_"}=n,s=Array.isArray(u)?u:[u],i=Array.isArray(r)?r:[r],a=[];if(!e.length)return a;const m=Object.keys(e[0]).filter(p=>!s.includes(p)&&!i.includes(p)),d={};for(const p of e)for(const _ of s)d[_]==null&&(d[_]={}),d[_][p[_]]=!0;const y=[];for(const p in d)y.push(Object.keys(d[p]));const g={},b=Cn(l,y);for(const p of b){if(i.length===1){g[p]=o!=null?o[i[0]]:c;continue}for(const _ of i)g[`${_}${l}${p}`]=o!=null?o[_]:c}function F(p){if(!p.length)return[];const _={...g};for(const S of m)_[S]=p[0][S];for(const S of p){const q=s.map(O=>S[O]).join(l);if(i.length===1){_[q]=S[i[0]];continue}for(const O of i)_[`${O}${l}${q}`]=S[O]}return[_]}return m.length?I(e,v(m,[F])):F(e)}}function Cn(n="_",t){function e(r,c,o){if(!o.length&&c!=null){r.push(c);return}const l=o[0],s=o.slice(1);for(const i of l)e(r,c==null?i:`${c}${n}${i}`,s)}const u=[];return e(u,null,t),u}function Ln(n){return e=>{var u;const{namesTo:r,valuesTo:c,namesSep:o="_"}=n,l=(u=n.cols)!=null?u:[],s=en(e,l),i=Array.isArray(r)?r:[r],a=Array.isArray(c)?c:[c],m=i.length>1,d=a.length>1,y=[];for(const g of e){const b=Object.keys(g).filter(p=>!s.includes(p)),F={};for(const p of b)F[p]=g[p];const A=d?Array.from(new Set(s.map(p=>p.substring(p.indexOf(o)+1)))):s;for(const p of A){const _={...F};for(const S of a){const q=d?`${S}${o}${p}`:p,O=m?p.split(o):[p];let vt=0;for(const bt of i){const jt=O[vt++];_[bt]=jt,_[S]=g[q]}}y.push(_)}}return y}}function rn(n){return e=>{const u=Rn(n),r=[];for(const c in u){const o=u[c];let l;typeof o=="function"?l=o(e):Array.isArray(o)?l=o:l=Array.from(new Set(e.map(s=>s[c]))),r.push(l.map(s=>({[c]:s})))}return Wn(r)}}function Wn(n){function t(u,r,c){if(!c.length&&r!=null){u.push(r);return}const o=c[0],l=c.slice(1);for(const s of o)t(u,{...r,...s},l)}const e=[];return t(e,null,n),e}function Rn(n){if(Array.isArray(n)){const t={};for(const e of n)t[e]=e;return t}else if(typeof n=="object")return n;return{[n]:n}}function on(n,t=1){let[e,u]=h.extent(n);const r=[];let c=e;for(;c<=u;)r.push(c),c+=t;return r}function H(n,t="day",e=1){let[u,r]=h.extent(n);const c=[];let o=new Date(u);for(;o<=r;)if(c.push(new Date(o)),t==="second"||t==="s"||t==="seconds")o.setUTCSeconds(o.getUTCSeconds()+1*e);else if(t==="minute"||t==="min"||t==="minutes")o.setUTCMinutes(o.getUTCMinutes()+1*e);else if(t==="day"||t==="d"||t==="days")o.setUTCDate(o.getUTCDate()+1*e);else if(t==="week"||t==="w"||t==="weeks")o.setUTCDate(o.getUTCDate()+7*e);else if(t==="month"||t==="m"||t==="months")o.setUTCMonth(o.getUTCMonth()+1*e);else if(t==="year"||t==="y"||t==="years")o.setUTCFullYear(o.getUTCFullYear()+1*e);else throw new Error("Invalid granularity for date sequence: "+t);return c}function Tn(n,t){return function(u){t=t!=null?t:1;const r=typeof n=="function"?n:c=>c[n];return on(u.map(r),t)}}function Vn(n,t,e){return function(r){t=t!=null?t:"day",e=e!=null?e:1;const c=typeof n=="function"?n:o=>o[n];return H(r.map(c),t,e)}}function Un(n,t,e){return function(r){t=t!=null?t:"day",e=e!=null?e:1;const c=typeof n=="function"?n:o=>o[n];return H(r.map(o=>new Date(c(o))),t,e).map(o=>o.toISOString())}}function cn(n){return e=>{const u=[];for(const r of e){const c={...r};for(const o in n)c[o]==null&&(c[o]=n[o]);u.push(c)}return u}}function Nn(n,t){return u=>{const r=rn(n)(u),c=nn(u)(r);return t?cn(t)(c):c}}function Bn(n){return e=>{const u=j(n),r={};return e.map(c=>{const o={...c};for(const l of u)o[l]!=null?r[l]=o[l]:r[l]!=null&&(o[l]=r[l]);return o})}}function Gn(n,t){return(u,r)=>{var c;let o="[tidy.debug";if((c=r==null?void 0:r.groupKeys)==null?void 0:c.length){const y=r.groupKeys.map(g=>g.join(": ")).join(", ");y.length&&(o+="|"+y)}t=t!=null?t:{};const{limit:l=10,output:s="table"}=t,i="--------------------------------------------------------------------------------";let a=i.length;const m=o+"]"+(n==null?"":" "+n);return a=Math.max(0,a-(m.length+2)),console.log(`${m} ${i.substring(0,a)}`),console[s](l==null||l>=u.length?u:u.slice(0,l)),u}}function D(n,t,e){return n==null||t==null?void 0:t===0&&n===0?0:!e&&t===0?void 0:n/t}function Hn(n,t,e){return n==null||t==null?e?(n!=null?n:0)-(t!=null?t:0):void 0:n-t}function Pn(n,t,e){return n==null||t==null?e?(n!=null?n:0)+(t!=null?t:0):void 0:n+t}var Yn=Object.freeze({__proto__:null,rate:D,subtract:Hn,add:Pn});function Jn(n,t,e){const u=typeof n=="function"?n:l=>l[n],r=typeof t=="function"?t:l=>l[t],{predicate:c,allowDivideByZero:o}=e!=null?e:{};return c==null?(l,s,i)=>{const a=r(l,s,i),m=u(l,s,i);return D(m,a,o)}:(l,s,i)=>{if(!c(l,s,i))return;const a=r(l,s,i),m=u(l,s,i);return D(m,a,o)}}function Zn(n,t){let e=new h.Adder,u=0;return Float64Array.from(n,r=>e.add(+(t(r,u++,n)||0)))}function Qn(n,t){let e=0;for(let u=0;u<n.length;++u){const r=t(n[u],u,n);+r===r&&(e+=1)}return e?h.fsum(n,t)/e:void 0}function Xn(n){const t=typeof n=="function"?n:e=>e[n];return e=>Zn(e,t)}function xn(n,t,e){const{partial:u=!1,align:r="right"}=e!=null?e:{},c=Math.floor(n/2);return o=>o.map((l,s)=>{const i=r==="right"?s:r==="center"?s+c:s+n-1;if(!u&&(i-n+1<0||i>=o.length))return;const a=Math.max(0,i-n+1),m=o.slice(a,i+1);return t(m,i)})}function nt(n,t){const e=typeof n=="function"?n:c=>c[n],{n:u=1,default:r}=t!=null?t:{};return c=>c.map((o,l)=>{const s=c[l-u];return s==null?r:e(s,l,c)})}function tt(n,t){const e=typeof n=="function"?n:c=>c[n],{n:u=1,default:r}=t!=null?t:{};return c=>c.map((o,l)=>{const s=c[l+u];return s==null?r:e(s,l,c)})}function et(n){var t;const e=(t=n==null?void 0:n.startAt)!=null?t:0;return u=>u.map((r,c)=>c+e)}function ut(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.min(e,t)}function rt(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.max(e,t)}function ot(n){const t=typeof n=="function"?n:e=>e[n];return e=>Qn(e,t)}function ct(n,t){const e=typeof n=="function"?n:r=>r[n],u=typeof t=="function"?t:r=>r[t];return r=>{const c=h.fsum(r,e),o=h.fsum(r,u);return D(c,o)}}function lt(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.median(e,t)}function st(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.deviation(e,t)}function ft(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.variance(e,t)}function it(n,t={}){const e=typeof n=="function"?n:u=>u[n];return u=>{const r=new Map;let c=0,o=0;for(const l of u){const s=e(l,o++,u);if(!r.has(s)){if(!t.includeUndefined&&s===void 0||t.includeNull===!1&&s===null)continue;c+=1,r.set(s,!0)}}return c}}function at(n){const t=typeof n=="function"?n:e=>e[n];return e=>e.length?t(e[0]):void 0}function mt(n){const t=typeof n=="function"?n:e=>e[n];return e=>e.length?t(e[e.length-1]):void 0}function dt(n,t=!0){return e=>{const u=new RegExp(`^${n}`,t?"i":void 0);return w(e).filter(c=>u.test(c))}}function yt(n,t=!0){return e=>{const u=new RegExp(`${n}$`,t?"i":void 0);return w(e).filter(c=>u.test(c))}}function pt(n,t=!0){return e=>{const u=new RegExp(n,t?"i":void 0);return w(e).filter(c=>u.test(c))}}function ht(n){return t=>w(t).filter(u=>n.test(u))}function gt(n,t,e){return u=>{const r=w(u),c=[];for(let o=t[0];o<=t[1];++o){const l=e==null?o:new String("00000000"+o).slice(-e);c.push(`${n}${l}`)}return r.filter(o=>c.includes(o))}}function _t(n){return t=>{let e=new Set;for(const r of j(n))if(typeof r=="function"){const c=r(t);for(const o of c)e.add(o)}else e.add(r);return Array.from(e).map(r=>`-${r}`)}}f.TMath=Yn,f.addItems=un,f.addRows=un,f.arrange=k,f.asc=C,f.complete=Nn,f.contains=pt,f.count=Mn,f.cumsum=Xn,f.debug=Gn,f.desc=L,f.deviation=st,f.distinct=an,f.endsWith=yt,f.everything=tn,f.expand=rn,f.fill=Bn,f.filter=ln,f.first=at,f.fixedOrder=mn,f.fullJoin=$n,f.fullSeq=Tn,f.fullSeqDate=Vn,f.fullSeqDateISOString=Un,f.groupBy=v,f.innerJoin=zn,f.lag=nt,f.last=mt,f.lead=tt,f.leftJoin=nn,f.map=fn,f.matches=ht,f.max=rt,f.mean=ot,f.meanRate=ct,f.median=lt,f.min=ut,f.mutate=M,f.mutateWithSummary=En,f.n=Q,f.nDistinct=it,f.negate=_t,f.numRange=gt,f.pick=G,f.pivotLonger=Ln,f.pivotWider=qn,f.rate=Jn,f.rename=wn,f.replaceNully=cn,f.roll=xn,f.rowNumber=et,f.select=G,f.slice=V,f.sliceHead=Fn,f.sliceMax=An,f.sliceMin=Kn,f.sliceSample=In,f.sliceTail=On,f.sort=k,f.startsWith=dt,f.sum=X,f.summarize=W,f.summarizeAll=Y,f.summarizeAt=Z,f.summarizeIf=J,f.tally=x,f.tidy=I,f.total=dn,f.totalAll=yn,f.totalAt=hn,f.totalIf=pn,f.transmute=Dn,f.variance=ft,f.vectorSeq=on,f.vectorSeqDate=H,f.when=sn,Object.defineProperty(f,"__esModule",{value:!0})});
(function(f,h){typeof exports=="object"&&typeof module!="undefined"?h(exports,require("d3-array")):typeof define=="function"&&define.amd?define(["exports","d3-array"],h):(f=typeof globalThis!="undefined"?globalThis:f||self,h(f.Tidy={},f.d3))})(this,function(f,h){"use strict";function I(n,...t){if(typeof n=="function")throw new Error("You must supply the data as the first argument to tidy()");let e=n;for(const u of t)u&&(e=u(e));return e}function ln(n){return e=>e.filter(n)}function sn(n,t){return u=>{if(typeof n=="function"){if(!n(u))return u}else if(!n)return u;return I(u,...t)}}function fn(n){return e=>e.map(n)}function j(n){return n==null?[]:Array.isArray(n)?n:[n]}function an(n){return e=>{if(n=j(n),!n.length){const o=new Set;for(const l of e)o.add(l);return Array.from(o)}const u=new Map,r=[],c=n[n.length-1];for(const o of e){let l=u,s=!1;for(const i of n){const a=typeof i=="function"?i(o):o[i];if(i===c){s=l.has(a),s||(r.push(o),l.set(a,!0));break}l.has(a)||l.set(a,new Map),l=l.get(a)}}return r}}function k(n){return e=>{const u=j(n).map(r=>typeof r=="function"?r.length===1?C(r):r:C(r));return e.slice().sort((r,c)=>{for(const o of u){const l=o(r,c);if(l)return l}return 0})}}function C(n){const t=typeof n=="function"?n:e=>e[n];return function(u,r){return P(t(u),t(r),!1)}}function L(n){const t=typeof n=="function"?n:e=>e[n];return function(u,r){return P(t(u),t(r),!0)}}function mn(n,t,e){let{position:u="start"}=e!=null?e:{};const r=u==="end"?-1:1,c=new Map;for(let l=0;l<t.length;++l)c.set(t[l],l);const o=typeof n=="function"?n:l=>l[n];return function(s,i){var a,m;const d=(a=c.get(o(s)))!=null?a:-1,y=(m=c.get(o(i)))!=null?m:-1;return d>=0&&y>=0?d-y:d>=0?r*-1:y>=0?r*1:0}}function P(n,t,e){let u=e?t:n,r=e?n:t;if(z(u)&&z(r)){const l=(u!==u?0:u===null?1:2)-(r!==r?0:r===null?1:2);return e?-l:l}return z(u)?e?-1:1:z(r)?e?1:-1:h.ascending(u,r)}function z(n){return n==null||n!==n}function W(n,t){return u=>{t=t!=null?t:{};const r={},c=Object.keys(n);for(const o of c)r[o]=n[o](u);if(t.rest&&u.length){const o=Object.keys(u[0]);for(const l of o)c.includes(l)||(r[l]=t.rest(l)(u))}return[r]}}function R(n,t,e,u){if(!n.length)return[];const r={};let c;if(u==null)c=Object.keys(n[0]);else{c=[];for(const o of j(u))typeof o=="function"?c.push(...o(n)):c.push(o)}for(const o of c){if(e){const l=n.map(s=>s[o]);if(!e(l))continue}r[o]=t(o)(n)}return[r]}function Y(n){return e=>R(e,n)}function J(n,t){return u=>R(u,t,n)}function Z(n,t){return u=>R(u,t,void 0,n)}function M(n){return e=>{const u=e.map(c=>({...c}));let r=0;for(const c of u){for(const o in n){const l=n[o],s=typeof l=="function"?l(c,r,u):l;c[o]=s}++r}return u}}function dn(n,t){return u=>{const r=W(n)(u),c=M(t)(r);return[...u,...c]}}function yn(n,t){return u=>{const r=Y(n)(u),c=M(t)(r);return[...u,...c]}}function pn(n,t,e){return r=>{const c=J(n,t)(r),o=M(e)(c);return[...r,...o]}}function hn(n,t,e){return r=>{const c=Z(n,t)(r),o=M(e)(c);return[...r,...o]}}function $(n,t){if(n==null||typeof n!="object"||Array.isArray(n))return n;const e=Object.fromEntries(t.filter(u=>typeof u[0]!="function"&&u[0]!=null));return Object.assign(e,n)}function E(n,t,e,u,r,c=0){for(const[o,l]of n.entries()){const s=[...e,o];if(l instanceof Map){const i=u(t,s,c);E(l,i,s,u,r,c+1)}else r(t,s,l,c)}return t}function gn(n,t,e=u=>u[u.length-1]){function u(o,l){const s=new Map;return o.set(e(l),s),s}function r(o,l,s){o.set(e(l),t(s,l))}const c=new Map;return E(n,c,[],u,r),c}const K=n=>n;function _n(n){const t=typeof n;return n!=null&&(t==="object"||t==="function")}function v(n,t,e){return typeof t=="function"?t=[t]:arguments.length===2&&t!=null&&!Array.isArray(t)&&(e=t),r=>{const c=bn(r,n),o=vn(c,t,e==null?void 0:e.addGroupKeys);if(e==null?void 0:e.export)switch(e.export){case"grouped":return o;case"levels":return T(o,e);case"entries-obj":case"entriesObject":return T(o,{...e,export:"levels",levels:["entries-object"]});default:return T(o,{...e,export:"levels",levels:[e.export]})}return jn(o,e==null?void 0:e.addGroupKeys)}}v.grouped=n=>({...n,export:"grouped"}),v.entries=n=>({...n,export:"entries"}),v.entriesObject=n=>({...n,export:"entries-object"}),v.object=n=>({...n,export:"object"}),v.map=n=>({...n,export:"map"}),v.keys=n=>({...n,export:"keys"}),v.values=n=>({...n,export:"values"}),v.levels=n=>({...n,export:"levels"});function vn(n,t,e){let u=n;if(!(t==null?void 0:t.length))return u;for(const r of t)!r||(u=gn(u,(c,o)=>{let s=r(c,{groupKeys:o});return e!==!1&&(s=s.map(i=>$(i,o))),s}));return u}function bn(n,t){const e=j(t).map((r,c)=>{const o=typeof r=="function"?r:s=>s[r],l=new Map;return s=>{const i=o(s),a=_n(i)?i.valueOf():i;if(l.has(a))return l.get(a);const m=[r,i];return l.set(a,m),m}});return h.group(n,...e)}function jn(n,t){const e=[];return E(n,e,[],K,(u,r,c)=>{let o=c;t!==!1&&(o=c.map(l=>$(l,r))),u.push(...o)}),e}const Sn=n=>n.join("/");function kn(n){var t;const{flat:e,single:u,mapLeaf:r=K,mapLeaves:c=K,addGroupKeys:o}=n;let l;return n.flat&&(l=(t=n.compositeKey)!=null?t:Sn),{groupFn:(a,m)=>u?r(o===!1?a[0]:$(a[0],m)):c(a.map(d=>r(o===!1?d:$(d,m)))),keyFn:e?a=>l(a.map(m=>m[1])):a=>a[a.length-1][1]}}function T(n,t){const{groupFn:e,keyFn:u}=kn(t);let{mapEntry:r=K}=t;const{levels:c=["entries"]}=t,o=[];for(const a of c)switch(a){case"entries":case"entries-object":case"entries-obj":case"entriesObject":{const m=(a==="entries-object"||a==="entries-obj"||a==="entriesObject")&&t.mapEntry==null?([d,y])=>({key:d,values:y}):r;o.push({id:"entries",createEmptySubgroup:()=>[],addSubgroup:(d,y,g,b)=>{d.push(m([g,y],b))},addLeaf:(d,y,g,b)=>{d.push(m([y,g],b))}});break}case"map":o.push({id:"map",createEmptySubgroup:()=>new Map,addSubgroup:(m,d,y)=>{m.set(y,d)},addLeaf:(m,d,y)=>{m.set(d,y)}});break;case"object":o.push({id:"object",createEmptySubgroup:()=>({}),addSubgroup:(m,d,y)=>{m[y]=d},addLeaf:(m,d,y)=>{m[d]=y}});break;case"keys":o.push({id:"keys",createEmptySubgroup:()=>[],addSubgroup:(m,d,y)=>{m.push([y,d])},addLeaf:(m,d)=>{m.push(d)}});break;case"values":o.push({id:"values",createEmptySubgroup:()=>[],addSubgroup:(m,d)=>{m.push(d)},addLeaf:(m,d,y)=>{m.push(y)}});break;default:typeof a=="object"&&o.push(a)}const l=(a,m,d)=>{var y,g;if(t.flat)return a;const b=(y=o[d])!=null?y:o[o.length-1],A=((g=o[d+1])!=null?g:b).createEmptySubgroup();return b.addSubgroup(a,A,u(m),d),A},s=(a,m,d,y)=>{var g;((g=o[y])!=null?g:o[o.length-1]).addLeaf(a,u(m),e(d,m),y)},i=o[0].createEmptySubgroup();return E(n,i,[],l,s)}function Q(n){if(n==null?void 0:n.predicate){const t=n.predicate;return e=>e.reduce((u,r,c)=>t(r,c,e)?u+1:u,0)}return t=>t.length}function X(n,t){let e=typeof n=="function"?n:u=>u[n];if(t==null?void 0:t.predicate){const u=e,r=t.predicate;e=(c,o,l)=>r(c,o,l)?u(c,o,l):0}return u=>h.fsum(u,e)}function x(n){return e=>{const{name:u="n",wt:r}=n!=null?n:{};return W({[u]:r==null?Q():X(r)})(e)}}function Mn(n,t){return u=>{t=t!=null?t:{};const{name:r="n",sort:c}=t;return I(u,v(n,[x(t)]),c?k(L(r)):K)}}function wn(n){return e=>e.map(u=>{var r;const c={},o=Object.keys(u);for(const l of o){const s=(r=n[l])!=null?r:l;c[s]=u[l]}return c})}function V(n,t){return u=>u.slice(n,t)}const Fn=n=>V(0,n),On=n=>V(-n);function Kn(n,t){return u=>k(t)(u).slice(0,n)}function An(n,t){return u=>typeof t=="function"?k(t)(u).slice(-n).reverse():k(L(t))(u).slice(0,n)}function In(n,t){t=t!=null?t:{};const{replace:e}=t;return r=>{if(!r.length)return r.slice();if(e){const c=[];for(let o=0;o<n;++o)c.push(r[Math.floor(Math.random()*r.length)]);return c}return h.shuffle(r.slice()).slice(0,n)}}function U(n,t){if(n.length===0||t.length===0)return{};const e=Object.keys(n[0]),u=Object.keys(t[0]),r={};for(const c of e)u.includes(c)&&(r[c]=c);return r}function N(n){if(Array.isArray(n)){const t={};for(const e of n)t[e]=e;return t}else if(typeof n=="object")return n;return{[n]:n}}function B(n,t,e){for(const u in e){const r=e[u];if(n[r]!==t[u])return!1}return!0}function zn(n,t){return u=>{const r=(t==null?void 0:t.by)==null?U(u,n):N(t.by);return u.flatMap(o=>n.filter(s=>B(o,s,r)).map(s=>({...o,...s})))}}function nn(n,t){return u=>{if(!n.length)return u;const r=(t==null?void 0:t.by)==null?U(u,n):N(t.by),c=Object.keys(n[0]);return u.flatMap(l=>{const s=n.filter(a=>B(l,a,r));if(s.length)return s.map(a=>({...l,...a}));const i=Object.fromEntries(c.filter(a=>l[a]==null).map(a=>[a,void 0]));return{...l,...i}})}}function $n(n,t){return u=>{if(!n.length)return u;if(!u.length)return n;const r=(t==null?void 0:t.by)==null?U(u,n):N(t.by),c=new Map,o=Object.keys(n[0]),l=u.flatMap(s=>{const i=n.filter(m=>{const d=B(s,m,r);return d&&c.set(m,!0),d});if(i.length)return i.map(m=>({...s,...m}));const a=Object.fromEntries(o.filter(m=>s[m]==null).map(m=>[m,void 0]));return{...s,...a}});if(c.size<n.length){const s=Object.fromEntries(Object.keys(u[0]).map(i=>[i,void 0]));for(const i of n)c.has(i)||l.push({...s,...i})}return l}}function En(n){return e=>{const u=e.map(r=>({...r}));for(const r in n){const c=n[r],o=typeof c=="function"?c(u):c,l=(o==null?void 0:o[Symbol.iterator])&&typeof o!="string"?o:e.map(()=>o);let s=-1;for(const i of u)i[r]=l[++s]}return u}}function w(n){return n.length<1?[]:Object.keys(n[0])}function tn(){return n=>w(n)}function en(n,t){let e=[];for(const c of j(t))typeof c=="function"?e.push(...c(n)):e.push(c);e.length&&e[0][0]==="-"&&(e=[...tn()(n),...e]);const u={},r=[];for(let c=e.length-1;c>=0;c--){const o=e[c];if(o[0]==="-"){u[o.substring(1)]=!0;continue}if(u[o]){u[o]=!1;continue}r.unshift(o)}return e=Array.from(new Set(r)),e}function G(n){return e=>{let u=en(e,n);return u.length?e.map(r=>{const c={};for(const o of u)c[o]=r[o];return c}):e}}function Dn(n){return e=>{const u=M(n)(e);return G(Object.keys(n))(u)}}function un(n){return e=>typeof n=="function"?[...e,...j(n(e))]:[...e,...j(n)]}function qn(n){return e=>{const{namesFrom:u,valuesFrom:r,valuesFill:c,valuesFillMap:o,namesSep:l="_"}=n,s=Array.isArray(u)?u:[u],i=Array.isArray(r)?r:[r],a=[];if(!e.length)return a;const m=Object.keys(e[0]).filter(p=>!s.includes(p)&&!i.includes(p)),d={};for(const p of e)for(const _ of s)d[_]==null&&(d[_]={}),d[_][p[_]]=!0;const y=[];for(const p in d)y.push(Object.keys(d[p]));const g={},b=Cn(l,y);for(const p of b){if(i.length===1){g[p]=o!=null?o[i[0]]:c;continue}for(const _ of i)g[`${_}${l}${p}`]=o!=null?o[_]:c}function F(p){if(!p.length)return[];const _={...g};for(const S of m)_[S]=p[0][S];for(const S of p){const q=s.map(O=>S[O]).join(l);if(i.length===1){_[q]=S[i[0]];continue}for(const O of i)_[`${O}${l}${q}`]=S[O]}return[_]}return m.length?I(e,v(m,[F])):F(e)}}function Cn(n="_",t){function e(r,c,o){if(!o.length&&c!=null){r.push(c);return}const l=o[0],s=o.slice(1);for(const i of l)e(r,c==null?i:`${c}${n}${i}`,s)}const u=[];return e(u,null,t),u}function Ln(n){return e=>{var u;const{namesTo:r,valuesTo:c,namesSep:o="_"}=n,l=(u=n.cols)!=null?u:[],s=en(e,l),i=Array.isArray(r)?r:[r],a=Array.isArray(c)?c:[c],m=i.length>1,d=a.length>1,y=[];for(const g of e){const b=Object.keys(g).filter(p=>!s.includes(p)),F={};for(const p of b)F[p]=g[p];const A=d?Array.from(new Set(s.map(p=>p.substring(p.indexOf(o)+1)))):s;for(const p of A){const _={...F};for(const S of a){const q=d?`${S}${o}${p}`:p,O=m?p.split(o):[p];let vt=0;for(const bt of i){const jt=O[vt++];_[bt]=jt,_[S]=g[q]}}y.push(_)}}return y}}function rn(n){return e=>{const u=Rn(n),r=[];for(const c in u){const o=u[c];let l;typeof o=="function"?l=o(e):Array.isArray(o)?l=o:l=Array.from(new Set(e.map(s=>s[c]))),r.push(l.map(s=>({[c]:s})))}return Wn(r)}}function Wn(n){function t(u,r,c){if(!c.length&&r!=null){u.push(r);return}const o=c[0],l=c.slice(1);for(const s of o)t(u,{...r,...s},l)}const e=[];return t(e,null,n),e}function Rn(n){if(Array.isArray(n)){const t={};for(const e of n)t[e]=e;return t}else if(typeof n=="object")return n;return{[n]:n}}function on(n,t=1){let[e,u]=h.extent(n);const r=[];let c=e;for(;c<=u;)r.push(c),c+=t;return r}function H(n,t="day",e=1){let[u,r]=h.extent(n);const c=[];let o=new Date(u);for(;o<=r;)if(c.push(new Date(o)),t==="second"||t==="s"||t==="seconds")o.setUTCSeconds(o.getUTCSeconds()+1*e);else if(t==="minute"||t==="min"||t==="minutes")o.setUTCMinutes(o.getUTCMinutes()+1*e);else if(t==="day"||t==="d"||t==="days")o.setUTCDate(o.getUTCDate()+1*e);else if(t==="week"||t==="w"||t==="weeks")o.setUTCDate(o.getUTCDate()+7*e);else if(t==="month"||t==="m"||t==="months")o.setUTCMonth(o.getUTCMonth()+1*e);else if(t==="year"||t==="y"||t==="years")o.setUTCFullYear(o.getUTCFullYear()+1*e);else throw new Error("Invalid granularity for date sequence: "+t);return c}function Tn(n,t){return function(u){t=t!=null?t:1;const r=typeof n=="function"?n:c=>c[n];return on(u.map(r),t)}}function Vn(n,t,e){return function(r){t=t!=null?t:"day",e=e!=null?e:1;const c=typeof n=="function"?n:o=>o[n];return H(r.map(c),t,e)}}function Un(n,t,e){return function(r){t=t!=null?t:"day",e=e!=null?e:1;const c=typeof n=="function"?n:o=>o[n];return H(r.map(o=>new Date(c(o))),t,e).map(o=>o.toISOString())}}function cn(n){return e=>{const u=[];for(const r of e){const c={...r};for(const o in n)c[o]==null&&(c[o]=n[o]);u.push(c)}return u}}function Nn(n,t){return u=>{const r=rn(n)(u),c=nn(u)(r);return t?cn(t)(c):c}}function Bn(n){return e=>{const u=j(n),r={};return e.map(c=>{const o={...c};for(const l of u)o[l]!=null?r[l]=o[l]:r[l]!=null&&(o[l]=r[l]);return o})}}function Gn(n,t){return(u,r)=>{var c;let o="[tidy.debug";if((c=r==null?void 0:r.groupKeys)==null?void 0:c.length){const y=r.groupKeys.map(g=>g.join(": ")).join(", ");y.length&&(o+="|"+y)}t=t!=null?t:{};const{limit:l=10,output:s="table"}=t,i="--------------------------------------------------------------------------------";let a=i.length;const m=o+"]"+(n==null?"":" "+n);return a=Math.max(0,a-(m.length+2)),console.log(`${m} ${i.substring(0,a)}`),console[s](l==null||l>=u.length?u:u.slice(0,l)),u}}function D(n,t,e){return n==null||t==null?void 0:t===0&&n===0?0:!e&&t===0?void 0:n/t}function Hn(n,t,e){return n==null||t==null?e?(n!=null?n:0)-(t!=null?t:0):void 0:n-t}function Pn(n,t,e){return n==null||t==null?e?(n!=null?n:0)+(t!=null?t:0):void 0:n+t}var Yn=Object.freeze({__proto__:null,rate:D,subtract:Hn,add:Pn});function Jn(n,t,e){const u=typeof n=="function"?n:l=>l[n],r=typeof t=="function"?t:l=>l[t],{predicate:c,allowDivideByZero:o}=e!=null?e:{};return c==null?(l,s,i)=>{const a=r(l,s,i),m=u(l,s,i);return D(m,a,o)}:(l,s,i)=>{if(!c(l,s,i))return;const a=r(l,s,i),m=u(l,s,i);return D(m,a,o)}}function Zn(n,t){let e=new h.Adder,u=0;return Float64Array.from(n,r=>e.add(+(t(r,u++,n)||0)))}function Qn(n,t){let e=0;for(let u=0;u<n.length;++u){const r=t(n[u],u,n);+r===r&&(e+=1)}return e?h.fsum(n,t)/e:void 0}function Xn(n){const t=typeof n=="function"?n:e=>e[n];return e=>Zn(e,t)}function xn(n,t,e){const{partial:u=!1,align:r="right"}=e!=null?e:{},c=Math.floor(n/2);return o=>o.map((l,s)=>{const i=r==="right"?s:r==="center"?s+c:s+n-1;if(!u&&(i-n+1<0||i>=o.length))return;const a=Math.max(0,i-n+1),m=o.slice(a,i+1);return t(m,i)})}function nt(n,t){const e=typeof n=="function"?n:c=>c[n],{n:u=1,default:r}=t!=null?t:{};return c=>c.map((o,l)=>{const s=c[l-u];return s==null?r:e(s,l,c)})}function tt(n,t){const e=typeof n=="function"?n:c=>c[n],{n:u=1,default:r}=t!=null?t:{};return c=>c.map((o,l)=>{const s=c[l+u];return s==null?r:e(s,l,c)})}function et(n){var t;const e=(t=n==null?void 0:n.startAt)!=null?t:0;return u=>u.map((r,c)=>c+e)}function ut(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.min(e,t)}function rt(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.max(e,t)}function ot(n){const t=typeof n=="function"?n:e=>e[n];return e=>Qn(e,t)}function ct(n,t){const e=typeof n=="function"?n:r=>r[n],u=typeof t=="function"?t:r=>r[t];return r=>{const c=h.fsum(r,e),o=h.fsum(r,u);return D(c,o)}}function lt(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.median(e,t)}function st(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.deviation(e,t)}function ft(n){const t=typeof n=="function"?n:e=>e[n];return e=>h.variance(e,t)}function it(n,t={}){const e=typeof n=="function"?n:u=>u[n];return u=>{const r=new Map;let c=0,o=0;for(const l of u){const s=e(l,o++,u);if(!r.has(s)){if(!t.includeUndefined&&s===void 0||t.includeNull===!1&&s===null)continue;c+=1,r.set(s,!0)}}return c}}function at(n){const t=typeof n=="function"?n:e=>e[n];return e=>e.length?t(e[0]):void 0}function mt(n){const t=typeof n=="function"?n:e=>e[n];return e=>e.length?t(e[e.length-1]):void 0}function dt(n,t=!0){return e=>{const u=new RegExp(`^${n}`,t?"i":void 0);return w(e).filter(c=>u.test(c))}}function yt(n,t=!0){return e=>{const u=new RegExp(`${n}$`,t?"i":void 0);return w(e).filter(c=>u.test(c))}}function pt(n,t=!0){return e=>{const u=new RegExp(n,t?"i":void 0);return w(e).filter(c=>u.test(c))}}function ht(n){return t=>w(t).filter(u=>n.test(u))}function gt(n,t,e){return u=>{const r=w(u),c=[];for(let o=t[0];o<=t[1];++o){const l=e==null?o:new String("00000000"+o).slice(-e);c.push(`${n}${l}`)}return r.filter(o=>c.includes(o))}}function _t(n){return t=>{let e=new Set;for(const r of j(n))if(typeof r=="function"){const c=r(t);for(const o of c)e.add(o)}else e.add(r);return Array.from(e).map(r=>`-${r}`)}}f.TMath=Yn,f.addItems=un,f.addRows=un,f.arrange=k,f.asc=C,f.complete=Nn,f.contains=pt,f.count=Mn,f.cumsum=Xn,f.debug=Gn,f.desc=L,f.deviation=st,f.distinct=an,f.endsWith=yt,f.everything=tn,f.expand=rn,f.fill=Bn,f.filter=ln,f.first=at,f.fixedOrder=mn,f.fullJoin=$n,f.fullSeq=Tn,f.fullSeqDate=Vn,f.fullSeqDateISOString=Un,f.groupBy=v,f.innerJoin=zn,f.lag=nt,f.last=mt,f.lead=tt,f.leftJoin=nn,f.map=fn,f.matches=ht,f.max=rt,f.mean=ot,f.meanRate=ct,f.median=lt,f.min=ut,f.mutate=M,f.mutateWithSummary=En,f.n=Q,f.nDistinct=it,f.negate=_t,f.numRange=gt,f.pick=G,f.pivotLonger=Ln,f.pivotWider=qn,f.rate=Jn,f.rename=wn,f.replaceNully=cn,f.roll=xn,f.rowNumber=et,f.select=G,f.slice=V,f.sliceHead=Fn,f.sliceMax=An,f.sliceMin=Kn,f.sliceSample=In,f.sliceTail=On,f.sort=k,f.startsWith=dt,f.sum=X,f.summarize=W,f.summarizeAll=Y,f.summarizeAt=Z,f.summarizeIf=J,f.tally=x,f.tidy=I,f.total=dn,f.totalAll=yn,f.totalAt=hn,f.totalIf=pn,f.transmute=Dn,f.variance=ft,f.vectorSeq=on,f.vectorSeqDate=H,f.when=sn,Object.defineProperty(f,"__esModule",{value:!0})});
//# sourceMappingURL=tidy.min.js.map
{
"name": "@tidyjs/tidy",
"version": "2.5.1",
"version": "2.5.2",
"description": "Tidy up your data with JavaScript, inspired by dplyr and the tidyverse",

@@ -47,3 +47,3 @@ "main": "dist/lib/index.js",

},
"gitHead": "f1e427ba7a9793b2e44ecf84cbaaabc8936f566f"
"gitHead": "11b68d5d043f77c1f9f963572d4aa879b75fd58e"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc