First Push
This commit is contained in:
3
node_modules/boolean/.eslintrc.json
generated
vendored
Normal file
3
node_modules/boolean/.eslintrc.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "es/node"
|
||||
}
|
3
node_modules/boolean/.npmpackagejsonlintrc.json
generated
vendored
Normal file
3
node_modules/boolean/.npmpackagejsonlintrc.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "npm-package-json-lint-config-tnw/lib.json"
|
||||
}
|
3
node_modules/boolean/.releaserc.json
generated
vendored
Normal file
3
node_modules/boolean/.releaserc.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "semantic-release-configuration"
|
||||
}
|
70
node_modules/boolean/CHANGELOG.md
generated
vendored
Normal file
70
node_modules/boolean/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
# [3.2.0](https://github.com/thenativeweb/boolean/compare/3.1.4...3.2.0) (2022-02-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Introduce isBooleanable function. ([#341](https://github.com/thenativeweb/boolean/issues/341)) ([e2ecfb3](https://github.com/thenativeweb/boolean/commit/e2ecfb357db729990e533dfd498211cea6126a17))
|
||||
|
||||
## [3.1.4](https://github.com/thenativeweb/boolean/compare/3.1.3...3.1.4) (2021-08-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Downgrade workflows to Node 14. ([#319](https://github.com/thenativeweb/boolean/issues/319)) ([072b068](https://github.com/thenativeweb/boolean/commit/072b0685f8de7602f6be9da9b80cda08cdd71778))
|
||||
* Rollback versions and remove engines field. ([#318](https://github.com/thenativeweb/boolean/issues/318)) ([145dfcf](https://github.com/thenativeweb/boolean/commit/145dfcf7f4c5e3f5898e43661b9a017a2d8cb6a9))
|
||||
|
||||
## [3.1.3](https://github.com/thenativeweb/boolean/compare/3.1.2...3.1.3) (2021-08-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump path-parse from 1.0.6 to 1.0.7 ([#316](https://github.com/thenativeweb/boolean/issues/316)) ([0817f9d](https://github.com/thenativeweb/boolean/commit/0817f9d5c7e4691558e7562146afac19258a655c))
|
||||
|
||||
## [3.1.2](https://github.com/thenativeweb/boolean/compare/3.1.1...3.1.2) (2021-06-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump trim-newlines from 3.0.0 to 3.0.1 ([#302](https://github.com/thenativeweb/boolean/issues/302)) ([376489f](https://github.com/thenativeweb/boolean/commit/376489fe37ec9c46aafb44d3c9abf0edeabc6f93))
|
||||
|
||||
## [3.1.1](https://github.com/thenativeweb/boolean/compare/3.1.0...3.1.1) (2021-06-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump glob-parent from 5.1.1 to 5.1.2 ([#303](https://github.com/thenativeweb/boolean/issues/303)) ([8265437](https://github.com/thenativeweb/boolean/commit/8265437b1b3215256f8649e10ac65d4036a38bad))
|
||||
|
||||
# [3.1.0](https://github.com/thenativeweb/boolean/compare/3.0.4...3.1.0) (2021-05-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add support for primitive object wrappers (fixes [#295](https://github.com/thenativeweb/boolean/issues/295)) ([#296](https://github.com/thenativeweb/boolean/issues/296)) ([5ae115f](https://github.com/thenativeweb/boolean/commit/5ae115f09f123cdb624452fc163fc8724e0ab926))
|
||||
|
||||
## [3.0.4](https://github.com/thenativeweb/boolean/compare/3.0.3...3.0.4) (2021-05-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump hosted-git-info from 2.8.8 to 2.8.9 ([#289](https://github.com/thenativeweb/boolean/issues/289)) ([69ead2c](https://github.com/thenativeweb/boolean/commit/69ead2c8fe897d546f8329ed262e6158938581be))
|
||||
|
||||
## [3.0.3](https://github.com/thenativeweb/boolean/compare/3.0.2...3.0.3) (2021-03-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Migrate from master to main. ([#273](https://github.com/thenativeweb/boolean/issues/273)) ([18b640a](https://github.com/thenativeweb/boolean/commit/18b640af858d26b4dd76b9de443a4039e1e2131a))
|
||||
|
||||
## [3.0.2](https://github.com/thenativeweb/boolean/compare/3.0.1...3.0.2) (2020-11-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix headline for robot section in readme. ([#191](https://github.com/thenativeweb/boolean/issues/191)) ([6b7b72b](https://github.com/thenativeweb/boolean/commit/6b7b72b6d5d5c1ad2251c5959b35c8c87b3421a5))
|
||||
|
||||
## [3.0.1](https://github.com/thenativeweb/boolean/compare/3.0.0...3.0.1) (2020-02-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Simplify comparison code to not use unicode regexp flag ([#99](https://github.com/thenativeweb/boolean/issues/99)) ([2be2aeb](https://github.com/thenativeweb/boolean/commit/2be2aeb244c060eccb388dacc6903bbad193e745))
|
8
node_modules/boolean/LICENSE.txt
generated
vendored
Normal file
8
node_modules/boolean/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
The MIT License (MIT)
|
||||
Copyright (c) 2014-2022 the native web.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
95
node_modules/boolean/README.md
generated
vendored
Normal file
95
node_modules/boolean/README.md
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
# boolean
|
||||
|
||||
boolean converts lots of things to boolean.
|
||||
|
||||
## Status
|
||||
|
||||
| Category | Status |
|
||||
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Version | [](https://www.npmjs.com/package/boolean) |
|
||||
| Dependencies |  |
|
||||
| Dev dependencies |  |
|
||||
| Build |  |
|
||||
| License |  |
|
||||
|
||||
## Installation
|
||||
|
||||
```shell
|
||||
$ npm install boolean
|
||||
```
|
||||
|
||||
## Quick start
|
||||
|
||||
First you need to add a reference to boolean in your application:
|
||||
|
||||
```javascript
|
||||
const { boolean, isBooleanable } = require('boolean');
|
||||
```
|
||||
|
||||
If you use TypeScript, use the following code instead:
|
||||
|
||||
```typescript
|
||||
import { boolean, isBooleanable } from 'boolean';
|
||||
```
|
||||
|
||||
To verify a value for its boolean value, call the `boolean` function and provide the value in question as parameter:
|
||||
|
||||
```javascript
|
||||
console.log(boolean('true')); // => true
|
||||
```
|
||||
|
||||
The `boolean` function considers the following values to be equivalent to `true`:
|
||||
|
||||
- `true` (boolean)
|
||||
- `'true'` (string)
|
||||
- `'TRUE'` (string)
|
||||
- `'t'` (string)
|
||||
- `'T'` (string)
|
||||
- `'yes'` (string)
|
||||
- `'YES'` (string)
|
||||
- `'y'` (string)
|
||||
- `'Y'` (string)
|
||||
- `'on'` (string)
|
||||
- `'ON'` (string)
|
||||
- `'1'` (string)
|
||||
- `1` (number)
|
||||
|
||||
In addition to the primitive types mentioned above, boolean also supports their object wrappers `Boolean`, `String`, and `Number`.
|
||||
|
||||
_Please note that if you provide a `string` or a `String` object, it will be trimmed._
|
||||
|
||||
All other values, including `undefined` and `null` are considered to be `false`.
|
||||
|
||||
### Figuring out whether a value can be considered to be boolean
|
||||
|
||||
From time to time, you may not want to directly convert a value to its boolean equivalent, but explicitly check whether it looks like a boolean. E.g., although `boolean('F')` returns `false`, the string `F` at least looks like a boolean, in contrast to something such as `123` (for which `boolean(123)` would also return `false`).
|
||||
|
||||
To figure out whether a value can be considered to be a boolean, use the `isBooleanable` function:
|
||||
|
||||
```javascript
|
||||
console.log(isBooleanable('true')); // => true
|
||||
```
|
||||
|
||||
The `isBooleanable` function considers all of the above mentioned values to be reasonable boolean values, and additionally, also the following ones:
|
||||
|
||||
- `false` (boolean)
|
||||
- `'false'` (string)
|
||||
- `'FALSE'` (string)
|
||||
- `'f'` (string)
|
||||
- `'F'` (string)
|
||||
- `'no'` (string)
|
||||
- `'NO'` (string)
|
||||
- `'n'` (string)
|
||||
- `'N'` (string)
|
||||
- `'off'` (string)
|
||||
- `'OFF'` (string)
|
||||
- `'0'` (string)
|
||||
- `0` (number)
|
||||
|
||||
## Running quality assurance
|
||||
|
||||
To run quality assurance for this module use [roboter](https://www.npmjs.com/package/roboter):
|
||||
|
||||
```shell
|
||||
$ npx roboter
|
||||
```
|
2
node_modules/boolean/build/lib/boolean.d.ts
generated
vendored
Normal file
2
node_modules/boolean/build/lib/boolean.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const boolean: (value: any) => boolean;
|
||||
export { boolean };
|
16
node_modules/boolean/build/lib/boolean.js
generated
vendored
Normal file
16
node_modules/boolean/build/lib/boolean.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.boolean = void 0;
|
||||
const boolean = function (value) {
|
||||
switch (Object.prototype.toString.call(value)) {
|
||||
case '[object String]':
|
||||
return ['true', 't', 'yes', 'y', 'on', '1'].includes(value.trim().toLowerCase());
|
||||
case '[object Number]':
|
||||
return value.valueOf() === 1;
|
||||
case '[object Boolean]':
|
||||
return value.valueOf();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
};
|
||||
exports.boolean = boolean;
|
3
node_modules/boolean/build/lib/index.d.ts
generated
vendored
Normal file
3
node_modules/boolean/build/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { boolean } from './boolean';
|
||||
import { isBooleanable } from './isBooleanable';
|
||||
export { boolean, isBooleanable };
|
7
node_modules/boolean/build/lib/index.js
generated
vendored
Normal file
7
node_modules/boolean/build/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isBooleanable = exports.boolean = void 0;
|
||||
const boolean_1 = require("./boolean");
|
||||
Object.defineProperty(exports, "boolean", { enumerable: true, get: function () { return boolean_1.boolean; } });
|
||||
const isBooleanable_1 = require("./isBooleanable");
|
||||
Object.defineProperty(exports, "isBooleanable", { enumerable: true, get: function () { return isBooleanable_1.isBooleanable; } });
|
2
node_modules/boolean/build/lib/isBooleanable.d.ts
generated
vendored
Normal file
2
node_modules/boolean/build/lib/isBooleanable.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const isBooleanable: (value: any) => boolean;
|
||||
export { isBooleanable };
|
19
node_modules/boolean/build/lib/isBooleanable.js
generated
vendored
Normal file
19
node_modules/boolean/build/lib/isBooleanable.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isBooleanable = void 0;
|
||||
const isBooleanable = function (value) {
|
||||
switch (Object.prototype.toString.call(value)) {
|
||||
case '[object String]':
|
||||
return [
|
||||
'true', 't', 'yes', 'y', 'on', '1',
|
||||
'false', 'f', 'no', 'n', 'off', '0'
|
||||
].includes(value.trim().toLowerCase());
|
||||
case '[object Number]':
|
||||
return [0, 1].includes(value.valueOf());
|
||||
case '[object Boolean]':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
};
|
||||
exports.isBooleanable = isBooleanable;
|
17
node_modules/boolean/lib/boolean.ts
generated
vendored
Normal file
17
node_modules/boolean/lib/boolean.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
const boolean = function (value: any): boolean {
|
||||
switch (Object.prototype.toString.call(value)) {
|
||||
case '[object String]':
|
||||
return [ 'true', 't', 'yes', 'y', 'on', '1' ].includes(value.trim().toLowerCase());
|
||||
|
||||
case '[object Number]':
|
||||
return value.valueOf() === 1;
|
||||
|
||||
case '[object Boolean]':
|
||||
return value.valueOf();
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
export { boolean };
|
4
node_modules/boolean/lib/index.ts
generated
vendored
Normal file
4
node_modules/boolean/lib/index.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { boolean } from './boolean';
|
||||
import { isBooleanable } from './isBooleanable';
|
||||
|
||||
export { boolean, isBooleanable };
|
20
node_modules/boolean/lib/isBooleanable.ts
generated
vendored
Normal file
20
node_modules/boolean/lib/isBooleanable.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
const isBooleanable = function (value: any): boolean {
|
||||
switch (Object.prototype.toString.call(value)) {
|
||||
case '[object String]':
|
||||
return [
|
||||
'true', 't', 'yes', 'y', 'on', '1',
|
||||
'false', 'f', 'no', 'n', 'off', '0'
|
||||
].includes(value.trim().toLowerCase());
|
||||
|
||||
case '[object Number]':
|
||||
return [ 0, 1 ].includes(value.valueOf());
|
||||
|
||||
case '[object Boolean]':
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
export { isBooleanable };
|
16
node_modules/boolean/licenseCheck.json
generated
vendored
Normal file
16
node_modules/boolean/licenseCheck.json
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compatibleLicenses": [
|
||||
"0BSD",
|
||||
"Apache-2.0",
|
||||
"Artistic-2.0",
|
||||
"BSD-2-Clause",
|
||||
"BSD-3-Clause",
|
||||
"CC0-1.0",
|
||||
"CC-BY-3.0",
|
||||
"CC-BY-4.0",
|
||||
"ISC",
|
||||
"MIT",
|
||||
"Python-2.0",
|
||||
"Unlicense"
|
||||
]
|
||||
}
|
46
node_modules/boolean/package.json
generated
vendored
Normal file
46
node_modules/boolean/package.json
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "boolean",
|
||||
"version": "3.2.0",
|
||||
"description": "boolean converts lots of things to boolean.",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Golo Roden",
|
||||
"email": "golo.roden@thenativeweb.io"
|
||||
},
|
||||
{
|
||||
"name": "Matthias Wagler",
|
||||
"email": "matthias.wagler@thenativeweb.io"
|
||||
},
|
||||
{
|
||||
"name": "Ryan Smith",
|
||||
"email": "ryan.smith@ht2labs.com"
|
||||
},
|
||||
{
|
||||
"name": "Thomas Schaaf",
|
||||
"email": "schaaf@komola.de"
|
||||
},
|
||||
{
|
||||
"name": "Sebastian Mares",
|
||||
"email": "camil.sebastian@mares.email"
|
||||
}
|
||||
],
|
||||
"private": false,
|
||||
"main": "build/lib/index.js",
|
||||
"types": "build/lib/index.d.ts",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"assertthat": "6.4.0",
|
||||
"roboter": "12.7.0",
|
||||
"semantic-release-configuration": "2.0.7"
|
||||
},
|
||||
"scripts": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/thenativeweb/boolean.git"
|
||||
},
|
||||
"keywords": [
|
||||
"boolean",
|
||||
"parser"
|
||||
],
|
||||
"license": "MIT"
|
||||
}
|
19
node_modules/boolean/tsconfig.json
generated
vendored
Normal file
19
node_modules/boolean/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"declaration": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": [ "esnext" ],
|
||||
"module": "commonjs",
|
||||
"outDir": "build",
|
||||
"resolveJsonModule": true,
|
||||
"strict": true,
|
||||
"target": "es2019"
|
||||
},
|
||||
"include": [
|
||||
"./**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"./build"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user