Socket
Socket
Sign inDemoInstall

@ltht-react/utils

Package Overview
Dependencies
1
Maintainers
14
Versions
295
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.272 to 2.0.1

2

lib/atoms/allergy-intolerance-category-code.js

@@ -6,5 +6,5 @@ "use strict";

if (categories === void 0) { categories = []; }
return categories.map(function (category) { return category && title_case_1.titleCase(category); }).join(', ');
return categories.map(function (category) { return category && (0, title_case_1.titleCase)(category); }).join(', ');
};
exports.default = allergyIntoleranceCategoryCodeDisplaySummary;
//# sourceMappingURL=allergy-intolerance-category-code.js.map

@@ -12,7 +12,7 @@ "use strict";

var categories = [];
expect(allergy_intolerance_category_code_1.default(categories)).toEqual('');
expect((0, allergy_intolerance_category_code_1.default)(categories)).toEqual('');
});
it('single category formats correctly', function () {
var categories = [types_1.AllergyIntoleranceCategoryCode.Biologic];
expect(allergy_intolerance_category_code_1.default(categories)).toEqual(title_case_1.titleCase(types_1.AllergyIntoleranceCategoryCode.Biologic));
expect((0, allergy_intolerance_category_code_1.default)(categories)).toEqual((0, title_case_1.titleCase)(types_1.AllergyIntoleranceCategoryCode.Biologic));
});

@@ -24,5 +24,5 @@ it('multiple categories formats correctly', function () {

];
expect(allergy_intolerance_category_code_1.default(categories)).toEqual(title_case_1.titleCase(types_1.AllergyIntoleranceCategoryCode.Biologic) + ", " + title_case_1.titleCase(types_1.AllergyIntoleranceCategoryCode.Environment));
expect((0, allergy_intolerance_category_code_1.default)(categories)).toEqual("".concat((0, title_case_1.titleCase)(types_1.AllergyIntoleranceCategoryCode.Biologic), ", ").concat((0, title_case_1.titleCase)(types_1.AllergyIntoleranceCategoryCode.Environment)));
});
});
//# sourceMappingURL=allergy-intolerance-category-code.test.js.map

@@ -8,15 +8,15 @@ "use strict";

var codeable = {};
expect(codeable_concept_1.codeableConceptDisplaySummary(codeable)).toEqual('');
expect((0, codeable_concept_1.codeableConceptDisplaySummary)(codeable)).toEqual('');
});
it('null coding, populated text display formats correctly', function () {
var codeable = { text: 'Test Text 1' };
expect(codeable_concept_1.codeableConceptDisplaySummary(codeable)).toEqual('Test Text 1');
expect((0, codeable_concept_1.codeableConceptDisplaySummary)(codeable)).toEqual('Test Text 1');
});
it('empty coding populated display formats correctly', function () {
var codeable = { coding: [], text: 'Test Text 2' };
expect(codeable_concept_1.codeableConceptDisplaySummary(codeable)).toEqual('Test Text 2');
expect((0, codeable_concept_1.codeableConceptDisplaySummary)(codeable)).toEqual('Test Text 2');
});
it('single coding with empty display, populated text display formats correctly', function () {
var codeable = { coding: [{ display: '' }], text: 'Test Text 2' };
expect(codeable_concept_1.codeableConceptDisplaySummary(codeable)).toEqual('Test Text 2');
expect((0, codeable_concept_1.codeableConceptDisplaySummary)(codeable)).toEqual('Test Text 2');
});

@@ -27,3 +27,3 @@ it('single coding display formats correctly', function () {

};
expect(codeable_concept_1.codeableConceptDisplaySummary(codeable)).toEqual('Test');
expect((0, codeable_concept_1.codeableConceptDisplaySummary)(codeable)).toEqual('Test');
});

@@ -34,3 +34,3 @@ it('multiple codings display formats correctly', function () {

};
expect(codeable_concept_1.codeableConceptDisplaySummary(codeable)).toEqual('Test, Another');
expect((0, codeable_concept_1.codeableConceptDisplaySummary)(codeable)).toEqual('Test, Another');
});

@@ -41,3 +41,3 @@ });

var codeable = {};
expect(codeable_concept_1.codeableConceptCodeSummary(codeable)).toEqual('');
expect((0, codeable_concept_1.codeableConceptCodeSummary)(codeable)).toEqual('');
});

@@ -48,3 +48,3 @@ it('single coding display formats correctly', function () {

};
expect(codeable_concept_1.codeableConceptCodeSummary(codeable)).toEqual('00000');
expect((0, codeable_concept_1.codeableConceptCodeSummary)(codeable)).toEqual('00000');
});

@@ -58,3 +58,3 @@ it('multiple codings display formats correctly', function () {

};
expect(codeable_concept_1.codeableConceptCodeSummary(codeable)).toEqual('00000, 11111');
expect((0, codeable_concept_1.codeableConceptCodeSummary)(codeable)).toEqual('00000, 11111');
});

