Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 132 additions & 3 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"fileName": "hello.ts",
"line": 6,
"character": 15,
"url": "https://github.com/wtasg/node-lib/blob/be4189222f32cc9b2fdf81c380cde5c51f69046c/src/hello.ts#L6"
"url": "https://github.com/wtasg/node-lib/blob/890fd5e866d9096470d56594a5788bf55e34bf7c/src/hello.ts#L6"
}
],
"signatures": [
Expand Down Expand Up @@ -51,7 +51,7 @@
"fileName": "hello.ts",
"line": 6,
"character": 15,
"url": "https://github.com/wtasg/node-lib/blob/be4189222f32cc9b2fdf81c380cde5c51f69046c/src/hello.ts#L6"
"url": "https://github.com/wtasg/node-lib/blob/890fd5e866d9096470d56594a5788bf55e34bf7c/src/hello.ts#L6"
}
],
"type": {
Expand All @@ -72,13 +72,122 @@
}
}
]
},
{
"id": 3,
"name": "pojo",
"variant": "declaration",
"kind": 64,
"flags": {},
"sources": [
{
"fileName": "pojo.ts",
"line": 10,
"character": 9,
"url": "https://github.com/wtasg/node-lib/blob/890fd5e866d9096470d56594a5788bf55e34bf7c/src/pojo.ts#L10"
}
],
"signatures": [
{
"id": 4,
"name": "pojo",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Convert a class instance into a plain JavaScript object.\nCopies only the instance's own enumerable data properties\nand excludes methods or prototype values."
}
],
"blockTags": [
{
"tag": "@returns",
"content": [
{
"kind": "text",
"text": "A plain JavaScript object containing only data fields."
}
]
}
]
},
"sources": [
{
"fileName": "pojo.ts",
"line": 10,
"character": 9,
"url": "https://github.com/wtasg/node-lib/blob/890fd5e866d9096470d56594a5788bf55e34bf7c/src/pojo.ts#L10"
}
],
"typeParameters": [
{
"id": 5,
"name": "T",
"variant": "typeParam",
"kind": 131072,
"flags": {},
"type": {
"type": "intrinsic",
"name": "object"
}
}
],
"parameters": [
{
"id": 6,
"name": "instance",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "A class instance to convert."
}
]
},
"type": {
"type": "reference",
"target": 5,
"name": "T",
"package": "@wtasnorg/node-lib",
"refersToTypeParameter": true
}
}
],
"type": {
"type": "reference",
"target": {
"packageName": "typescript",
"packagePath": "lib/lib.es5.d.ts",
"qualifiedName": "Record"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "intrinsic",
"name": "any"
}
],
"name": "Record",
"package": "typescript"
}
}
]
}
],
"groups": [
{
"title": "Functions",
"children": [
1
1,
3
]
}
],
Expand Down Expand Up @@ -153,6 +262,26 @@
"packageName": "@wtasnorg/node-lib",
"packagePath": "src/hello.ts",
"qualifiedName": "hello"
},
"3": {
"packageName": "@wtasnorg/node-lib",
"packagePath": "src/pojo.ts",
"qualifiedName": "pojo"
},
"4": {
"packageName": "@wtasnorg/node-lib",
"packagePath": "src/pojo.ts",
"qualifiedName": "pojo"
},
"5": {
"packageName": "@wtasnorg/node-lib",
"packagePath": "src/pojo.ts",
"qualifiedName": "T"
},
"6": {
"packageName": "@wtasnorg/node-lib",
"packagePath": "src/pojo.ts",
"qualifiedName": "instance"
}
},
"files": {
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/hello.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> **hello**(): `Promise`\<`string`\>

Defined in: [hello.ts:6](https://github.com/wtasg/node-lib/blob/be4189222f32cc9b2fdf81c380cde5c51f69046c/src/hello.ts#L6)
Defined in: [hello.ts:6](https://github.com/wtasg/node-lib/blob/890fd5e866d9096470d56594a5788bf55e34bf7c/src/hello.ts#L6)

A sample function that should work to test if lib is installed correctly.

Expand Down
35 changes: 35 additions & 0 deletions docs/functions/pojo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[**@wtasnorg/node-lib**](../README.md)

***

[@wtasnorg/node-lib](../globals.md) / pojo

# Function: pojo()

> **pojo**\<`T`\>(`instance`): `Record`\<`string`, `any`\>

Defined in: [pojo.ts:10](https://github.com/wtasg/node-lib/blob/890fd5e866d9096470d56594a5788bf55e34bf7c/src/pojo.ts#L10)

Convert a class instance into a plain JavaScript object.
Copies only the instance's own enumerable data properties
and excludes methods or prototype values.

## Type Parameters

### T

`T` *extends* `object`

## Parameters

### instance

`T`

A class instance to convert.

## Returns

`Record`\<`string`, `any`\>

A plain JavaScript object containing only data fields.
1 change: 1 addition & 0 deletions docs/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
## Functions

- [hello](functions/hello.md)
- [pojo](functions/pojo.md)
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wtasnorg/node-lib",
"version": "0.0.4",
"version": "0.0.5",
"description": "node library",
"main": "src/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { hello } from "./hello.js";
export { hello };
import { pojo } from "./pojo.js";
export { hello, pojo };
//# sourceMappingURL=index.d.ts.map
3 changes: 2 additions & 1 deletion src/index.js

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

6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { hello } from "./hello.js";
import { pojo } from "./pojo.js";

export { hello };
export {
hello,
pojo
};
Loading