@calcit/procs
Advanced tools
Comparing version 0.2.82 to 0.2.83
@@ -80,5 +80,6 @@ var _a; | ||
} | ||
var dict = new Map(); | ||
for (let idx = 0; idx < xs.length >> 1; idx++) { | ||
dict = dict.set(xs[idx << 1], xs[(idx << 1) + 1]); | ||
var dict = []; | ||
let halfLength = xs.length >> 1; | ||
for (let idx = 0; idx < halfLength; idx++) { | ||
dict.push([xs[idx << 1], xs[(idx << 1) + 1]]); | ||
} | ||
@@ -926,5 +927,5 @@ return new CrDataMap(initTernaryTreeMap(dict)); | ||
if (x === Object(x)) { | ||
let result = new Map(); | ||
let result = []; | ||
Object.keys(x).forEach((k) => { | ||
result.set(to_calcit_data(k, noKeyword), to_calcit_data(x[k], noKeyword)); | ||
result.push([to_calcit_data(k, noKeyword), to_calcit_data(x[k], noKeyword)]); | ||
}); | ||
@@ -1117,6 +1118,9 @@ return new CrDataMap(initTernaryTreeMap(result)); | ||
if (x[0] === "{}") { | ||
let result = new Map(); | ||
x.slice(1).forEach((pair) => { | ||
let result = []; | ||
x.forEach((pair, idx) => { | ||
if (idx == 0) { | ||
return; // skip first `{}` symbol | ||
} | ||
if (pair instanceof Array && pair.length == 2) { | ||
result.set(extract_cirru_edn(pair[0]), extract_cirru_edn(pair[1])); | ||
result.push([extract_cirru_edn(pair[0]), extract_cirru_edn(pair[1])]); | ||
} | ||
@@ -1123,0 +1127,0 @@ else { |
@@ -101,5 +101,6 @@ import { overwriteComparator, initTernaryTreeMap } from "@calcit/ternary-tree"; | ||
} | ||
var dict = new Map(); | ||
for (let idx = 0; idx < xs.length >> 1; idx++) { | ||
dict = dict.set(xs[idx << 1], xs[(idx << 1) + 1]); | ||
var dict: Array<[CrDataValue, CrDataValue]> = []; | ||
let halfLength = xs.length >> 1; | ||
for (let idx = 0; idx < halfLength; idx++) { | ||
dict.push([xs[idx << 1], xs[(idx << 1) + 1]]); | ||
} | ||
@@ -1029,5 +1030,5 @@ return new CrDataMap(initTernaryTreeMap(dict)); | ||
if (x === Object(x)) { | ||
let result: Map<CrDataValue, CrDataValue> = new Map(); | ||
let result: Array<[CrDataValue, CrDataValue]> = []; | ||
Object.keys(x).forEach((k) => { | ||
result.set(to_calcit_data(k, noKeyword), to_calcit_data(x[k], noKeyword)); | ||
result.push([to_calcit_data(k, noKeyword), to_calcit_data(x[k], noKeyword)]); | ||
}); | ||
@@ -1238,6 +1239,9 @@ return new CrDataMap(initTernaryTreeMap(result)); | ||
if (x[0] === "{}") { | ||
let result = new Map<CrDataValue, CrDataValue>(); | ||
x.slice(1).forEach((pair) => { | ||
let result: Array<[CrDataValue, CrDataValue]> = []; | ||
x.forEach((pair, idx) => { | ||
if (idx == 0) { | ||
return; // skip first `{}` symbol | ||
} | ||
if (pair instanceof Array && pair.length == 2) { | ||
result.set(extract_cirru_edn(pair[0]), extract_cirru_edn(pair[1])); | ||
result.push([extract_cirru_edn(pair[0]), extract_cirru_edn(pair[1])]); | ||
} else { | ||
@@ -1244,0 +1248,0 @@ throw new Error("Expected pairs for map"); |
{ | ||
"name": "@calcit/procs", | ||
"version": "0.2.82", | ||
"version": "0.2.83", | ||
"main": "./lib/calcit.procs.js", | ||
@@ -17,3 +17,3 @@ "devDependencies": { | ||
"dependencies": { | ||
"@calcit/ternary-tree": "0.0.11", | ||
"@calcit/ternary-tree": "0.0.12", | ||
"@cirru/parser.ts": "^0.0.1", | ||
@@ -20,0 +20,0 @@ "@cirru/writer.ts": "^0.1.2" |
101767
3757
+ Added@calcit/ternary-tree@0.0.12(transitive)
- Removed@calcit/ternary-tree@0.0.11(transitive)
Updated@calcit/ternary-tree@0.0.12