mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-05 11:21:58 -05:00
Babelify within noms js module
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
pushd ../../js
|
||||
npm run build
|
||||
./link.sh
|
||||
popd
|
||||
npm link noms
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
pushd ../../../js
|
||||
npm run build
|
||||
./link.sh
|
||||
popd
|
||||
npm link noms
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
node_modules
|
||||
dist
|
||||
|
||||
+8
-1
@@ -1,7 +1,14 @@
|
||||
{
|
||||
"name": "noms",
|
||||
"main": "noms.js",
|
||||
"main": "dist/noms.js",
|
||||
"dependencies": {
|
||||
"immutable": "^3.7.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel": "^5.6.23"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "babel -w src/ -d dist/",
|
||||
"build": "babel src/ -d dist/"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ var Immutable = require('immutable');
|
||||
var refMapping = new WeakMap();
|
||||
|
||||
function decodeMap(input, ref, getChunk) {
|
||||
return Promise.all(input.map(function(value) {
|
||||
return Promise.all(input.map((value) => {
|
||||
return decodeValue(value, ref, getChunk);
|
||||
})).then(function(values) {
|
||||
})).then((values) => {
|
||||
var pairs = [];
|
||||
for (var i = 0; i < input.length; i += 2) {
|
||||
pairs.push([values[i], values[i+1]]);
|
||||
@@ -19,9 +19,9 @@ function decodeMap(input, ref, getChunk) {
|
||||
}
|
||||
|
||||
function decodeList(input, ref, getChunk) {
|
||||
return Promise.all(input.map(function(value) {
|
||||
return Promise.all(input.map((value) => {
|
||||
return decodeValue(value, ref, getChunk);
|
||||
})).then(function(values) {
|
||||
})).then((values) => {
|
||||
var value = Immutable.List(values);
|
||||
refMapping.set(value, ref);
|
||||
return value;
|
||||
@@ -29,9 +29,9 @@ function decodeList(input, ref, getChunk) {
|
||||
}
|
||||
|
||||
function decodeSet(input, ref, getChunk) {
|
||||
return Promise.all(input.map(function(value) {
|
||||
return Promise.all(input.map((value) => {
|
||||
return decodeValue(value, ref, getChunk);
|
||||
})).then(function(values) {
|
||||
})).then((values) => {
|
||||
var value = Immutable.Set(values);
|
||||
refMapping.set(value, ref);
|
||||
return value;
|
||||
@@ -93,7 +93,7 @@ function decodeValue(value, ref, getChunk) {
|
||||
}
|
||||
|
||||
function readValue(ref, getChunk) {
|
||||
return getChunk(ref).then(function(data) {
|
||||
return getChunk(ref).then((data) => {
|
||||
switch(data[0]) {
|
||||
case 'j':
|
||||
var json = JSON.parse(data.substring(2))
|
||||
Reference in New Issue
Block a user