@@ -65,7 +65,7 @@ });

var codeables = [];
expect(codeable_concept_1.codeableConceptTextSummary(codeables)).toEqual('');
expect((0, codeable_concept_1.codeableConceptTextSummary)(codeables)).toEqual('');
});
it('single codeable concept text summary formats correctly', function () {
var codeables = [{ text: 'Text 1', coding: [{ display: '', code: '00000' }] }];
expect(codeable_concept_1.codeableConceptTextSummary(codeables)).toEqual('Text 1');
expect((0, codeable_concept_1.codeableConceptTextSummary)(codeables)).toEqual('Text 1');
});

@@ -77,3 +77,3 @@ it('multiple codeable concept text summary formats correctly', function () {

];
expect(codeable_concept_1.codeableConceptTextSummary(codeables)).toEqual('Text 1, Text 2');
expect((0, codeable_concept_1.codeableConceptTextSummary)(codeables)).toEqual('Text 1, Text 2');
});

@@ -85,3 +85,3 @@ it('codeable concept text summary formats correctly when text is null but coding property display has value', function () {

];
expect(codeable_concept_1.codeableConceptTextSummary(codeables)).toEqual('Display 1, Display 2');
expect((0, codeable_concept_1.codeableConceptTextSummary)(codeables)).toEqual('Display 1, Display 2');
});

@@ -93,3 +93,3 @@ it('codeable concept text summary formats correctly when text is null for some items but correponding coding property display has value', function () {

];
expect(codeable_concept_1.codeableConceptTextSummary(codeables)).toEqual('Text 1, Display 2');
expect((0, codeable_concept_1.codeableConceptTextSummary)(codeables)).toEqual('Text 1, Display 2');
});

@@ -96,0 +96,0 @@ });

@@ -27,3 +27,3 @@ "use strict";

// act
var booleanExtension = extensions_1.getBooleanExtension(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
var booleanExtension = (0, extensions_1.getBooleanExtension)(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
// assert

@@ -41,3 +41,3 @@ expect(booleanExtension).toEqual(true);

// act
var booleanExtension = extensions_1.getBooleanExtension(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
var booleanExtension = (0, extensions_1.getBooleanExtension)(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
// assert

@@ -55,3 +55,3 @@ expect(booleanExtension).toEqual(false);

// act
var booleanExtension = extensions_1.getBooleanExtension(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
var booleanExtension = (0, extensions_1.getBooleanExtension)(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
// assert

@@ -64,3 +64,3 @@ expect(booleanExtension).toEqual(null);

// act
var booleanExtension = extensions_1.getBooleanExtension(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
var booleanExtension = (0, extensions_1.getBooleanExtension)(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
// assert

@@ -73,3 +73,3 @@ expect(booleanExtension).toEqual(null);

// act
var booleanExtension = extensions_1.getBooleanExtension(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
var booleanExtension = (0, extensions_1.getBooleanExtension)(extensions, ExtensionKey.DiagnosisOnsetDateEstimated);
// assert

@@ -89,3 +89,3 @@ expect(booleanExtension).toEqual(null);

// act
var stringExtension = extensions_1.getStringExtension(extensions, ExtensionKey.FlagPriority);
var stringExtension = (0, extensions_1.getStringExtension)(extensions, ExtensionKey.FlagPriority);
// assert

@@ -103,3 +103,3 @@ expect(stringExtension).toEqual(FlagPriority.High);

// act
var stringExtension = extensions_1.getStringExtension(extensions, ExtensionKey.FlagPriority);
var stringExtension = (0, extensions_1.getStringExtension)(extensions, ExtensionKey.FlagPriority);
// assert

@@ -117,3 +117,3 @@ expect(stringExtension).toEqual(FlagPriority.Clinical);

// act
var stringExtension = extensions_1.getStringExtension(extensions, ExtensionKey.FlagPriority);
var stringExtension = (0, extensions_1.getStringExtension)(extensions, ExtensionKey.FlagPriority);
// assert

@@ -126,3 +126,3 @@ expect(stringExtension).toEqual(null);

// act
var stringExtension = extensions_1.getStringExtension(extensions, ExtensionKey.FlagPriority);
var stringExtension = (0, extensions_1.getStringExtension)(extensions, ExtensionKey.FlagPriority);
// assert

@@ -135,3 +135,3 @@ expect(stringExtension).toEqual(null);

// act
var stringExtension = extensions_1.getStringExtension(extensions, ExtensionKey.FlagPriority);
var stringExtension = (0, extensions_1.getStringExtension)(extensions, ExtensionKey.FlagPriority);
// assert

@@ -138,0 +138,0 @@ expect(stringExtension).toEqual(null);

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -9,11 +9,11 @@ "use strict";

it('Equal value is not mobile', function () {
expect(isMobileView_1.default(768)).toEqual(false);
expect((0, isMobileView_1.default)(768)).toEqual(false);
});
it('Larger screen size not mobile', function () {
expect(isMobileView_1.default(769)).toEqual(false);
expect((0, isMobileView_1.default)(769)).toEqual(false);
});
it('Smaller screen size is mobile', function () {
expect(isMobileView_1.default(767)).toEqual(true);
expect((0, isMobileView_1.default)(767)).toEqual(true);
});
});
//# sourceMappingURL=isMobileView.test.js.map

@@ -14,3 +14,3 @@ "use strict";

};
expect(metadata_1.default(metadata)).toEqual('');
expect((0, metadata_1.default)(metadata)).toEqual('');
});

@@ -27,3 +27,3 @@ it('single dataSource formats correctly', function () {

};
expect(metadata_1.default(metadata)).toEqual('Test');
expect((0, metadata_1.default)(metadata)).toEqual('Test');
});

@@ -43,5 +43,5 @@ it('multiple dataSources formats correctly', function () {

};
expect(metadata_1.default(metadata)).toEqual('Test, Another');
expect((0, metadata_1.default)(metadata)).toEqual('Test, Another');
});
});
//# sourceMappingURL=metadata.test.js.map

