Skip to content

Commit

Permalink
feat(core): initial code commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed Jan 8, 2022
1 parent 0d51359 commit 3bb7b98
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# EditorConfig: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

# 2 space indentation
[*.yaml, *.yml]
indent_style = space
indent_size = 2
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Tests
on: ['push', 'pull_request']
jobs:
test:
name: Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [^12, ^14, ^16, ^17]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Global
node_modules/

# OS Generated
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
*.swp

# phpstorm
.idea/*
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<a name="1.0.0"></a>
# [1.0.0](https://github.com/faker-javascript/boolean) (2022-01-08)
* Initial release
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Faker Javascript
Copyright (c) Sergey Romanenko

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
# boolean
<h1 align="center">Boolean</h1>
<p align="center">
Boolean package provides functionality to generate a fake boolean value.
</p>

<p align="center">
<a href="https://github.com/faker-javascript/random-boolean/releases"><img alt="Version" src="https://img.shields.io/github/release/faker-javascript/random-boolean.svg?label=version&color=green"></a> <a href="https://github.com/faker-javascript/random-boolean"><img src="https://img.shields.io/badge/license-MIT-blue.svg?color=green" alt="License"></a> <img src="https://github.com/faker-javascript/random-boolean/actions/workflows/tests.yml/badge.svg">
</p>

## Install

```
$ npm install --save @fakerjs/random-boolean
```

## Usage

```js
import fakeBoolean from '@fakerjs/boolean';

fakeBoolean();
//=> true

fakeBoolean();
//=> false
```

## Tests

Run tests

```
npm run test
```

## License
[The MIT License (MIT)](https://github.com/faker-javascript/random-boolean/blob/master/LICENSE.txt)
Copyright (c) [Sergey Romanenko](https://github.com/Awilum)
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function fakeBoolean() {
return Math.random() >= 0.5;
};
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@fakerjs/boolean",
"version": "1.1.0",
"description": "Random Boolean package provides functionality to generate a random boolean value.",
"license": "MIT",
"repository": "fakerjs/random-boolean",
"author": {
"name": "Sergey Romanenko",
"email": "[email protected]",
"url": "https://github.com/Awilum"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "ava"
},
"devDependencies": {
"ava": "^3.15.0"
},
"files": [
"index.js"
],
"keywords": [
"fakerjs",
"fake",
"random",
"bool",
"boolean",
"true",
"false"
]
}
6 changes: 6 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import fakeBoolean from './index.js';
import test from 'ava';

test('fakeBoolean return type to be boolean', t => {
t.is(typeof fakeBoolean(), 'boolean');
});

0 comments on commit 3bb7b98

Please sign in to comment.