mf-from-google-sheet
Advanced tools
Comparing version 1.1.39 to 1.1.40
{ | ||
"name": "mf-from-google-sheet", | ||
"version": "1.1.39", | ||
"version": "1.1.40", | ||
"description": "Retrieve and format molecular formula from google sheet", | ||
"main": "src/index.js", | ||
"main": "lib/index.js", | ||
"module": "src/index.js", | ||
"files": [ | ||
"src" | ||
"src", | ||
"lib" | ||
], | ||
@@ -19,11 +21,11 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/cheminfo/mass-tools/tree/master/packages/mf-from-google-sheet#readme", | ||
"homepage": "https://github.com/cheminfo/mass-tools/tree/main/packages/mf-from-google-sheet#readme", | ||
"dependencies": { | ||
"cross-fetch": "^3.1.5", | ||
"mf-generator": "^1.3.27", | ||
"mf-parser": "^1.4.7", | ||
"mf-utilities": "^1.4.1", | ||
"mf-generator": "^1.3.28", | ||
"mf-parser": "^1.4.8", | ||
"mf-utilities": "^1.4.2", | ||
"papaparse": "^5.3.2" | ||
}, | ||
"gitHead": "09dc5f380182d586410e390df190c8d27101fc3e" | ||
"gitHead": "bd2c06e05f2196c5f9c6ff011cf3ef41e1b6a0f9" | ||
} |
@@ -1,5 +0,3 @@ | ||
'use strict'; | ||
import { mfFromGoogleSheet } from '..'; | ||
let mfFromGoogleSheet = require('..'); | ||
// The original document is on: https://docs.google.com/spreadsheets/d/15Kuc5MeOhvm4oeTMvEuP1rWdRFiVWosxXhYwAmuf3Uo/edit#gid=0 | ||
@@ -17,3 +15,2 @@ test('getReferenceList with existing', async () => { | ||
test('getReferenceList with non existing document', () => { | ||
// eslint-disable-next-line jest/no-test-return-statement | ||
return expect( | ||
@@ -20,0 +17,0 @@ mfFromGoogleSheet( |
@@ -1,10 +0,8 @@ | ||
'use strict'; | ||
import { generateMFs } from 'mf-generator'; | ||
import { MF } from 'mf-parser'; | ||
import Papa from 'papaparse'; | ||
let generateMFs = require('mf-generator'); | ||
let MF = require('mf-parser/src/MF'); | ||
let Papa = require('papaparse'); | ||
import { fetchText } from './util/fetchText.js'; | ||
const fetchText = require('./util/fetchText.js'); | ||
async function mfFromGoogleSheet(url, options = {}) { | ||
export async function mfFromGoogleSheet(url, options = {}) { | ||
let { urlReferences } = options; | ||
@@ -31,3 +29,2 @@ | ||
let formulas = parsed.data; | ||
let references = {}; | ||
@@ -79,6 +76,6 @@ if (tsvReferences) { | ||
mf.filter = { | ||
ESI: formula.ESI === 'X' ? true : false, | ||
MALDI: formula.MALDI === 'X' ? true : false, | ||
positive: formula.positive === 'X' ? true : false, | ||
negative: formula.negative === 'X' ? true : false, | ||
ESI: formula.ESI === 'X', | ||
MALDI: formula.MALDI === 'X', | ||
positive: formula.positive === 'X', | ||
negative: formula.negative === 'X', | ||
}; | ||
@@ -118,3 +115,1 @@ } | ||
} | ||
module.exports = mfFromGoogleSheet; |
@@ -1,7 +0,5 @@ | ||
'use strict'; | ||
// eslint-disable-next-line no-shadow | ||
const fetch = require('cross-fetch'); | ||
import fetch from 'cross-fetch'; | ||
module.exports = async function fetchText(url) { | ||
export async function fetchText(url) { | ||
const result = await fetch(url); | ||
@@ -12,2 +10,2 @@ if (result.status !== 200) { | ||
return result.text(); | ||
}; | ||
} |
10162
7
245
2
Updatedmf-generator@^1.3.28
Updatedmf-parser@^1.4.8
Updatedmf-utilities@^1.4.2