documentation, update eslint, copyright
This commit is contained in:
parent
9551f1b354
commit
15f41cbb62
@ -1 +1,2 @@
|
||||
*.d.ts
|
||||
jenkins.js
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Utilities which is released under MIT.
|
||||
* This file is part of utilities which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@sapphirecode.ovh>, March 2020
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
|
8
.liconfig.json
Normal file
8
.liconfig.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"has_license": true,
|
||||
"license": "MIT",
|
||||
"author": "Timo Hocker",
|
||||
"company": "Sapphirecode",
|
||||
"email": "timo@scode.ovh",
|
||||
"software": "utilities"
|
||||
}
|
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -5,7 +5,7 @@ pipeline {
|
||||
VERSION = VersionNumber([
|
||||
versionNumberString:
|
||||
'${BUILDS_ALL_TIME}',
|
||||
versionPrefix: '1.0.',
|
||||
versionPrefix: '1.3.',
|
||||
worstResultForIncrement: 'SUCCESS'
|
||||
])
|
||||
}
|
||||
|
7
LICENSE
Normal file
7
LICENSE
Normal file
@ -0,0 +1,7 @@
|
||||
MIT License Copyright (c) <year> <author>
|
||||
|
||||
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 (including the next paragraph) 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.
|
31
README.md
31
README.md
@ -1,9 +1,23 @@
|
||||
# Utilities
|
||||
# @sapphirecode/utilities
|
||||
|
||||
General helper functions
|
||||
version: 1.3.x
|
||||
|
||||
small utility functions to make much needed features easier to work with
|
||||
|
||||
## Installation
|
||||
|
||||
npm:
|
||||
|
||||
> npm i --save @sapphirecode/utilities
|
||||
|
||||
yarn:
|
||||
|
||||
> yarn add @sapphirecode/utilities
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const util = require('@scode/utilities');
|
||||
const util = require('@sapphirecode/utilities');
|
||||
|
||||
// cut off decimal places to a specified point
|
||||
util.truncate_decimal(12.345678, 2);
|
||||
@ -24,4 +38,15 @@ const regex = /foo/g;
|
||||
util.run_regex(regex, data, res => {
|
||||
console.log(res[0]); // will output 'foo' 2 times
|
||||
});
|
||||
|
||||
// check if a variable is null, undefined or NaN
|
||||
console.log(util.is_nil(parseInt('abc'))); // true
|
||||
console.log(util.is_nil('foo')); // false
|
||||
console.log(util.is_nil(42)); // false
|
||||
console.log(util.is_nil(null)); // true
|
||||
console.log(util.is_nil(undefined)); // true
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT © Timo Hocker <timo@scode.ovh>
|
||||
|
7
index.d.ts
vendored
7
index.d.ts
vendored
@ -1,3 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of utilities which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
/**
|
||||
* truncates a floating point number
|
||||
*
|
||||
|
4
index.js
4
index.js
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Utilities which is released under MIT.
|
||||
* This file is part of utilities which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@sapphirecode.ovh>, March 2020
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
@ -1,3 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of utilities which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
'use strict';
|
||||
|
24
package.json
24
package.json
@ -2,15 +2,25 @@
|
||||
"name": "@sapphirecode/utilities",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"author": "Timo Hocker <t-hocker@web.de>",
|
||||
"author": "Timo Hocker <timo@scode.ovh>",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"utilities",
|
||||
"regex",
|
||||
"json"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@git.scode.ovh:timo/utilities"
|
||||
},
|
||||
"description": "small utility functions to make much needed features easier to work with",
|
||||
"devDependencies": {
|
||||
"@sapphirecode/eslint-config": "^2.0.2",
|
||||
"@stryker-mutator/core": "^3.0.2",
|
||||
"@stryker-mutator/javascript-mutator": "^3.0.2",
|
||||
"ava": "^3.5.0",
|
||||
"eslint": "^6.8.0",
|
||||
"nyc": "^15.0.0"
|
||||
"@sapphirecode/eslint-config": "^2.1.3",
|
||||
"@stryker-mutator/core": "^3.2.1",
|
||||
"@stryker-mutator/javascript-mutator": "^3.2.1",
|
||||
"ava": "^3.8.2",
|
||||
"eslint": "^7.0.0",
|
||||
"nyc": "^15.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.vue,.mjs",
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Utilities which is released under MIT.
|
||||
* This file is part of utilities which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@sapphirecode.ovh>, March 2020
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||
* This file is part of Utilities which is released under MIT.
|
||||
* This file is part of utilities which is released under MIT.
|
||||
* See file 'LICENSE' for full license details.
|
||||
* Created by Timo Hocker <timo@scode.ovh>, March 2020
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
/* eslint-disable no-magic-numbers */
|
||||
|
Loading…
x
Reference in New Issue
Block a user