@@ -6,2 +6,2 @@ import { PartialDateTime } from '@ltht-react/types';

export declare const formatDateTime: (date: Date) => string;
export declare const partialDateTimeText: (partialDateTime?: PartialDateTime | null | undefined) => string;
export declare const partialDateTimeText: (partialDateTime?: PartialDateTime | null) => string;

@@ -24,3 +24,3 @@ "use strict";

exports.formatTime = formatTime;
var formatDateTime = function (date) { return exports.formatDateExplicitMonth(date) + " : " + exports.formatTime(date); };
var formatDateTime = function (date) { return "".concat((0, exports.formatDateExplicitMonth)(date), " : ").concat((0, exports.formatTime)(date)); };
exports.formatDateTime = formatDateTime;

@@ -33,6 +33,6 @@ var partialDateTimeText = function (partialDateTime) {

case types_1.PartialDateTimeKindCode.Date:
return exports.formatDate(new Date(partialDateTime.value));
return (0, exports.formatDate)(new Date(partialDateTime.value));
case types_1.PartialDateTimeKindCode.DateTime: {
var date = new Date(partialDateTime.value);
return exports.formatDate(date) + " " + exports.formatTime(date);
return "".concat((0, exports.formatDate)(date), " ").concat((0, exports.formatTime)(date));
}

@@ -47,3 +47,3 @@ case types_1.PartialDateTimeKindCode.Year:

case types_1.PartialDateTimeKindCode.Time:
return exports.formatTime(new Date(partialDateTime.value));
return (0, exports.formatTime)(new Date(partialDateTime.value));
default:

@@ -50,0 +50,0 @@ return '';

@@ -16,23 +16,23 @@ "use strict";

var date = partialDateTime(types_1.PartialDateTimeKindCode.Time);
expect(partial_date_time_1.partialDateTimeText(date)).toEqual('13:15');
expect((0, partial_date_time_1.partialDateTimeText)(date)).toEqual('13:15');
});
it('formats year correctly', function () {
var date = partialDateTime(types_1.PartialDateTimeKindCode.Year);
expect(partial_date_time_1.partialDateTimeText(date)).toEqual('2013');
expect((0, partial_date_time_1.partialDateTimeText)(date)).toEqual('2013');
});
it('formats year-month correctly', function () {
var date = partialDateTime(types_1.PartialDateTimeKindCode.YearMonth);
expect(partial_date_time_1.partialDateTimeText(date)).toEqual('Feb-2013');
expect((0, partial_date_time_1.partialDateTimeText)(date)).toEqual('Feb-2013');
});
it('formats dateTimes correctly', function () {
var date = new Date(2022, 0, 10, 9, 47);
expect(partial_date_time_1.formatDateTime(date)).toEqual('10 January 2022 : 09:47');
expect((0, partial_date_time_1.formatDateTime)(date)).toEqual('10 January 2022 : 09:47');
});
it('formats dateTimes without seconds or milliseconds', function () {
var date = new Date(2022, 0, 10, 9, 47, 10, 10);
expect(partial_date_time_1.formatDateTime(date)).toEqual('10 January 2022 : 09:47');
expect((0, partial_date_time_1.formatDateTime)(date)).toEqual('10 January 2022 : 09:47');
});
it('formats DateTimes as midnight by default if no time is provided', function () {
var date = new Date(2022, 0, 10);
expect(partial_date_time_1.formatDateTime(date)).toEqual('10 January 2022 : 00:00');
expect((0, partial_date_time_1.formatDateTime)(date)).toEqual('10 January 2022 : 00:00');
});

