v2.3.2 Build-in Mappers & Samples
Build-in mappers:
The v2.3.2 introduce many ready to use value mappers and additional samples.
馃殌 All contributors many thanks (@Gontrum, @Metastasis, @Siemienik) 馃帀 You've done a lot greatness job 馃
isEmpty
in #41 by @Gontrum - Thank you!
Examine if input is empty
import {isEmpty} from 'xlsx-import/lib/mappers';
isEmpty('asd'); // returns false
isEmpty(''); // returns trueisFilled
in #42 by @Gontrum - Thank you!
Examine if input is not empty
import {isFilled} from 'xlsx-import/lib/mappers';
isFilled('asd'); // returns true
isFilled(''); // returns falsejsonMapper
in #43 by @Gontrum - Thank you!
Try to parse json string into js object, if failed return null
import {jsonMapper} from 'xlsx-import/lib/mappers';
jsonMapper(''); // returns null because invalid input
jsonMapper('asd'); // returns null because invalid input
jsonMapper('"asd"'); // returns "asd"
jsonMapper('false'); // returns false,
jsonMapper('123'); // returns 123,
jsonMapper('false'); // returns false,
jsonMapper( '{"a":[1]}'); // returns { a: [ 1 ] },lowerCaseMapper
in #44 by @Metastasis - Thank you!
Changes string into lower case.
import {lowerCaseMapper} from 'xlsx-import/lib/mappers';
lowerCaseMapper('ASD'); // returns 'asd'upperCaseMapper
in #36 by @Metastasis - Thank you!
Changes string into UPPER CASE.
import {upperCaseMapper} from 'xlsx-import/lib/mappers';
upperCaseMapper('asd'); // returns 'ASD'splitMapper
in #50 by @Siemienik
Split string into array of items. May be customised by setting separator and item mapper:
(Doing customisation do not change original mapper but create new one.)
import {splitMapper} from 'xlsx-import/lib/mappers';
splitMapper('asd,jkl'); // returns ['asd', 'jkl']
splitMapper.separator(' || ')('string,1 || string,2'); // returns ['string,1', 'string,2']
splitMapper.itemMapper(upperCaseMapper)('lower1,lover2'); // returns ['LOWER1', 'LOVER2']Samples:
This version introduce two additional samples:
All off these mappers are well tested, for lots examples how it works please study unit tests
nodejs + typescript
in #45 by @Metastasis - Thank you!
Show how to use xlsx-import in an application built on Nodejs with Typescript. For more details follow this link.
ExpressJS microservice
in #47 by @Metastasis - Thank you!
Microservice written in ExpressJS . For more details follow this link.
Other changes:
- Fixed typos in readme and code: Thanks for @Metastasis for contribution #35
- Enable CI for PR: #38