Skip to content

Commit e35e354

Browse files
Moved the project from CodeEngineOrg to JS-DevTools
1 parent 66bfb51 commit e35e354

File tree

9 files changed

+390
-288
lines changed

9 files changed

+390
-288
lines changed

README.md

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
CodeEngine validation helpers
1+
Validate
22
======================================
3+
### Simple validation helpers with user-friendly error messages
34

4-
[![Cross-Platform Compatibility](https://engine.codes/img/badges/os-badges.svg)](https://github.com/CodeEngineOrg/code-engine-validate/blob/master/.github/workflows/CI-CD.yaml)
5-
[![Build Status](https://github.com/CodeEngineOrg/code-engine-validate/workflows/CI-CD/badge.svg)](https://github.com/CodeEngineOrg/code-engine-validate/blob/master/.github/workflows/CI-CD.yaml)
5+
[![Cross-Platform Compatibility](https://jstools.dev/img/badges/os-badges.svg)](https://github.com/JS-DevTools/validate/blob/master/.github/workflows/CI-CD.yaml)
6+
[![Build Status](https://github.com/JS-DevTools/validate/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/validate/blob/master/.github/workflows/CI-CD.yaml)
67

7-
[![Coverage Status](https://coveralls.io/repos/github/CodeEngineOrg/code-engine-validate/badge.svg?branch=master)](https://coveralls.io/github/CodeEngineOrg/code-engine-validate)
8-
[![Dependencies](https://david-dm.org/CodeEngineOrg/code-engine-validate.svg)](https://david-dm.org/CodeEngineOrg/code-engine-validate)
8+
[![Coverage Status](https://coveralls.io/repos/github/JS-DevTools/validate/badge.svg?branch=master)](https://coveralls.io/github/JS-DevTools/validate)
9+
[![Dependencies](https://david-dm.org/JS-DevTools/validate.svg)](https://david-dm.org/JS-DevTools/validate)
910

10-
[![npm](https://img.shields.io/npm/v/@code-engine/validate.svg)](https://www.npmjs.com/package/@code-engine/validate)
11-
[![License](https://img.shields.io/npm/l/@code-engine/validate.svg)](LICENSE)
12-
[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/CodeEngineOrg/code-engine-validate)
11+
[![npm](https://img.shields.io/npm/v/@jsdevtools/validate.svg)](https://www.npmjs.com/package/@jsdevtools/validate)
12+
[![License](https://img.shields.io/npm/l/@jsdevtools/validate.svg)](LICENSE)
13+
[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/JS-DevTools/validate)
1314

1415

1516

16-
This is a utility library that's used inside [CodeEngine](https://engine.codes/) to validate inputs.
17+
Installation
18+
--------------------------
19+
You can install this library via [npm](https://docs.npmjs.com/about-npm/).
1720

18-
> **NOTE:** This is an **internal library** that is only intended to be used by CodeEngine. Using it outside of CodeEngine is discouraged.
21+
```bash
22+
npm install @jsdevtools/validate
23+
```
1924

2025

2126

@@ -32,7 +37,7 @@ Validates any value that is not `undefined`. (even `null` and `NaN`)
3237
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
3338

3439
```javascript
35-
import validate from "@code-engine/validate";
40+
import validate from "@jsdevtools/validate";
3641

3742
validate.value(0); //
3843
validate.value(false); //
@@ -52,7 +57,7 @@ Validates a value that is one of the specified values.
5257
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
5358

5459
```javascript
55-
import validate from "@code-engine/validate";
60+
import validate from "@jsdevtools/validate";
5661

5762
validate.value.oneOf("a", ["a", "b", "c"]); //
5863
validate.value.oneOf(4, [1, 2, 3, 4, 5]); //
@@ -71,7 +76,7 @@ Validates a value that is the specified type.
7176
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
7277

7378
```javascript
74-
import validate from "@code-engine/validate";
79+
import validate from "@jsdevtools/validate";
7580

7681
validate.type("John", String); //
7782
validate.type(42, Number); //
@@ -98,7 +103,7 @@ Validates a value that is the specified type.
98103
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
99104

100105
```javascript
101-
import validate from "@code-engine/validate";
106+
import validate from "@jsdevtools/validate";
102107

103108
validate.type.oneOf("John", [Number, String, Boolean]); //
104109
validate.type.oneOf(42, [Number, BigInt, Date]); //
@@ -119,7 +124,7 @@ Validates a primitive string value (including empty strings).
119124
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
120125

121126
```javascript
122-
import validate from "@code-engine/validate";
127+
import validate from "@jsdevtools/validate";
123128

124129
validate.type.string("John"); //
125130
validate.type.string(""); //
@@ -141,7 +146,7 @@ Validates a primitive number value (**not** including `NaN`).
141146
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
142147

143148
```javascript
144-
import validate from "@code-engine/validate";
149+
import validate from "@jsdevtools/validate";
145150

146151
validate.type.number(0) //
147152
validate.type.number(123) //
@@ -163,7 +168,7 @@ Validates a primitive boolean value.
163168
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
164169

165170
```javascript
166-
import validate from "@code-engine/validate";
171+
import validate from "@jsdevtools/validate";
167172

168173
validate.type.boolean(false) //
169174
validate.type.boolean(true) //
@@ -183,7 +188,7 @@ Validates an object (**not** including `null`).
183188
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
184189

185190
```javascript
186-
import validate from "@code-engine/validate";
191+
import validate from "@jsdevtools/validate";
187192

188193
validate.type.object({}) //
189194
validate.type.object(/^regex$/) //
@@ -205,7 +210,7 @@ Validates any type of function, including async, generators, arrow functions, cl
205210
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
206211

207212
```javascript
208-
import validate from "@code-engine/validate";
213+
import validate from "@jsdevtools/validate";
209214

210215
validate.type.function(Object) //
211216
validate.type.function(Object.toString) //
@@ -231,7 +236,7 @@ Validates a string with at least one character (including whitespace).
231236
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
232237

233238
```javascript
234-
import validate from "@code-engine/validate";
239+
import validate from "@jsdevtools/validate";
235240

236241
validate.string.nonEmpty("John") //
237242
validate.string.nonEmpty(" ") //
@@ -252,7 +257,7 @@ Validates a string with at least one non-whitespace character.
252257
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
253258

254259
```javascript
255-
import validate from "@code-engine/validate";
260+
import validate from "@jsdevtools/validate";
256261

257262
validate.string.nonWhitespace("John") //
258263
validate.string.nonWhitespace(" a ") //
@@ -274,7 +279,7 @@ Validates a string with at least the specified number of characters (including w
274279
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
275280

276281
```javascript
277-
import validate from "@code-engine/validate";
282+
import validate from "@jsdevtools/validate";
278283

279284
validate.string.minLength("John", 1) //
280285
validate.string.minLength(" a ", 5) //
@@ -294,7 +299,7 @@ Validates a string with no more than the specified number of characters (includi
294299
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
295300

296301
```javascript
297-
import validate from "@code-engine/validate";
302+
import validate from "@jsdevtools/validate";
298303

299304
validate.string.maxLength("John", 10) //
300305
validate.string.maxLength(" a ", 5) //
@@ -314,7 +319,7 @@ Validates a string with the specified number of characters (including whitespace
314319
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
315320

316321
```javascript
317-
import validate from "@code-engine/validate";
322+
import validate from "@jsdevtools/validate";
318323

319324
validate.string.length("John", 1, 10) //
320325
validate.string.length(" a ", 5, 25) //
@@ -336,7 +341,7 @@ Validates an integer value (positive or negative).
336341
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
337342

338343
```javascript
339-
import validate from "@code-engine/validate";
344+
import validate from "@jsdevtools/validate";
340345

341346
validate.number.integer(0); //
342347
validate.number.integer(42); //
@@ -356,7 +361,7 @@ Validates a positive integer value (one or more).
356361
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
357362

358363
```javascript
359-
import validate from "@code-engine/validate";
364+
import validate from "@jsdevtools/validate";
360365

361366
validate.number.integer.positive(42); //
362367
validate.number.integer.positive(12345.0); //
@@ -374,7 +379,7 @@ Validates an integer value that is zero or greater.
374379
- **defaultValue** - (optional) The default value to use if `value` is `undefined`.
375380

376381
```javascript
377-
import validate from "@code-engine/validate";
382+
import validate from "@jsdevtools/validate";
378383

379384
validate.number.integer.nonNegative(0); //
380385
validate.number.integer.nonNegative(42); //
@@ -387,13 +392,13 @@ validate.number.integer.nonNegative(-42); // ❌
387392

388393
Contributing
389394
--------------------------
390-
Contributions, enhancements, and bug-fixes are welcome! [File an issue](https://github.com/CodeEngineOrg/code-engine-validate/issues) on GitHub and [submit a pull request](https://github.com/CodeEngineOrg/code-engine-validate/pulls).
395+
Contributions, enhancements, and bug-fixes are welcome! [File an issue](https://github.com/JS-DevTools/validate/issues) on GitHub and [submit a pull request](https://github.com/JS-DevTools/validate/pulls).
391396

392397
#### Building
393398
To build the project locally on your computer:
394399

395400
1. __Clone this repo__<br>
396-
`git clone https://github.com/CodeEngineOrg/code-engine-validate.git`
401+
`git clone https://github.com/JS-DevTools/validate.git`
397402

398403
2. __Install dependencies__<br>
399404
`npm install`
@@ -408,16 +413,16 @@ To build the project locally on your computer:
408413

409414
License
410415
--------------------------
411-
@code-engine/validate is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.
416+
@jsdevtools/validate is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.
412417

413-
This package is [Treeware](http://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/CodeEngineOrg/code-engine-validate) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
418+
This package is [Treeware](http://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/JS-DevTools/validate) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
414419

415420

416421

417422
Big Thanks To
418423
--------------------------
419424
Thanks to these awesome companies for their support of Open Source developers ❤
420425

421-
[![Travis CI](https://engine.codes/img/badges/travis-ci.svg)](https://travis-ci.com)
422-
[![SauceLabs](https://engine.codes/img/badges/sauce-labs.svg)](https://saucelabs.com)
423-
[![Coveralls](https://engine.codes/img/badges/coveralls.svg)](https://coveralls.io)
426+
[![Travis CI](https://jstools.dev/img/badges/travis-ci.svg)](https://travis-ci.com)
427+
[![SauceLabs](https://jstools.dev/img/badges/sauce-labs.svg)](https://saucelabs.com)
428+
[![Coveralls](https://jstools.dev/img/badges/coveralls.svg)](https://coveralls.io)

0 commit comments

Comments
 (0)