1.1.5 • Published 7 years ago
cbm-classified v1.1.5
Classified library
Classified library
Usage
Configure the client
const client = new Classified({
baseURL: 'http://api.example.com',
timeout: 3000,
}, 'CLASSIFIED API');Get Classified
// Get classified by Id
const classified = client.getClassifiedById('CLASSIFIED_ID');
// Get classified by Reference
const classified = client.getClassifiedByReference('CLASSIFIED_REFERENCE');Helpers
Convert classified ID to Reference
const classfiedReference = classifiedIdToReference('CLASSIFIED_ID');Convert classified Reference to ID
const classfiedId = classifiedReferenceToId('CLASSIFIED_REFERENCE');Verify the classified ID
const idValid = isValidClassifiedId('CLASSIFIED_ID');Mappers / Translators
Apply the mapper or translator using static call
Mapper.firstHand(false); // Result : non
Translator.gearbox("MANUAL"); // Result : m�caniqueApply the mapper or translator using the apply method
Mapper.apply('first', true); // Result : oui
Translator.apply('gearbox', 'MANUAL'); // Result : m�canique1.1.5
7 years ago