@@ -39,0 +39,0 @@ });

@@ -46,9 +46,9 @@ "use strict";

if (yearAge >= 18)
return yearAge + "y";
return "".concat(yearAge, "y");
// Children over two years: **years and months**.
if (yearAge >= 2)
return yearAge + "y" + (String(monthAge) ? " " + monthAge + "m" : '');
return "".concat(yearAge, "y").concat(String(monthAge) ? " ".concat(monthAge, "m") : '');
// Children 12 to 24 months: **months and days**.
if (yearAge === 1) {
return 12 + monthAge + "m" + (String(dateAge) && dateAge > 0 ? " " + dateAge + "d" : '');
return "".concat(12 + monthAge, "m").concat(String(dateAge) && dateAge > 0 ? " ".concat(dateAge, "d") : '');
}

@@ -63,12 +63,12 @@ // Calculate age measured in simple units.

dayAge -= weekAge * 7;
return weekAge + "w" + (dayAge ? " " + dayAge + "d" : '');
return "".concat(weekAge, "w").concat(dayAge ? " ".concat(dayAge, "d") : '');
}
// Children two days to four weeks: **days**.
if (dayAge >= 2)
return dayAge + "d";
return "".concat(dayAge, "d");
// Children two to 24 hours: **hours**.
if (hourAge >= 2)
return hourAge + "hrs";
return "".concat(hourAge, "hrs");
// Children under two hours: **minutes**.
return Math.floor(age / (1000 * 60)) + "min";
return "".concat(Math.floor(age / (1000 * 60)), "min");
};

@@ -93,7 +93,7 @@ exports.formatPatientAge = formatPatientAge;

else {
patientName = (family ? family.toUpperCase() + ", " : '') + title_case_1.titleCase(given);
patientName = (family ? "".concat(family.toUpperCase(), ", ") : '') + (0, title_case_1.titleCase)(given);
}
// Add title in brackets if specified.
if (title) {
patientName += " (" + title_case_1.titleCase(title) + ")";
patientName += " (".concat((0, title_case_1.titleCase)(title), ")");
}

@@ -110,3 +110,3 @@ return patientName;

if (value.length === 10) {
return value.substring(0, 3) + " " + value.substring(3, 6) + " " + value.substring(6, 10);
return "".concat(value.substring(0, 3), " ").concat(value.substring(3, 6), " ").concat(value.substring(6, 10));
}

@@ -113,0 +113,0 @@ return value;

@@ -34,3 +34,3 @@ "use strict";

it('returns empty string when patient does not have one', function () {
expect(patient_1.formatNHSNumber(patient)).toEqual('');
expect((0, patient_1.formatNHSNumber)(patient)).toEqual('');
});

@@ -44,3 +44,3 @@ it('returns empty string when patient has an unofficial nhs number', function () {

];
expect(patient_1.formatNHSNumber(patient)).toEqual('');
expect((0, patient_1.formatNHSNumber)(patient)).toEqual('');
});

@@ -54,3 +54,3 @@ it('returns formatted nhs number when patient has a official nhs number', function () {

];
expect(patient_1.formatNHSNumber(patient)).toEqual('987 654 3210');
expect((0, patient_1.formatNHSNumber)(patient)).toEqual('987 654 3210');
});

@@ -68,3 +68,3 @@ it('returns formatted nhs number when patient has both official and unofficial nhs number', function () {

];
expect(patient_1.formatNHSNumber(patient)).toEqual('987 654 3210');
expect((0, patient_1.formatNHSNumber)(patient)).toEqual('987 654 3210');
});

@@ -78,3 +78,3 @@ it('returns non-formatted nhs number when patient has a official nhs number with greater than 10 chars', function () {

];
expect(patient_1.formatNHSNumber(patient)).toEqual('98765432109');
expect((0, patient_1.formatNHSNumber)(patient)).toEqual('98765432109');
});

@@ -88,3 +88,3 @@ it('returns non-formatted nhs number when patient has a official nhs number with less than 10 chars', function () {

];
expect(patient_1.formatNHSNumber(patient)).toEqual('98765432');
expect((0, patient_1.formatNHSNumber)(patient)).toEqual('98765432');
});

@@ -95,19 +95,19 @@ });

