Skip to content

Commit 5b43228

Browse files
committed
build: create build 0.1.0
1 parent e5eb088 commit 5b43228

19 files changed

+260
-38
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Codevor - js-library-boilerplate
3+
Copyright (c) 2019 Codevor - js-is-type
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,49 @@
1-
# js-library-boilerplate
1+
# 🎯Type-checking for 'Primitive' JS Types
22

33
[![License][license-badge]][license-url] [![Travis CI][travis-badge]][travis-url] [![Coverage Status][coverage-badge]][coverage-url] [![Commitizen][commitizen-badge]][commitizen-url]
44

5-
> js-library-boilerplate-description.
5+
Type-check for 'Primitive' types in JavaScript are always something to take care when receiving/sending a payload from/to Server/Client application. If you ever wonder how to do this you can sure use `typeof` and make the check by yourself. Or you can user 🎯`js-is-type`!
6+
7+
The usage is simple and verbose. The tests has full coverage and you can use without a doubt.
8+
9+
## Available Types
10+
11+
- `isArray()`
12+
- `isBoolean()`
13+
- `isFunction()`
14+
- `isObject()` (_Remember: in JS, Arrays are Objects!_)
15+
- `isString()`
16+
- `isUndefined()`
617

718
## Installation
819

9-
js-library-boilerplate is available on npm/yarn:
20+
`js-is-type` is available on npm/yarn:
1021

1122
```bash
12-
$ npm install js-library-boilerplate --save
13-
$ yarn add js-library-boilerplate
23+
$ npm install @codevor/js-is-type --save
24+
$ yarn add @codevor/js-is-type
1425
```
1526

1627
## Usage
1728

1829
### With ES6/import
1930

2031
```js
21-
import { sum } from 'js-library-boilerplate';
32+
import { isArray } from '@codevor/js-is-type';
2233

23-
sum(2, 2); // => 4
34+
const names = ['Alice', 'Bob'];
35+
36+
isArray(names); // => true
2437
```
2538

2639
### With require
2740

2841
```js
29-
const sum = require('js-library-boilerplate').sum;
42+
const isArray = require('@codevor/js-is-type').isArray;
43+
44+
const names = ['Alice', 'Bob'];
3045

31-
sum(2, 2); // => 4
46+
isArray(names); // => true
3247
```
3348

3449
## Contributing
@@ -37,21 +52,21 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduc
3752

3853
## Changelog
3954

40-
This project adheres to [Semantic Versioning](https://semver.org/). Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/codevor/js-library-boilerplate/releases) page.
55+
This project adheres to [Semantic Versioning](https://semver.org/). Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/codevor/js-is-type/releases) page.
4156

4257
## Bugs and Sugestions
4358

44-
Report bugs or do suggestions using the [issues](https://github.com/codevor/js-library-boilerplate/issues).
59+
Report bugs or do suggestions using the [issues](https://github.com/codevor/js-is-type/issues).
4560

4661
## License
4762

4863
[MIT License](LICENSE) © [Codevor](https://github.com/codevor)
4964

50-
[license-badge]: https://img.shields.io/github/license/codevor/js-library-boilerplate.svg
65+
[license-badge]: https://img.shields.io/github/license/codevor/js-is-type.svg
5166
[license-url]: https://opensource.org/licenses/MIT
52-
[coverage-badge]: https://coveralls.io/repos/github/codevor/js-library-boilerplate/badge.svg?branch=master
53-
[coverage-url]: https://coveralls.io/github/codevor/js-library-boilerplate?branch=master
54-
[travis-badge]: https://travis-ci.org/codevor/js-library-boilerplate.svg?branch=master
55-
[travis-url]: https://travis-ci.org/codevor/js-library-boilerplate
67+
[coverage-badge]: https://coveralls.io/repos/github/codevor/js-is-type/badge.svg?branch=master
68+
[coverage-url]: https://coveralls.io/github/codevor/js-is-type?branch=master
69+
[travis-badge]: https://travis-ci.org/codevor/js-is-type.svg?branch=master
70+
[travis-url]: https://travis-ci.org/codevor/js-is-type
5671
[commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
5772
[commitizen-url]: http://commitizen.github.io/cz-cli/

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
{
2-
"name": "js-library-boilerplate",
2+
"name": "@codevor/js-is-type",
33
"version": "0.1.0",
4-
"description": "js-library-boilerplate-description",
5-
"main": "dist/js-library-boilerplate.js",
6-
"unpkg": "dist/js-library-boilerplate.min.js",
4+
"description": "🎯Type-checking for 'Primitive' JS Types made easy!",
5+
"main": "dist/js-is-type.js",
6+
"unpkg": "dist/js-is-type.min.js",
77
"scripts": {
88
"clean": "rimraf dist",
99
"dev": "NODE_ENV=dev webpack --progress --colors --watch",
1010
"build:umd": "NODE_ENV=production webpack",
1111
"lint": "eslint src tests",
12-
"test": "jest --coverage --expand",
12+
"test": "jest --coverage",
1313
"test:watch": "jest --watch",
1414
"coveralls": "cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
1515
"prepublish": "yarn lint && yarn test && yarn clean && yarn build:umd",
1616
"commit": "git-cz"
1717
},
18-
"keywords": [],
19-
"author": "Helder Burato Berto <helder.burato@gmail.com> (https://helder.dev/)",
18+
"keywords": [
19+
"Utils",
20+
"Typechecking"
21+
],
22+
"author": "Ilê Caian <ile.caian@gmail.com> (https://ile.pink/)",
2023
"license": "MIT",
2124
"repository": {
2225
"type": "git",
23-
"url": "git+https://github.com/codevor/js-library-boilerplate.git"
26+
"url": "git+https://github.com/codevor/js-is-type.git"
2427
},
2528
"bugs": {
26-
"url": "https://github.com/codevor/js-library-boilerplate/issues"
29+
"url": "https://github.com/codevor/js-is-type/issues"
2730
},
28-
"homepage": "https://github.com/codevor/js-library-boilerplate#readme",
31+
"homepage": "https://github.com/codevor/js-is-type#readme",
2932
"devDependencies": {
3033
"@babel/cli": "^7.6.4",
3134
"@babel/core": "^7.6.4",

src/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
export function sum(x, y) {
2-
return x + y;
3-
}
1+
export * from './validators';

src/validators/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export { default as isArray } from './is-array';
2+
export { default as isBoolean } from './is-boolean';
3+
export { default as isFunction } from './is-function';
4+
export { default as isObject } from './is-object';
5+
export { default as isString } from './is-string';
6+
export { default as isUndefined } from './is-undefined';

src/validators/is-array.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const isArray = value => Array.isArray(value);
2+
3+
export default isArray;

src/validators/is-boolean.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const isBoolean = value => typeof value === 'boolean';
2+
3+
export default isBoolean;

src/validators/is-function.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const isFunction = value => typeof value === "function";
2+
3+
export default isFunction;

src/validators/is-object.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const isObject = value => typeof value === "object";
2+
3+
export default isObject;

src/validators/is-string.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const isString = value => typeof value === "string";
2+
3+
export default isString;

0 commit comments

Comments
 (0)