UNPKG

context-hook

Version:

Simple util that resolves common cases with react Context API.

15 lines (14 loc) 620 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.toPascalCase = void 0; var camelCase_1 = __importDefault(require("lodash/camelCase")); var toPascalCase = function (value) { if ((value === null || value === void 0 ? void 0 : value.length) === 0 || typeof value !== 'string') return ''; var camel = (0, camelCase_1.default)(value); return camel[0].toLocaleUpperCase() + camel.slice(1); }; exports.toPascalCase = toPascalCase;