patient.address = null;
expect(patient_1.formatPatientAddress(patient)).toEqual('');
expect((0, patient_1.formatPatientAddress)(patient)).toEqual('');
});
it('returns empty string when Address collection is empty', function () {
patient.address = [];
expect(patient_1.formatPatientAddress(patient)).toEqual('');
expect((0, patient_1.formatPatientAddress)(patient)).toEqual('');
});
it('returns empty string when no home address is present', function () {
patient.address = [{ use: types_1.AddressUseCode.Work, text: 'some work address' }];
expect(patient_1.formatPatientAddress(patient)).toEqual('');
expect((0, patient_1.formatPatientAddress)(patient)).toEqual('');
});
it('returns empty string when no active home address is present', function () {
patient.address = [{ use: types_1.AddressUseCode.Home, text: 'old home address', period: { end: { value: '2020-02-03' } } }];
expect(patient_1.formatPatientAddress(patient)).toEqual('');
expect((0, patient_1.formatPatientAddress)(patient)).toEqual('');
});
it('returns Address when active home address is present', function () {
patient.address = [{ use: types_1.AddressUseCode.Home, text: 'home address', period: {} }];
expect(patient_1.formatPatientAddress(patient)).toEqual('home address');
expect((0, patient_1.formatPatientAddress)(patient)).toEqual('home address');
});

@@ -117,3 +117,3 @@ });

it('returns empty string when birth date is not specified', function () {
expect(patient_1.formatPatientAge(patient, false)).toEqual('');
expect((0, patient_1.formatPatientAge)(patient, false)).toEqual('');
});

@@ -128,3 +128,3 @@ it('returns formatted age when birth date is specified (over 18)', function () {

};
expect(patient_1.formatPatientAge(patient, false)).toEqual('21y');
expect((0, patient_1.formatPatientAge)(patient, false)).toEqual('21y');
});

@@ -141,3 +141,3 @@ it('returns formatted age when birth date is specified (under 18 and over 2)', function () {

};
expect(patient_1.formatPatientAge(patient, false)).toEqual("15y " + currentMonth + "m");
expect((0, patient_1.formatPatientAge)(patient, false)).toEqual("15y ".concat(currentMonth, "m"));
});

@@ -155,4 +155,4 @@ it('returns formatted age when birth date is specified (under 2 and over 1)', function () {

};
var expectedText = days === 0 ? '12m' : "12m " + days + "d";
expect(patient_1.formatPatientAge(patient, false)).toEqual(expectedText);
var expectedText = days === 0 ? '12m' : "12m ".concat(days, "d");
expect((0, patient_1.formatPatientAge)(patient, false)).toEqual(expectedText);
});

@@ -168,3 +168,3 @@ // TODO: Fix Timezone bug in this test.

};
expect(patient_1.formatPatientAge(patient, false)).toEqual('5w 1d');
expect((0, patient_1.formatPatientAge)(patient, false)).toEqual('5w 1d');
});

@@ -180,3 +180,3 @@ // TODO: Fix Timezone bug in this test.

};
expect(patient_1.formatPatientAge(patient, false)).toEqual('14d');
expect((0, patient_1.formatPatientAge)(patient, false)).toEqual('14d');
});

@@ -191,3 +191,3 @@ it('returns formatted age when birth date is specified (under 2 days and over 2 hours)', function () {

};
expect(patient_1.formatPatientAge(patient, false)).toEqual('5hrs');
expect((0, patient_1.formatPatientAge)(patient, false)).toEqual('5hrs');
});

@@ -202,3 +202,3 @@ it('returns formatted age when birth date is specified (under 2 hours)', function () {

};
expect(patient_1.formatPatientAge(patient, false)).toEqual('60min');
expect((0, patient_1.formatPatientAge)(patient, false)).toEqual('60min');
});

@@ -214,3 +214,3 @@ it('returns empty string when patient is deceased and birth date is not specified', function () {

};
expect(patient_1.formatPatientAge(patient, true)).toEqual('');
expect((0, patient_1.formatPatientAge)(patient, true)).toEqual('');
});

@@ -232,3 +232,3 @@ it('returns formatted age when patient is deceased', function () {

};
expect(patient_1.formatPatientAge(patient, true)).toEqual('45y');
expect((0, patient_1.formatPatientAge)(patient, true)).toEqual('45y');
});

@@ -251,3 +251,3 @@ it('returns formatted age when patient is deceased (under 18 and over 2)', function () {

};
expect(patient_1.formatPatientAge(patient, true)).toEqual("15y " + dod.getMonth() + "m");
expect((0, patient_1.formatPatientAge)(patient, true)).toEqual("15y ".concat(dod.getMonth(), "m"));
});

@@ -271,4 +271,4 @@ it('returns formatted age when patient is deceased (under 2 and over 1)', function () {

};
var expectedText = days === 0 ? '12m' : "12m " + days + "d";
expect(patient_1.formatPatientAge(patient, true)).toEqual(expectedText);
var expectedText = days === 0 ? '12m' : "12m ".concat(days, "d");
expect((0, patient_1.formatPatientAge)(patient, true)).toEqual(expectedText);
});

@@ -291,3 +291,3 @@ // TODO: Fix Timezone bug in this test.

};
expect(patient_1.formatPatientAge(patient, true)).toEqual('6w 2d');
expect((0, patient_1.formatPatientAge)(patient, true)).toEqual('6w 2d');
});

