fix exports; remove tests
This commit is contained in:
parent
b2f19f1e0c
commit
1e3d8588ac
3 changed files with 3 additions and 37 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
out/
|
out/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
src/test.ts
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
export * as ser from './ser'
|
export * as ser from './ser'
|
||||||
export * as de from './de'
|
export * as de from './de'
|
||||||
export * as json from './json'
|
export * as json from './json'
|
||||||
|
export * from './decorator'
|
||||||
|
export * from './options'
|
||||||
|
|
||||||
|
|
37
src/test.ts
37
src/test.ts
|
@ -1,37 +0,0 @@
|
||||||
import { CaseConvention } from './case'
|
|
||||||
import { deserialize } from './de'
|
|
||||||
import { Serde, serde } from './decorator'
|
|
||||||
import { fromString, toString } from './json'
|
|
||||||
import { serialize } from './ser'
|
|
||||||
|
|
||||||
const InnerStruct = deserialize(serialize(
|
|
||||||
class {
|
|
||||||
c = 'awawa'
|
|
||||||
}))
|
|
||||||
|
|
||||||
const TestStruct = deserialize(serialize(
|
|
||||||
serde({ renameAll: CaseConvention.PascalCase })(
|
|
||||||
class {
|
|
||||||
a = 1
|
|
||||||
b
|
|
||||||
inner = new InnerStruct()
|
|
||||||
d = true
|
|
||||||
e = Math.pow(2, 53)
|
|
||||||
f = Symbol('test')
|
|
||||||
g = [1, 'a', [3]]
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.b = new Map()
|
|
||||||
this.b.set('test key', 2)
|
|
||||||
}
|
|
||||||
})))
|
|
||||||
|
|
||||||
const test = new TestStruct()
|
|
||||||
console.log(test)
|
|
||||||
const value = toString(test)
|
|
||||||
console.log('A', value)
|
|
||||||
const test2 = fromString(value, TestStruct)
|
|
||||||
console.log(test2)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue