Skip to content

Commit

Permalink
Merge pull request #206 from hckrnews/feature/trojs
Browse files Browse the repository at this point in the history
Move to TroJS
  • Loading branch information
EpeusJS authored Apr 19, 2024
2 parents d5fb282 + f74e9a3 commit e9a1895
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 55 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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!
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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

Expand All @@ -22,15 +22,15 @@ 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.

## Usage

Example usage:
```javascript
import { Obj } from '@hckrnews/objects'
import { Obj } from '@trojs/objects'

const addressSchema = {
street: String,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
74 changes: 37 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/objects.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit e9a1895

Please sign in to comment.