@@ -310,3 +310,3 @@ // TODO: Fix Timezone bug in this test.

};
expect(patient_1.formatPatientAge(patient, true)).toEqual('17d');
expect((0, patient_1.formatPatientAge)(patient, true)).toEqual('17d');
});

@@ -328,3 +328,3 @@ it('returns formatted age when patient is deceased (under 2 days and over 2 hours)', function () {

};
expect(patient_1.formatPatientAge(patient, true)).toEqual('27hrs');
expect((0, patient_1.formatPatientAge)(patient, true)).toEqual('27hrs');
});

@@ -346,3 +346,3 @@ it('returns formatted age when patient is deceased (under 2 hours)', function () {

};
expect(patient_1.formatPatientAge(patient, true)).toEqual('95min');
expect((0, patient_1.formatPatientAge)(patient, true)).toEqual('95min');
});

@@ -352,3 +352,3 @@ });

it('returns empty string when name collection is empty', function () {
expect(patient_1.formatPatientName(patient)).toEqual('');
expect((0, patient_1.formatPatientName)(patient)).toEqual('');
});

@@ -364,7 +364,7 @@ it('returns empty string when patient has no active name', function () {

});
expect(patient_1.formatPatientName(patient)).toEqual('');
expect((0, patient_1.formatPatientName)(patient)).toEqual('');
});
it('returns formatted string when patient has an active name but use not specified', function () {
patient.name.push({ family: 'test', period: null, use: null });
expect(patient_1.formatPatientName(patient)).toEqual('TEST');
expect((0, patient_1.formatPatientName)(patient)).toEqual('TEST');
});

@@ -375,7 +375,7 @@ it('returns formatted name when patient has active official & usual 7 unspecified use name', function () {

patient.name.push({ use: types_1.HumanNameUseCode.Official, family: 'test' });
expect(patient_1.formatPatientName(patient)).toEqual('TEST-OFFICIAL');
expect((0, patient_1.formatPatientName)(patient)).toEqual('TEST-OFFICIAL');
});
it('returns formatted name when patient only has active usual name', function () {
patient.name.push({ use: types_1.HumanNameUseCode.Usual, family: 'usual', given: ['test'] });
expect(patient_1.formatPatientName(patient)).toEqual('USUAL, Test');
expect((0, patient_1.formatPatientName)(patient)).toEqual('USUAL, Test');
});

@@ -389,3 +389,3 @@ it('returns formatted name when patient has active official name', function () {

});
expect(patient_1.formatPatientName(patient)).toEqual('OFFICIAL, Test Me (Mr)');
expect((0, patient_1.formatPatientName)(patient)).toEqual('OFFICIAL, Test Me (Mr)');
});

@@ -397,3 +397,3 @@ it('returns formatted name when patient has active official name', function () {

});
expect(patient_1.formatPatientName(patient)).toEqual('Test Me');
expect((0, patient_1.formatPatientName)(patient)).toEqual('Test Me');
});

@@ -404,7 +404,7 @@ });

