Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mmit/validate

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mmit/validate - npm Package Compare versions

Comparing version 0.1.4 to 0.2.1

LICENCE

195

package.json
{
"name": "@mmit/validate",
"author": "Mike Mitterer",
"version": "0.1.4",
"description": "Object validation for/in TS",
"license": "MIT",
"type-check": "tsc",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"scripts": {
"start": "NODE_ENV=development webpack-dev-server --config webpack.web.js --mode development --open",
"build": "rm -rf lib && yarn run build:ts",
"build:ts": "tsc --rootDir src/main --project tsconfig.lib.json --declaration --outDir lib",
"build:ts:watch": "tsc --rootDir src/main --declaration --outDir lib --watch",
"build:types": "tsc --rootDir src/main --declaration --outDir lib --emitDeclarationOnly",
"build:js": "babel src/main --out-dir lib --extensions \".ts,.tsx\" --source-maps",
"deploy": "rm -rf lib && yarn run build:ts",
"deploy:node": "rm -rf bin && NODE_ENV=development webpack --config webpack.node.js --mode development",
"deploy:node:prod": "NODE_ENV=production webpack --config webpack.node.js --mode production",
"deploy:web": "rm -rf dist && NODE_ENV=development webpack --config webpack.web.js --mode development",
"deploy:web:prod": "rm -rf dist && NODE_ENV=production webpack --config webpack.web.js --mode production",
"pub": "yarn run build && yarn version --new-version patch && yarn publish --access restricted --non-interactive",
"test": "jest",
"test:unit": "jest src/test/unit",
"test:integration": "jest src/test/integration",
"doc": "typedoc --out doc",
"clean": "rm -rf lib dist bin doc && jest --clearCache",
"prettier": "onchange './src/**/*.ts' -- prettier --write {{changed}}"
},
"files": [
"lib",
"src"
],
"repository": {
"type": "git",
"url": "https://github.com/MikeMitterer/ts-validate"
},
"dependencies": {
"moment": "^2.24.0",
"source-map-loader": "^0.2.4",
"typescript-logging": "^0.6.3"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/node": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-proposal-object-rest-spread": "^7.3.4",
"@babel/plugin-transform-runtime": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/preset-typescript": "^7.3.3",
"@babel/runtime": "^7.3.4",
"@types/core-js": "^2.5.0",
"@types/jest": "^24.0.11",
"@types/node": "^11.11.0",
"@types/shelljs": "^0.8.3",
"@types/ws": "^6.0.1",
"autoprefixer": "^9.4.10",
"awesome-typescript-loader": "^5.2.1",
"babel-loader": "^8.0.5",
"babel-preset-modern-browsers": "^13.1.0",
"clean-webpack-plugin": "^2.0.0",
"copy-webpack-plugin": "^5.0.0",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"html-beautify-webpack-plugin": "^1.0.5",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"html-webpack-string-replace-plugin": "^1.1.0",
"jest": "^24.3.1",
"jest-cli": "^24.3.1",
"jest-extended": "^0.11.1",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.11.0",
"onchange": "^5.2.0",
"postcss": "^7.0.14",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0",
"semver": "^5.3.0",
"shelljs": "^0.8.3",
"style-loader": "^0.23.1",
"ts-jest": "^24.0.0",
"ts-loader": "^5.3.3",
"ts-node": "^8.0.3",
"tslint": "^5.13.1",
"tslint-loader": "^3.5.4",
"tslint-override": "^0.5.0",
"typedoc": "^0.14.2",
"typescript": "^3.3.3333",
"url-loader": "^1.1.2",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.1",
"webpack-livereload-plugin": "^2.2.0",
"webpack-node-externals": "^1.7.2"
}
"name": "@mmit/validate",
"author": "Mike Mitterer",
"version": "0.2.1",
"description": "Object validation for/in TS",
"keywords": [
"check",
"validate",
"typescript"
],
"license": "MIT",
"type-check": "tsc",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"scripts": {
"start": "NODE_ENV=development webpack-dev-server --config webpack.web.js --mode development --open",
"build": "rm -rf lib && yarn run build:ts",
"build:ts": "tsc --rootDir src/main --project tsconfig.lib.json --declaration --outDir lib",
"build:ts:watch": "tsc --rootDir src/main --declaration --outDir lib --watch",
"build:types": "tsc --rootDir src/main --declaration --outDir lib --emitDeclarationOnly",
"build:js": "babel src/main --out-dir lib --extensions \".ts,.tsx\" --source-maps",
"deploy": "rm -rf lib && yarn run build:ts",
"deploy:node": "rm -rf bin && NODE_ENV=development webpack --config webpack.node.js --mode development",
"deploy:node:prod": "NODE_ENV=production webpack --config webpack.node.js --mode production",
"deploy:web": "rm -rf dist && NODE_ENV=development webpack --config webpack.web.js --mode development",
"deploy:web:prod": "rm -rf dist && NODE_ENV=production webpack --config webpack.web.js --mode production",
"pub": "yarn run build && yarn version --new-version patch && yarn publish --access public --non-interactive",
"test": "jest",
"test:unit": "jest src/test/unit",
"test:integration": "jest src/test/integration",
"doc": "typedoc --out doc",
"clean": "rm -rf lib dist bin doc && jest --clearCache",
"prettier": "onchange './src/**/*.ts' -- prettier --write {{changed}}"
},
"files": [
"lib",
"src"
],
"repository": {
"type": "git",
"url": "https://github.com/MikeMitterer/ts-validate"
},
"dependencies": {
"moment": "^2.24.0",
"source-map-loader": "^0.2.4",
"typescript-logging": "^0.6.3"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/node": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-proposal-object-rest-spread": "^7.3.4",
"@babel/plugin-transform-runtime": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/preset-typescript": "^7.3.3",
"@babel/runtime": "^7.3.4",
"@types/core-js": "^2.5.0",
"@types/jest": "^24.0.11",
"@types/node": "^11.11.0",
"@types/shelljs": "^0.8.3",
"@types/ws": "^6.0.1",
"autoprefixer": "^9.4.10",
"awesome-typescript-loader": "^5.2.1",
"babel-loader": "^8.0.5",
"babel-preset-modern-browsers": "^13.1.0",
"clean-webpack-plugin": "^2.0.0",
"copy-webpack-plugin": "^5.0.0",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"html-beautify-webpack-plugin": "^1.0.5",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"html-webpack-string-replace-plugin": "^1.1.0",
"jest": "^24.3.1",
"jest-cli": "^24.3.1",
"jest-extended": "^0.11.1",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.11.0",
"onchange": "^5.2.0",
"postcss": "^7.0.14",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0",
"semver": "^5.3.0",
"shelljs": "^0.8.3",
"style-loader": "^0.23.1",
"ts-jest": "^24.0.0",
"ts-loader": "^5.3.3",
"ts-node": "^8.0.3",
"tslint": "^5.13.1",
"tslint-loader": "^3.5.4",
"tslint-override": "^0.5.0",
"typedoc": "^0.14.2",
"typescript": "^3.3.3333",
"url-loader": "^1.1.2",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.1",
"webpack-livereload-plugin": "^2.2.0",
"webpack-node-externals": "^1.7.2"
}
}

