From 429b678f7be92a4990f3ba33609251e010cebe62 Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 11 Jan 2022 21:34:43 +0300 Subject: [PATCH] Boolean 2.1.0 --- .editorconfig | 13 ++++++------- .gitattributes | 1 + CHANGELOG.md | 5 +++++ index.d.ts | 1 + index.js | 2 +- index.test-d.ts | 4 ++++ package.json | 13 ++++++++----- test.js | 6 +++--- 8 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 .gitattributes create mode 100644 index.d.ts create mode 100644 index.test-d.ts diff --git a/.editorconfig b/.editorconfig index e98f58d..ea8f4ab 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,18 +1,17 @@ -# EditorConfig: http://EditorConfig.org +# EditorConfig is awesome: https://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 + +[*.{js,d.ts,ts}] +charset = utf-8 +trim_trailing_whitespace = true indent_style = space indent_size = 4 -# 2 space indentation -[*.yaml, *.yml] +[package.json,*.yaml] indent_style = space indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..94f480d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d84008..0ba02f2 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +# [2.1.0](https://github.com/faker-javascript/boolean) (2022-01-11) +* Added xo, tsd, c8. +* Improved tests. + # [2.0.1](https://github.com/faker-javascript/boolean) (2022-01-10) * GitHub docs updates. diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..6513ead --- /dev/null +++ b/index.d.ts @@ -0,0 +1 @@ +export default function boolean(): boolean; diff --git a/index.js b/index.js index d5cdcba..83cc819 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ export default function boolean() { return Math.random() >= 0.5; -}; \ No newline at end of file +} diff --git a/index.test-d.ts b/index.test-d.ts new file mode 100644 index 0000000..a018568 --- /dev/null +++ b/index.test-d.ts @@ -0,0 +1,4 @@ +import {expectType} from 'tsd'; +import boolean from './index.js'; + +expectType(boolean()); diff --git a/package.json b/package.json index 53c92e3..d212023 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fakerjs/boolean", - "version": "2.0.1", + "version": "2.1.0", "description": "Boolean package provides functionality to generate a fake boolean value.", "license": "MIT", "repository": "faker-javascript/boolean", @@ -15,14 +15,17 @@ "node": ">=12" }, "scripts": { - "test": "c8 ava" + "test": "c8 ava; xo --space 4; tsd;" }, "devDependencies": { - "ava": "^3.15.0", - "c8": "^7.11.0" + "ava": "^4.0.0", + "c8": "^7.11.0", + "tsd": "^0.19.1", + "xo": "^0.47.0" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "keywords": [ "fakerjs", diff --git a/test.js b/test.js index e23874f..261c261 100644 --- a/test.js +++ b/test.js @@ -1,6 +1,6 @@ -import boolean from './index.js'; import test from 'ava'; +import boolean from './index.js'; test('boolean return type to be boolean', t => { - t.is(typeof boolean(), 'boolean'); -}); \ No newline at end of file + t.is(typeof boolean(), 'boolean'); +});