patient.identifier = null;
expect(patient_1.nhsNumberStatus(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
expect((0, patient_1.nhsNumberStatus)(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
});
it('returns Unknown status when identifier is empty', function () {
patient.identifier = [];
expect(patient_1.nhsNumberStatus(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
expect((0, patient_1.nhsNumberStatus)(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
});

@@ -418,3 +418,3 @@ it('returns Unknown status when identifier system is not Nhs Number', function () {

];
expect(patient_1.nhsNumberStatus(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
expect((0, patient_1.nhsNumberStatus)(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
});

@@ -428,3 +428,3 @@ it('returns Unknown status when there is no verification code', function () {

];
expect(patient_1.nhsNumberStatus(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
expect((0, patient_1.nhsNumberStatus)(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
});

@@ -452,3 +452,3 @@ it('returns Not Verified status when verification code is set to 02', function () {

];
expect(patient_1.nhsNumberStatus(patient)).toEqual(types_1.NhsNumberStatus.NotVerified);
expect((0, patient_1.nhsNumberStatus)(patient)).toEqual(types_1.NhsNumberStatus.NotVerified);
});

@@ -476,3 +476,3 @@ it('returns Verified status when verification code is set to 01', function () {

];
expect(patient_1.nhsNumberStatus(patient)).toEqual(types_1.NhsNumberStatus.Verified);
expect((0, patient_1.nhsNumberStatus)(patient)).toEqual(types_1.NhsNumberStatus.Verified);
});

@@ -500,3 +500,3 @@ it('returns Unknown status when verification code is set to values other that 01 or 02', function () {

];
expect(patient_1.nhsNumberStatus(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
expect((0, patient_1.nhsNumberStatus)(patient)).toEqual(types_1.NhsNumberStatus.Unknown);
});

@@ -513,5 +513,5 @@ });

])('Formats Patient Gender', function (genderCode, expectedDisplayValue) {
expect(patient_1.formatPatientGender(genderCode)).toBe(expectedDisplayValue);
expect((0, patient_1.formatPatientGender)(genderCode)).toBe(expectedDisplayValue);
});
});
//# sourceMappingURL=patient.test.js.map
import { Period } from '@ltht-react/types';
declare const periodSummaryText: (period?: Period | null | undefined) => string;
declare const periodSummaryText: (period?: Period | null) => string;
export default periodSummaryText;

@@ -5,13 +5,13 @@ "use strict";

var periodSummaryText = function (period) {
var start = ((period === null || period === void 0 ? void 0 : period.start) && partial_date_time_1.partialDateTimeText(period === null || period === void 0 ? void 0 : period.start)) || '';
var end = ((period === null || period === void 0 ? void 0 : period.end) && partial_date_time_1.partialDateTimeText(period === null || period === void 0 ? void 0 : period.end)) || '';
var start = ((period === null || period === void 0 ? void 0 : period.start) && (0, partial_date_time_1.partialDateTimeText)(period === null || period === void 0 ? void 0 : period.start)) || '';
var end = ((period === null || period === void 0 ? void 0 : period.end) && (0, partial_date_time_1.partialDateTimeText)(period === null || period === void 0 ? void 0 : period.end)) || '';
if (start === '' && end === '')
return '';
if (end === '')
return start + " to Present";
return "".concat(start, " to Present");
if (start === '')
return "Unknown to " + end;
return start + " to " + end;
return "Unknown to ".concat(end);
return "".concat(start, " to ").concat(end);
};
exports.default = periodSummaryText;
//# sourceMappingURL=period.js.map

@@ -24,3 +24,3 @@ "use strict";

var period = {};
expect(period_1.default(period)).toEqual('');
expect((0, period_1.default)(period)).toEqual('');
});

@@ -27,0 +27,0 @@ // it('formats period summary correctly when only period start is specified', () => {

import { Quantity, Maybe } from '@ltht-react/types';
declare const quantityText: (quantity?: Maybe<Quantity> | undefined) => string;
declare const quantityText: (quantity?: Maybe<Quantity>) => string;
export default quantityText;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var quantityText = function (quantity) { return String(quantity === null || quantity === void 0 ? void 0 : quantity.value) + " " + (quantity === null || quantity === void 0 ? void 0 : quantity.unit); };
var quantityText = function (quantity) { return "".concat(String(quantity === null || quantity === void 0 ? void 0 : quantity.value), " ").concat(quantity === null || quantity === void 0 ? void 0 : quantity.unit); };
exports.default = quantityText;
//# sourceMappingURL=quantity.js.map

@@ -13,5 +13,5 @@ "use strict";

};
expect(quantity_1.default(quantity)).toEqual('3 Years');
expect((0, quantity_1.default)(quantity)).toEqual('3 Years');
});
});
//# sourceMappingURL=quantity.test.js.map
import { Range, Maybe } from '@ltht-react/types';
declare const rangeText: (range?: Maybe<Range> | undefined) => string;
declare const rangeText: (range?: Maybe<Range>) => string;
export default rangeText;

@@ -7,4 +7,4 @@ "use strict";

var quantity_1 = __importDefault(require("./quantity"));
var rangeText = function (range) { return quantity_1.default(range === null || range === void 0 ? void 0 : range.low) + " - " + quantity_1.default(range === null || range === void 0 ? void 0 : range.high); };
var rangeText = function (range) { return "".concat((0, quantity_1.default)(range === null || range === void 0 ? void 0 : range.low), " - ").concat((0, quantity_1.default)(range === null || range === void 0 ? void 0 : range.high)); };
exports.default = rangeText;
//# sourceMappingURL=range.js.map

@@ -19,5 +19,5 @@ "use strict";

};
expect(range_1.default(range)).toEqual('1 Year - 3 Years');
expect((0, range_1.default)(range)).toEqual('1 Year - 3 Years');
});
});
//# sourceMappingURL=range.test.js.map

@@ -11,3 +11,3 @@ "use strict";

var resourceReference = [];
expect(resource_reference_1.default(resourceReference)).toEqual('');
expect((0, resource_reference_1.default)(resourceReference)).toEqual('');
});

@@ -21,3 +21,3 @@ it('single item in resource reference display formats correctly', function () {

];
expect(resource_reference_1.default(resourceReference)).toEqual('test one');
expect((0, resource_reference_1.default)(resourceReference)).toEqual('test one');
});

@@ -29,3 +29,3 @@ it('multiple items in resource reference formats correctly', function () {

];
expect(resource_reference_1.default(resourceReference)).toEqual('test one, test two');
expect((0, resource_reference_1.default)(resourceReference)).toEqual('test one, test two');
});

@@ -32,0 +32,0 @@ });

@@ -1,2 +0,2 @@