@@ -1,2 +0,2 @@

# Validate - Tiny TS library to
# Validate

@@ -12,43 +12,47 @@ > Lightweight TS library for validating function arguments.

> [Home](https://github.com/MikeMitterer/ts-validate)
```typescript
import * as validate from '@mmit/validate';
validate.isHex('1234567890abcdef');
## Deploy-Varianten aus packages.json
// This throws an ArgumentError with "'1234567890abcdefg' is not a hex value"
validate.isHex('1234567890abcdefg');
- yarn clean
// The same but with your custom error message
validate.isHex('1234567890abcdefg', () => 'My custom message');
```
- yarn deploy
Erstellt die nötigen Files in `lib`
For more examples - pls check out my [Tests](https://github.com/MikeMitterer/ts-validate/tree/master/src/test/unit/validate)
- yarn deploy:node
Erstellt im `bin`-Folder das File app.js dass mit `node bin app.js` aufgerufen werden kann
> [Home](https://github.com/MikeMitterer/ts-validate)
- yarn deploy:web
Browser-Part wird in `dist` veröffentlicht. Kann mit `simplehttpserver dist/` getestet werden
## Bugs / Contribute
- yarn test | jest
Führt die Unit-Tests aus
You reach me via [GH - Issues](https://github.com/MikeMitterer/ts-validate/issues)
## Upgrade aller packages
Help is always welcome!
yarn-upgrade-latest
## License
## ToDo (Jenkins)
MIT License
# MD5 Check von src
Copyright (c) 2019, Mike Mitterer <office@mikemitterer.at>
find ./src -not \( -path ./src/test -prune \) -type f -exec md5 {} \; | sort -k 2
Mike Mitterer: http://www.MikeMitterer.at/
# Wie oben - nur mit sum
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:
find ./src -not \( -path ./src/test -prune \) -type f -exec md5 {} \; | sort -k 2 | md5 -r
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
# cmp gibt 0 zurück wenn die Files gleich sind
if ! cmp srcmd5 srcmd5.prev >/dev/null 2>&1
then
rm -f srcmd5.prev
mv srcmd5 srcmd5.prev
# restart service
fi
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.

@@ -148,2 +148,6 @@ // import { loggerFactory } from '../../main/config/ConfigLog4j';

});
expect(() => validate.isHex('1234567890abcdefg', () => 'My custom message')).toThrow(
new ArgumentError('My custom message'),
);
});

@@ -150,0 +154,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc