From f74e9a39f31c585057a6bc5e59d43b8be1ed6b48 Mon Sep 17 00:00:00 2001 From: Pieter Wigboldus Date: Fri, 19 Apr 2024 12:10:02 +0200 Subject: [PATCH] Move to TroJS --- CONTRIBUTING.md | 2 +- LICENSE | 2 +- README.md | 18 +++++------- package-lock.json | 74 +++++++++++++++++++++++------------------------ package.json | 8 ++--- src/objects.js | 4 +-- 6 files changed, 53 insertions(+), 55 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2cf0b7f..aac96cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing -HckrNews Objects is Free and Open Source Software. Issues and pull requests are more than welcome! +TroJS Objects is Free and Open Source Software. Issues and pull requests are more than welcome! diff --git a/LICENSE b/LICENSE index a8fba07..a490ee1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Hckr.News +Copyright (c) 2024 TroJS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 92e549a..e327783 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Create valid JavaScript objects -[![NPM version][npm-image]][npm-url] [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=coverage)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) [![Scrutinizer Code Quality][scrutinizer-image]][scrutinizer-url] [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) +[![NPM version][npm-image]][npm-url] [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=coverage)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=bugs)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=hckrnews_objects&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=hckrnews_objects) @@ -10,9 +10,9 @@ Also get more usefull methods to work with objects. ## Installation -`npm install @hckrnews/objects` +`npm install @trojs/objects` or -`yarn add @hckrnews/objects` +`yarn add @trojs/objects` ## Test the package @@ -22,7 +22,7 @@ or ## Validation -For validate the objects, it use the package `@hckrnews/validation` (https://www.npmjs.com/package/@hckrnews/validator) +For validate the objects, it use the package `@trojs/validation` (https://www.npmjs.com/package/@trojs/validator) It will throw an error if the object isnt valid. For all posibilities, check the validation package readme. @@ -30,7 +30,7 @@ For all posibilities, check the validation package readme. Example usage: ```javascript -import { Obj } from '@hckrnews/objects' +import { Obj } from '@trojs/objects' const addressSchema = { street: String, @@ -64,7 +64,7 @@ console.log(myAddress) You can also define sub schemas: ```javascript -import { Obj } from '@hckrnews/objects' +import { Obj } from '@trojs/objects' const filterSchema = { key: String, @@ -485,7 +485,5 @@ true For arrays you can also use `createAll` and `parseAll`. It works the same as `create` and `parse` but it can do it on every item in an array. -[npm-url]: https://www.npmjs.com/package/@hckrnews/objects -[npm-image]: https://img.shields.io/npm/v/@hckrnews/objects.svg -[scrutinizer-url]: https://scrutinizer-ci.com/g/hckrnews/objects/?branch=master -[scrutinizer-image]: https://scrutinizer-ci.com/g/hckrnews/objects/badges/quality-score.png?b=master +[npm-url]: https://www.npmjs.com/package/@trojs/objects +[npm-image]: https://img.shields.io/npm/v/@trojs/objects.svg diff --git a/package-lock.json b/package-lock.json index d650721..c162f1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "@trojs/objects", - "version": "8.0.0", + "version": "8.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@trojs/objects", - "version": "8.0.0", + "version": "8.0.1", "hasInstallScript": true, "license": "MIT", "dependencies": { - "@hckrnews/error": "^2.0.0", - "@hckrnews/validator": "^9.0.0" + "@trojs/error": "^3.0.0", + "@trojs/validator": "^10.0.0" }, "devDependencies": { "@hckrnews/eslint-code-quality": "^0.1.5", @@ -187,21 +187,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@hckrnews/error": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@hckrnews/error/-/error-2.0.3.tgz", - "integrity": "sha512-69gXY7W7qe2cIuisNDsfzQPYK4nCNdUckuzjdSUrPZ4qcriuynYy6DJNtytnQocD0+1jq2X35yoEPK+y2i7WPQ==", - "dependencies": { - "@hckrnews/validator": "^9.0.0" - }, - "engines": { - "node": ">= 14" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/w3nl" - } - }, "node_modules/@hckrnews/eslint-code-quality": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/@hckrnews/eslint-code-quality/-/eslint-code-quality-0.1.7.tgz", @@ -235,18 +220,6 @@ "prettier": "^3.0.0" } }, - "node_modules/@hckrnews/validator": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@hckrnews/validator/-/validator-9.0.3.tgz", - "integrity": "sha512-QpxzHG+vmnqcVLV+AXuQU0H7UABTicVrflXBi3lOXKibWV9N9ICneS3tvF8HfWof2N0EO+NUVz9bAA9rcY7OCw==", - "engines": { - "node": ">= 18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/w3nl" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -411,6 +384,33 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@trojs/error": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@trojs/error/-/error-3.0.0.tgz", + "integrity": "sha512-QIPOtYEo3hnQfperUS8kX+pYggAuU41LMK5doeEvjXDM6sWFG2QCoThJrtRYoegCGHbWkzuTKykjFo5643G7nQ==", + "dependencies": { + "@trojs/validator": "^10.0.0" + }, + "engines": { + "node": ">= 14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/w3nl" + } + }, + "node_modules/@trojs/validator": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@trojs/validator/-/validator-10.0.0.tgz", + "integrity": "sha512-jV4VyIRd3D2rLaDVVaj/Uo9zPOQkZzqJarXMy0ZBztwUUIV2JhdwfczPaSXaz3dLwjThZHc0mLJWu2Si5jTjNQ==", + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/w3nl" + } + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", @@ -756,9 +756,9 @@ } }, "node_modules/builtins": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", - "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", + "integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==", "dev": true, "peer": true, "dependencies": { @@ -1573,9 +1573,9 @@ } }, "node_modules/eslint-plugin-html": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-8.0.0.tgz", - "integrity": "sha512-NINLBAXM3mLa3k5Ezr/kNLHAJJwbot6lS7Ro+SUftDw4cA51KMmcDuCf98GP6Q6kTVPY1hIggzskxAdxfUPXSA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-8.1.0.tgz", + "integrity": "sha512-5bRZQwxZew2Yo9Fa8diz2C9RmzIw9Gs4yzmmjUcpuzhdLW8aVcDtYzEHhNNdt01Z0m4AzSJNuY63RXvzStvDgA==", "dev": true, "dependencies": { "htmlparser2": "^9.1.0" diff --git a/package.json b/package.json index 02f1fe4..244fadb 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "@trojs/objects", "description": "Create valid JavaScript objects", - "version": "8.0.0", + "version": "8.0.1", "author": { "name": "Pieter Wigboldus", - "url": "https://hckr.news/" + "url": "https://trojs.org/" }, "license": "MIT", "scripts": { @@ -53,8 +53,8 @@ "flat" ], "dependencies": { - "@hckrnews/error": "^2.0.0", - "@hckrnews/validator": "^9.0.0" + "@trojs/error": "^3.0.0", + "@trojs/validator": "^10.0.0" }, "funding": { "type": "github", diff --git a/src/objects.js b/src/objects.js index 6feb543..b088a42 100644 --- a/src/objects.js +++ b/src/objects.js @@ -1,5 +1,5 @@ -import { Validator } from '@hckrnews/validator'; -import { ValidationError } from '@hckrnews/error'; +import { Validator } from '@trojs/validator'; +import { ValidationError } from '@trojs/error'; import Parser from './parser.js'; import Int from './int.js'; import ParseOptionsSchema from './schemas/parse-options.js';