Socket
Socket
Sign inDemoInstall

inflected

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inflected - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

dist/umd/inflected.min.js

2

package.json
{
"name": "inflected",
"version": "2.0.0",
"version": "2.0.1",
"description": "A port of ActiveSupport's inflector to Node.js",

@@ -5,0 +5,0 @@ "main": "dist/umd/inflected.js",

@@ -14,3 +14,15 @@ # inflected

Or via yarn:
```bash
% yarn add inflected
```
The UMD build is also available on [unpkg](https://unpkg.com/), adding a `Inflector` object to the global scope.
```html
<script src="https://unpkg.com/inflected/dist/umd/inflected.min.js"></script>
```
## Usage

@@ -26,2 +38,10 @@

If using ES modules, you can cherry-pick only the functions you're interested in:
```js
import { pluralize } from 'inflected';
pluralize('Category') // => 'Categories'
```
Here is the complete API reference:

@@ -41,8 +61,8 @@

```js
Inflector.pluralize('post') // => 'posts'
Inflector.pluralize('octopus') // => 'octopi'
Inflector.pluralize('sheep') // => 'sheep'
Inflector.pluralize('words') // => 'words'
Inflector.pluralize('CamelOctopus') // => 'CamelOctopi'
Inflector.pluralize('ley', 'es') // => 'leyes'
Inflector.pluralize('post') // => 'posts'
Inflector.pluralize('octopus') // => 'octopi'
Inflector.pluralize('sheep') // => 'sheep'
Inflector.pluralize('words') // => 'words'
Inflector.pluralize('CamelOctopus') // => 'CamelOctopi'
Inflector.pluralize('ley', 'es') // => 'leyes'
```

@@ -62,8 +82,8 @@

```js
Inflector.singularize('posts') // => 'post'
Inflector.singularize('octopi') // => 'octopus'
Inflector.singularize('sheep') // => 'sheep'
Inflector.singularize('word') // => 'word'
Inflector.singularize('CamelOctopi') // => 'CamelOctopus'
Inflector.singularize('leyes', 'es') // => 'ley'
Inflector.singularize('posts') // => 'post'
Inflector.singularize('octopi') // => 'octopus'
Inflector.singularize('sheep') // => 'sheep'
Inflector.singularize('word') // => 'word'
Inflector.singularize('CamelOctopi') // => 'CamelOctopus'
Inflector.singularize('leyes', 'es') // => 'ley'
```

@@ -81,4 +101,4 @@

```js
Inflector.camelize('foo_bar') // => 'FooBar'
Inflector.camelize('foo_bar', false) // => 'fooBar'
Inflector.camelize('foo_bar') // => 'FooBar'
Inflector.camelize('foo_bar', false) // => 'fooBar'
```

@@ -89,3 +109,3 @@

```js
Inflector.camelize(Inflector.underscore('SSLError')) //=> 'SslError'
Inflector.camelize(Inflector.underscore('SSLError')) // => 'SslError'
```

@@ -102,3 +122,3 @@

```js
Inflector.underscore('FooBar') // => 'foo_bar'
Inflector.underscore('FooBar') // => 'foo_bar'
```

@@ -109,3 +129,3 @@

```js
Inflector.camelize(Inflector.underscore('SSLError')) //=> 'SslError'
Inflector.camelize(Inflector.underscore('SSLError')) // => 'SslError'
```

@@ -180,3 +200,3 @@

```js
Inflector.classify('business') // => 'Busines'
Inflector.classify('business') // => 'Busines'
```

@@ -204,3 +224,3 @@

Creates a foreign key name from a class name. `separateClassNameAndIdWithUnderscore` sets whether the method should put "_" between the name and "id".
Creates a foreign key name from a class name. `separateClassNameAndIdWithUnderscore` sets whether the method should put "_" between the name and "id" (default: `true`).

@@ -284,4 +304,3 @@ ```js

Default approximations are provided for Western/Latin characters,
e.g, "ø", "ñ", "é", "ß", etc.
Default approximations are provided for Western/Latin characters, e.g, "ø", "ñ", "é", "ß", etc.

@@ -326,9 +345,5 @@ This method is I18n-aware, so you can set up custom approximations for a locale. This can be useful, for example, to transliterate German's "ü" and "ö" to "ue" and "oe", or to add support for transliterating Russian to ASCII.

1. Fork the repo and `make install`.
2. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate: `make test`.
3. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or are fixing a bug, we need a test!
4. Make the test pass.
5. Push to your fork and submit a pull request.

@@ -335,0 +350,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc