Skip to content

Commit e81eeb4

Browse files
authored
updated code example imports to use tree shaking/named imports
1 parent ea8ca33 commit e81eeb4

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Readme.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ This function adds pluralization support to every String object.
7272

7373
#### Example code
7474
```js
75-
var inflection = require('inflection');
75+
const { pluralize } = require('inflection');
7676

7777
pluralize('person'); // === 'people'
7878
pluralize('octopus'); // === "octopi"
@@ -98,7 +98,7 @@ This function adds singularization support to every String object.
9898

9999
#### Example code
100100
```js
101-
var inflection = require('inflection');
101+
const { singularize } = require('inflection');
102102

103103
singularize('people'); // === 'person'
104104
singularize('octopi'); // === "octopus"
@@ -134,7 +134,7 @@ This function will pluralize or singularlize a String appropriately based on an
134134

135135
#### Example code
136136
```js
137-
var inflection = require('inflection');
137+
const { inflect } = require('inflection');
138138

139139
inflect('people', 1); // === 'person'
140140
inflect('octopi', 1); // === 'octopus'
@@ -164,7 +164,7 @@ This function transforms String object from underscore to camelcase.
164164

165165
#### Example code
166166
```js
167-
var inflection = require('inflection');
167+
const { camelize } = require('inflection');
168168

169169
camelize('message_properties'); // === 'MessageProperties'
170170
camelize('message_properties', true); // === 'messageProperties'
@@ -188,7 +188,7 @@ This function transforms String object from camelcase to underscore.
188188

189189
#### Example code
190190
```js
191-
var inflection = require('inflection');
191+
const { underscore } = require('inflection');
192192

193193
underscore('MessageProperties'); // === 'message_properties'
194194
underscore('messageProperties'); // === 'message_properties'
@@ -214,7 +214,7 @@ This function adds humanize support to every String object.
214214

215215
#### Example code
216216
```js
217-
var inflection = require('inflection');
217+
const { humanize } = require('inflection');
218218

219219
humanize('message_properties'); // === 'Message properties'
220220
humanize('message_properties', true); // === 'message properties'
@@ -233,7 +233,7 @@ This function adds capitalization support to every String object.
233233

234234
#### Example code
235235
```js
236-
var inflection = require('inflection');
236+
const { capitalize } = require('inflection');
237237

238238
capitalize('message_properties'); // === 'Message_properties'
239239
capitalize('message properties', true); // === 'Message properties'
@@ -252,7 +252,7 @@ This function replaces underscores with dashes in the string.
252252

253253
#### Example code
254254
```js
255-
var inflection = require('inflection');
255+
const { dasherize } = require('inflection');
256256

257257
dasherize('message_properties'); // === 'message-properties'
258258
dasherize('Message Properties'); // === 'Message-Properties'
@@ -271,7 +271,7 @@ This function adds titleize support to every String object.
271271

272272
#### Example code
273273
```js
274-
var inflection = require('inflection');
274+
const { titleize } = require('inflection');
275275

276276
titleize('message_properties'); // === 'Message Properties'
277277
titleize('message properties to keep'); // === 'Message Properties to Keep'
@@ -290,7 +290,7 @@ This function adds demodulize support to every String object.
290290

291291
#### Example code
292292
```js
293-
var inflection = require('inflection');
293+
const { demodulize } = require('inflection');
294294

295295
demodulize('Message::Bus::Properties'); // === 'Properties'
296296
```
@@ -308,7 +308,7 @@ This function adds tableize support to every String object.
308308

309309
#### Example code
310310
```js
311-
var inflection = require('inflection');
311+
const { tableize } = require('inflection');
312312

313313
tableize('MessageBusProperty'); // === 'message_bus_properties'
314314
```
@@ -326,7 +326,7 @@ This function adds classification support to every String object.
326326

327327
#### Example code
328328
```js
329-
var inflection = require('inflection');
329+
const { classify } = require('inflection');
330330

331331
classify('message_bus_properties'); // === 'MessageBusProperty'
332332
```
@@ -349,7 +349,7 @@ This function adds foreign key support to every String object.
349349

350350
#### Example code
351351
```js
352-
var inflection = require('inflection');
352+
const { foreign_key } = require('inflection');
353353

354354
foreign_key('MessageBusProperty'); // === 'message_bus_property_id'
355355
foreign_key('MessageBusProperty', true); // === 'message_bus_propertyid'
@@ -368,7 +368,7 @@ This function adds ordinalize support to every String object.
368368

369369
#### Example code
370370
```js
371-
var inflection = require('inflection');
371+
const { ordinalize } = require('inflection');
372372

373373
ordinalize('the 1 pitch'); // === 'the 1st pitch'
374374
```
@@ -391,7 +391,7 @@ This function performs multiple inflection methods on a string.
391391

392392
#### Example code
393393
```js
394-
var inflection = require('inflection');
394+
const { transform } = require('inflection');
395395

396396
transform('all job', [ 'pluralize', 'capitalize', 'dasherize' ]); // === 'All-jobs'
397397
```

0 commit comments

Comments
 (0)