-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: creates new element from a JCAMP
- Loading branch information
1 parent
2b691e7
commit 1c6089a
Showing
5 changed files
with
55 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
const Chromatogram = require('./Chromatogram'); | ||
const converter = require('jcampconverter').convert; | ||
|
||
/** | ||
* Creates a new Chromatogram element based in a JCAMP string | ||
* @param {string} jcamp - String containing the JCAMP data | ||
* @return {Chromatogram} - New class element with the given data | ||
*/ | ||
function fromJcamp(jcamp) { | ||
const data = converter(jcamp, {newGCMS: true}).gcms; | ||
return new Chromatogram(data); | ||
} | ||
|
||
module.exports = fromJcamp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters