@gravitywelluk/string-manipulation
Advanced tools
Comparing version 1.0.3 to 1.0.4
export { default as sentenceCase } from "./sentence-case"; | ||
export { default as slurlgify } from "./slurlgify"; | ||
export { default as titleCase } from "./title-case"; |
@@ -6,6 +6,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.titleCase = exports.sentenceCase = void 0; | ||
exports.titleCase = exports.slurlgify = exports.sentenceCase = void 0; | ||
var sentence_case_1 = require("./sentence-case"); | ||
Object.defineProperty(exports, "sentenceCase", { enumerable: true, get: function () { return __importDefault(sentence_case_1).default; } }); | ||
var slurlgify_1 = require("./slurlgify"); | ||
Object.defineProperty(exports, "slurlgify", { enumerable: true, get: function () { return __importDefault(slurlgify_1).default; } }); | ||
var title_case_1 = require("./title-case"); | ||
Object.defineProperty(exports, "titleCase", { enumerable: true, get: function () { return __importDefault(title_case_1).default; } }); |
{ | ||
"name": "@gravitywelluk/string-manipulation", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Library of commonly used string manipulations", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "c0efb991759a39e8cae18f560c39e5199a6155ad", | ||
"gitHead": "2bdb69a2f20d4802e03dbc6ee7c26c1dba1c215f", | ||
"devDependencies": { | ||
@@ -48,4 +48,5 @@ "jest": "^27.2.0" | ||
"dependencies": { | ||
"slugify": "^1.6.1", | ||
"title-case": "^3.0.3" | ||
} | ||
} |
@@ -1,53 +0,53 @@ | ||
<h1 align="center">Gravitywell Regex</h1> | ||
<p align="center">Library of commonly used Regular Expressions</p> | ||
<h1 align="center">Gravitywell String-manipulation</h1> | ||
<p align="center">Library of utility functions to manipulate strings</p> | ||
<p align="center"> | ||
<img src="https://img.shields.io/github/workflow/status/GravitywellUK/packages/CI/master" alt="CI" /> | ||
<img src="https://img.shields.io/github/license/gravitywelluk/packages" alt="License" /> | ||
<img src="https://img.shields.io/npm/dm/@gravitywelluk/regex" alt="Downloads" /> | ||
<img src="https://img.shields.io/npm/v/@gravitywelluk/regex" alt="Version" /> | ||
<img src="https://img.shields.io/npm/dm/@gravitywelluk/string-manipulation" alt="Downloads" /> | ||
<img src="https://img.shields.io/npm/v/@gravitywelluk/string-manipulation" alt="Version" /> | ||
</p> | ||
<br /> | ||
## Table of Contents | ||
- [Table of Contents](#table-of-contents) | ||
- [Usage](#usage) | ||
- [`sentenceCase`](#sentencecase) | ||
- [`slurlgify`](#slurlgify) | ||
- [`titleCase`](#titlecase) | ||
## Usage | ||
```typescript | ||
import { <REGEX_NAME_HERE> } from "@gravitywelluk/regex"; | ||
import { <LIB_NAME_HERE> } from "@gravitywelluk/string-manipulation"; | ||
``` | ||
## Table of Contents | ||
- [Usage](#usage) | ||
- [Table of Contents](#table-of-contents) | ||
- [Email regex](#email-regex) | ||
- [`globalEmailRegex`](#globalemailregex) | ||
- [Phone number regex](#phone-number-regex) | ||
- [`phoneInternationalE164Regex`](#phoneinternationale164regex) | ||
- [`phoneUkBasedRegex`](#phoneukbasedregex) | ||
### `sentenceCase` | ||
## Email regex | ||
Converts a strings 1st letter to uppercase | ||
### `globalEmailRegex` | ||
```typescript | ||
import { sentenceCase } from "@gravitywelluk/string-manipulation"; | ||
Regex for a global email address `conner.o'brian@example.com` | ||
```typescript | ||
import { globalEmailRegex } from "@gravitywelluk/regex"; | ||
sentenceCase("the fox JUMPED over Brian's lazy dog"); | ||
// Output: "The fox JUMPED over Brian's lazy dog" | ||
``` | ||
### `slurlgify` | ||
## Phone number regex | ||
Converts the given slug into a slugified URL | ||
### `phoneInternationalE164Regex` | ||
```typescript | ||
import { slurlgify } from "@gravitywelluk/string-manipulation"; | ||
Regex for an international (E.164) phone number `+14155552671` | ||
```typescript | ||
import { phoneInternationalE164Regex } from "@gravitywelluk/regex"; | ||
slurlgify("the fox JUMPED over Brian's lazy dog & cat + mouse"); | ||
// Output: "the-fox-jumped-over-brians-lazy-dog-and-cat-plus-mouse" | ||
``` | ||
### `titleCase` | ||
### `phoneUkBasedRegex` | ||
Converts the given sentence string into title case | ||
Regex for a UK based phone number `+447847584310` or `07847584310` | ||
```typescript | ||
import { phoneUkBasedRegex } from "@gravitywelluk/regex"; | ||
``` | ||
import { titleCase } from "@gravitywelluk/string-manipulation"; | ||
titleCase("the fox JUMPED over brian's lazy dog"); | ||
// Output: "The Fox Jumped over Brian's Lazy Dog" | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7480
11
93
2
53
+ Addedslugify@^1.6.1
+ Addedslugify@1.6.6(transitive)