1.0.4 • Published 11 months ago

@nebuia-ts/utils v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

@nebuia-ts/utils

Small utils for projects that use the Nebuia API to help with common tasks/operations.

This package is part of the Nebuia organization.

Installation

npm install @nebuia-ts/utils

Usage - Content

Keys

Convert common keys to api headers.

import { NebuiaKeys } from '@nebuia-ts/models';
import { convertKeysToHeaders } from '@nebuia-ts/utils';

const myKeys: NebuiaKeys = {
  apiKeys: "my-api-key",
  apiSecret: "my-api-secret",
}

const headers = convertKeysToHeaders(myKeys); // { public_keys: "my-api-key", secret_key: "my-api-secret" }

Report

Get the validity of a report based on the status.

import { checkNebuiaReportValidity } from '@nebuia-ts/utils';
import { NebuiaReport } from '@nebuia-ts/models';

const myReport: NebuiaReport = {
  // Nebuia report
}

const { status, title, summary } = checkNebuiaReportValidity(myReport);

License

MIT

1.0.1

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.0

11 months ago