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

brukerconverter

Package Overview
Dependencies
Maintainers
6
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brukerconverter - npm Package Compare versions

Comparing version 4.1.7-pre.1664466065 to 4.1.7-pre.1664599576

src/convertFileCollection.js

8

brukerconverter.d.ts

@@ -60,3 +60,3 @@ import { DoubleArray } from 'cheminfo-types';

name: string;
fileList: FileCollection;
fileCollection: FileCollection;
expno: number;

@@ -73,3 +73,3 @@ is2D?: boolean;

expno: number;
fileList: FileCollection;
fileCollection: FileCollection;
processedData?: ProcessedData;

@@ -82,3 +82,3 @@ is2D?: boolean;

export function groupByExperiments(
fileList: FileCollection,
fileCollection: FileCollection,
options?: GroupByExperimentsOptions,

@@ -167,4 +167,4 @@ ): Experiment[];

export function convertFileList(
fileList: FileCollection,
fileCollection: FileCollection,
options?: ConvertFileListOptions,
): Promise<SpectraData[]>;

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

*
* @param {*} fileList
* @param {*} fileCollection
* @param {object} [options={}]

@@ -592,6 +592,6 @@ * @param {object} [options.filter]

*/
async function convertFileList(fileList, options = {}) {
async function convertFileCollection(fileCollection, options = {}) {
const { filter, converter } = options;
const results = [];
const experiments = groupByExperiments(fileList, filter);
const experiments = groupByExperiments(fileCollection, filter);
for (let experiment of experiments) {

@@ -607,8 +607,8 @@ const result = await convertOneExperiment(experiment, converter);

function convertZip(zip, options) {
const fileList = filelistUtils.fileCollectionFromZip(zip);
return convertFileList(fileList, options);
const fileCollection = filelistUtils.fileCollectionFromZip(zip);
return convertFileCollection(fileCollection, options);
}
exports.convertFileList = convertFileList;
exports.convertFileCollection = convertFileCollection;
exports.convertZip = convertZip;
exports.groupByExperiments = groupByExperiments;
{
"name": "brukerconverter",
"version": "4.1.7-pre.1664466065",
"version": "4.1.7-pre.1664599576",
"description": "Parse and convert Bruker raw data",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -21,8 +21,8 @@ #brukerconverter

const { convertFileList } = require('brukerconverter');
const { fileListFromZip } = require('fileList-utils');
const { fileListFromZip } = require('fileCollection-utils');
const { getZipped } = require('bruker-data-test');
async function asyncCall(zip) {
const fileList = await fileListFromZip(zip);
const result = await convertFileList(fileList);
const fileCollection = await fileListFromZip(zip);
const result = await convertFileList(fileCollection);
console.log(result);

@@ -44,4 +44,4 @@ //...{ spectra, meta, source }

async function asyncCall(path) {
const fileList = await fileListFromPath(path);
const result = await convertFileList(fileList);
const fileCollection = await fileListFromPath(path);
const result = await convertFileList(fileCollection);
console.log(result);

@@ -48,0 +48,0 @@ //...{ spectra, meta, source }

import { getCoffee } from 'bruker-data-test';
import { toBeDeepCloseTo, toMatchCloseTo } from 'jest-matcher-deep-close-to';
import { convertFileList } from '../convertFileList.js';
import { convertFileCollection } from '../convertFileCollection.js';

@@ -9,6 +9,6 @@ expect.extend({ toBeDeepCloseTo, toMatchCloseTo });

jest.setTimeout(60000);
describe('convertFileList', () => {
describe('convertFileCollection', () => {
it('advanced example', async () => {
const fileList = await getCoffee();
const results = await convertFileList(fileList);
const fileCollection = await getCoffee();
const results = await convertFileCollection(fileCollection);
expect(results).toHaveLength(18);

@@ -15,0 +15,0 @@

import { getData } from 'bruker-data-test';
import { fileCollectionFromZip } from 'filelist-utils';
import { convertFileList } from '../convertFileList.js';
import { convertFileCollection } from '../convertFileCollection.js';

@@ -9,4 +9,4 @@ describe('Test with zip file', () => {

const zip = await getData('cyclosporin_1h.zip');
const fileList = await fileCollectionFromZip(zip);
let result = await convertFileList(fileList, {
const fileCollection = await fileCollectionFromZip(zip);
let result = await convertFileCollection(fileCollection, {
xy: true,

@@ -23,4 +23,4 @@ keepSpectra: true,

const zip = await getData('cyclosporin_hmbc.zip');
const fileList = await fileCollectionFromZip(zip);
let result = await convertFileList(fileList, {
const fileCollection = await fileCollectionFromZip(zip);
let result = await convertFileCollection(fileCollection, {
converter: {

@@ -27,0 +27,0 @@ xy: true,

import { fileCollectionFromZip } from 'filelist-utils';
import { convertFileList } from '../convertFileList';
import { convertFileCollection } from '../convertFileCollection';
export function convertZip(zip, options) {
const fileList = fileCollectionFromZip(zip);
return convertFileList(fileList, options);
const fileCollection = fileCollectionFromZip(zip);
return convertFileCollection(fileCollection, options);
}
export { convertZip } from './helpers/convertZip';
export { convertFileList } from './convertFileList';
export { convertFileCollection } from './convertFileCollection';
export { groupByExperiments } from './groupByExperiments';
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