88 * A port of inflection-js to node.js module.
99 */
1010Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
11- exports . transform = exports . ordinalize = exports . foreignKey = exports . classify = exports . tableize = exports . demodulize = exports . titleize = exports . dasherize = exports . capitalize = exports . humanize = exports . underscore = exports . camelize = exports . inflect = exports . singularize = exports . pluralize = void 0 ;
11+ exports . pluralize = pluralize ;
12+ exports . singularize = singularize ;
13+ exports . inflect = inflect ;
14+ exports . camelize = camelize ;
15+ exports . underscore = underscore ;
16+ exports . humanize = humanize ;
17+ exports . capitalize = capitalize ;
18+ exports . dasherize = dasherize ;
19+ exports . titleize = titleize ;
20+ exports . demodulize = demodulize ;
21+ exports . tableize = tableize ;
22+ exports . classify = classify ;
23+ exports . foreignKey = foreignKey ;
24+ exports . ordinalize = ordinalize ;
25+ exports . transform = transform ;
1226/**
1327 * @description This is a list of nouns that use the same form for both singular and plural.
1428 * This list should remain entirely in lower case to correctly match Strings.
@@ -590,7 +604,6 @@ function applyRules(str, rules, skip) {
590604function pluralize ( str ) {
591605 return applyRules ( str , pluralRules , uncountableWords ) ;
592606}
593- exports . pluralize = pluralize ;
594607/**
595608 * This function adds singularization support to every String object.
596609 * @param str The subject string.
@@ -607,7 +620,6 @@ exports.pluralize = pluralize;
607620function singularize ( str ) {
608621 return applyRules ( str , singularRules , uncountableWords ) ;
609622}
610- exports . singularize = singularize ;
611623/**
612624 * This function will pluralize or singularlize a String appropriately based on a number value
613625 * @param str The subject string.
@@ -638,7 +650,6 @@ function inflect(str, count) {
638650 return applyRules ( str , pluralRules , uncountableWords ) ;
639651 }
640652}
641- exports . inflect = inflect ;
642653/**
643654 * This function adds camelization support to every String object.
644655 * @param str The subject string.
@@ -676,7 +687,6 @@ function camelize(str, lowFirstLetter) {
676687 }
677688 return strPath . join ( '::' ) ;
678689}
679- exports . camelize = camelize ;
680690/**
681691 * This function adds underscore support to every String object.
682692 * @param str The subject string.
@@ -703,7 +713,6 @@ function underscore(str, allUpperCase) {
703713 }
704714 return strPath . join ( '/' ) . toLowerCase ( ) ;
705715}
706- exports . underscore = underscore ;
707716/**
708717 * This function adds humanize support to every String object.
709718 * @param str The subject string.
@@ -726,7 +735,6 @@ function humanize(str, lowFirstLetter) {
726735 }
727736 return str ;
728737}
729- exports . humanize = humanize ;
730738/**
731739 * This function adds capitalization support to every String object.
732740 * @param str The subject string.
@@ -742,7 +750,6 @@ function capitalize(str) {
742750 str = str . toLowerCase ( ) ;
743751 return str . substring ( 0 , 1 ) . toUpperCase ( ) + str . substring ( 1 ) ;
744752}
745- exports . capitalize = capitalize ;
746753/**
747754 * This function replaces underscores with dashes in the string.
748755 * @param str The subject string.
@@ -757,7 +764,6 @@ exports.capitalize = capitalize;
757764function dasherize ( str ) {
758765 return str . replace ( spaceOrUnderbar , '-' ) ;
759766}
760- exports . dasherize = dasherize ;
761767/**
762768 * This function adds titleize support to every String object.
763769 * @param str The subject string.
@@ -788,7 +794,6 @@ function titleize(str) {
788794 str = str . substring ( 0 , 1 ) . toUpperCase ( ) + str . substring ( 1 ) ;
789795 return str ;
790796}
791- exports . titleize = titleize ;
792797/**
793798 * This function adds demodulize support to every String object.
794799 * @param str The subject string.
@@ -803,7 +808,6 @@ function demodulize(str) {
803808 const strArr = str . split ( '::' ) ;
804809 return strArr [ strArr . length - 1 ] ;
805810}
806- exports . demodulize = demodulize ;
807811/**
808812 * This function adds tableize support to every String object.
809813 * @param str The subject string.
@@ -819,7 +823,6 @@ function tableize(str) {
819823 str = pluralize ( str ) ;
820824 return str ;
821825}
822- exports . tableize = tableize ;
823826/**
824827 * This function adds classification support to every String object.
825828 * @param str The subject string.
@@ -835,7 +838,6 @@ function classify(str) {
835838 str = singularize ( str ) ;
836839 return str ;
837840}
838- exports . classify = classify ;
839841/**
840842 * This function adds foreign key support to every String object.
841843 * @param str The subject string.
@@ -854,7 +856,6 @@ function foreignKey(str, dropIdUbar) {
854856 str = underscore ( str ) + ( dropIdUbar ? '' : '_' ) + 'id' ;
855857 return str ;
856858}
857- exports . foreignKey = foreignKey ;
858859/**
859860 * This function adds ordinalize support to every String object.
860861 * @param str The subject string.
@@ -890,7 +891,6 @@ function ordinalize(str) {
890891 }
891892 return strArr . join ( ' ' ) ;
892893}
893- exports . ordinalize = ordinalize ;
894894const transformFunctions = {
895895 pluralize,
896896 singularize,
@@ -928,4 +928,3 @@ function transform(str, arr) {
928928 }
929929 return str ;
930930}
931- exports . transform = transform ;
0 commit comments