declare const stripBBTags: (value?: string | null | undefined) => string;
declare const stripBBTags: (value?: string | null) => string;
export default stripBBTags;

@@ -10,3 +10,3 @@ "use strict";

var input = 'This text has no BB tags';
var output = strip_bb_tags_1.default(input);
var output = (0, strip_bb_tags_1.default)(input);
expect(output).toEqual(input);

@@ -16,3 +16,3 @@ });

var input = undefined;
var output = strip_bb_tags_1.default(input);
var output = (0, strip_bb_tags_1.default)(input);
expect(output).toBe('');

@@ -22,4 +22,4 @@ });

var value = 'The text';
var input = "[b]" + value + "[/b]";
var output = strip_bb_tags_1.default(input);
var input = "[b]".concat(value, "[/b]");
var output = (0, strip_bb_tags_1.default)(input);
expect(output).toEqual(value);

@@ -29,7 +29,7 @@ });

var value = 'The text';
var input = "[i]" + value + "[/i][b]" + value + "[/b]";
var output = strip_bb_tags_1.default(input);
expect(output).toEqual("" + value + value);
var input = "[i]".concat(value, "[/i][b]").concat(value, "[/b]");
var output = (0, strip_bb_tags_1.default)(input);
expect(output).toEqual("".concat(value).concat(value));
});
});
//# sourceMappingURL=strip-bb-tags.test.js.map

@@ -1,2 +0,2 @@

declare const stripHtmlTags: (value?: string | null | undefined) => string;
declare const stripHtmlTags: (value?: string | null) => string;
export default stripHtmlTags;

@@ -10,3 +10,3 @@ "use strict";

var input = 'This text has no HTML tags';
var output = strip_html_tags_1.default(input);
var output = (0, strip_html_tags_1.default)(input);
expect(output).toEqual(input);

@@ -16,3 +16,3 @@ });

var input = undefined;
var output = strip_html_tags_1.default(input);
var output = (0, strip_html_tags_1.default)(input);
expect(output).toBe('');

@@ -22,4 +22,4 @@ });

var value = 'The text';
var input = "<p>" + value + "</p>";
var output = strip_html_tags_1.default(input);
var input = "<p>".concat(value, "</p>");
var output = (0, strip_html_tags_1.default)(input);
expect(output).toEqual(value);

@@ -29,7 +29,7 @@ });

var value = 'The text';
var input = "<h3>" + value + "</h3><span>" + value + "</span>";
var output = strip_html_tags_1.default(input);
expect(output).toEqual("" + value + value);
var input = "<h3>".concat(value, "</h3><span>").concat(value, "</span>");
var output = (0, strip_html_tags_1.default)(input);
expect(output).toEqual("".concat(value).concat(value));
});
});
//# sourceMappingURL=strip-html-tags.test.js.map

@@ -11,23 +11,23 @@ "use strict";

var value = '';
expect(title_case_1.default(value)).toEqual('');
expect((0, title_case_1.default)(value)).toEqual('');
});
it('string with no delimiter formats correctly', function () {
var value = 'UNCONFIRMED';
expect(title_case_1.default(value)).toEqual('Unconfirmed');
expect((0, title_case_1.default)(value)).toEqual('Unconfirmed');
});
it('string with underscore delimiter formats correctly', function () {
var value = 'NOT_CONFIRMED';
expect(title_case_1.default(value)).toEqual('Not Confirmed');
expect((0, title_case_1.default)(value)).toEqual('Not Confirmed');
});
it('string with multiple delimiters of same type formats correctly', function () {
var value = 'STATUS UNCONFIRMED';
expect(title_case_1.default(value)).toEqual('Status Unconfirmed');
expect((0, title_case_1.default)(value)).toEqual('Status Unconfirmed');
});
it('string with multiple delimiters of different types formats correctly', function () {
var value = 'STATUS NOT_CONFIRMED';
expect(title_case_1.default(value)).toEqual('Status Not Confirmed');
expect((0, title_case_1.default)(value)).toEqual('Status Not Confirmed');
});
it('string with multiple spaces formats correctly', function () {
var value = 'test test';
expect(title_case_1.default(value)).toEqual('Test Test');
expect((0, title_case_1.default)(value)).toEqual('Test Test');
});

@@ -34,0 +34,0 @@ });

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

{
"name": "@ltht-react/utils",
"version": "1.1.272",
"version": "2.0.1",
"description": "> TODO: description",

@@ -25,5 +25,5 @@ "author": "Jonny Smith <jonny.asmith@gmail.com>",

"dependencies": {
"@ltht-react/types": "^1.0.270"
"@ltht-react/types": "^2.0.1"
},
"gitHead": "f84df66a6fa20da935bab232204d3c8a9fc94626"
"gitHead": "85a8f6972deb11dbfb51869c53a7a6a5063596e9"
}

@@ -0,0 +0,0 @@ # `@ltht-react/utils`

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc