Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
14478b4
(docs): fixed small errors
0xflotus Jul 12, 2020
b0c8779
Fix error when converting Date object (instead of datestring) to Date
sumbricht Jun 17, 2020
9cc5356
1.5.2
Neos3452 Jul 12, 2020
06ecf4a
Whitelist package contents
MatthiasKunnen Jul 14, 2020
c901086
Type descriptors and Map shapes
Neos3452 May 29, 2020
b83d87f
1.6.0-rc1
Neos3452 Jul 15, 2020
77a6f57
Allow to define type hints and resolver on classes
Neos3452 Jul 26, 2020
0a58761
Replace if-else with type strategy
Neos3452 Jul 26, 2020
7c88c2d
1.6.0-rc2
Neos3452 Jul 26, 2020
8b09481
Improve TypeScript config
MatthiasKunnen Aug 26, 2020
f208fef
Add editorconfig
MatthiasKunnen Aug 26, 2020
3d611ea
Use 4 space indent in webpack.config.js
MatthiasKunnen Aug 26, 2020
4b901ea
Add linter
MatthiasKunnen Aug 26, 2020
84ae29e
Apply linter autofix
MatthiasKunnen Aug 26, 2020
10243a6
Reformat for max-len: 100
MatthiasKunnen Aug 26, 2020
e8b188e
Unified signatures
MatthiasKunnen Aug 27, 2020
b20ca2b
Deal with useless constructor linter error
MatthiasKunnen Aug 27, 2020
3fedb12
Fix member ordering
MatthiasKunnen Aug 27, 2020
980f19f
Format pass
MatthiasKunnen Aug 27, 2020
4116761
Fix strict boolean expressions
MatthiasKunnen Aug 27, 2020
7d23820
Fix filename casing -> kebab-case
MatthiasKunnen Aug 27, 2020
18aefe9
Fix negated conditions
MatthiasKunnen Aug 27, 2020
35a63f1
Merge if in json-member
MatthiasKunnen Aug 27, 2020
c5898d1
Fix empty block in just-json.spec.ts
MatthiasKunnen Aug 27, 2020
03ccff8
Fix var usage in polymorphism-nested-arrays.spec.ts
MatthiasKunnen Aug 27, 2020
afc8890
Fix TYPE_MAP usage/assignment location
MatthiasKunnen Aug 27, 2020
34056b9
Do not return in typeHintEmitter
MatthiasKunnen Aug 27, 2020
7e8cc1c
Fix function name in to-json.ts
MatthiasKunnen Aug 27, 2020
a9e0468
Fix strict type predicates
MatthiasKunnen Aug 27, 2020
2049f8b
Replace boolean + bitwise with indexOf
MatthiasKunnen Aug 27, 2020
80406d6
Ignore double ~ until intent is clear
MatthiasKunnen Aug 27, 2020
ca107e0
Ignore custom jasmine type in matchers.ts
MatthiasKunnen Aug 27, 2020
e80a0bf
Replace equal with tripe equal comparison
MatthiasKunnen Aug 27, 2020
16ab9c5
Allow @ts-ignore on delete TypedJSON._globalConfig
MatthiasKunnen Aug 27, 2020
b385969
Update CI Node matrix to supported versions
MatthiasKunnen Aug 27, 2020
f7b3068
Prevent double build on commit
MatthiasKunnen Aug 27, 2020
4a86e04
Configure linter for jasmine specific rules
MatthiasKunnen Aug 28, 2020
6d334be
Remove todo for isValueDefined OR expression
MatthiasKunnen Aug 28, 2020
758d336
Remove memberName empty array padding in serializer
MatthiasKunnen Aug 28, 2020
ac19b32
Fix refactor of comments in everything.ts
MatthiasKunnen Aug 28, 2020
7a7de63
Make null checks more defensive for user supplied values
MatthiasKunnen Aug 28, 2020
360ea5f
Rename name -> customName in createKnownTypesMap
MatthiasKunnen Aug 28, 2020
05750ef
Remove unneeded comments in parser.ts
MatthiasKunnen Aug 28, 2020
128c077
Make null checks even more defensive in getOptionValue
MatthiasKunnen Aug 28, 2020
9fabbbf
Add | null to all optional input properties
MatthiasKunnen Aug 28, 2020
b009edc
Improve debug member names for collections
Neos3452 Aug 30, 2020
893eb1b
Run CI on pull request
MatthiasKunnen Aug 30, 2020
acc5187
Test handling of dates before epoch
MatthiasKunnen Aug 27, 2020
7299139
Test shouldOmitParseString
MatthiasKunnen Aug 28, 2020
2ebb3af
Fix shouldOmitParseString handling of numbers for dates
MatthiasKunnen Aug 28, 2020
6c84059
Fix negative timestamp and throw on non-integer
MatthiasKunnen Aug 28, 2020
6e98a01
Add library size limits
Neos3452 Aug 31, 2020
303728c
Separate size limit github action workflow
Neos3452 Aug 31, 2020
022503d
Add npm and license badge
MatthiasKunnen Sep 1, 2020
2c82f84
Switch to Yarn
MatthiasKunnen Sep 1, 2020
610913d
Change build process
MatthiasKunnen Aug 29, 2020
afc88fa
Export options
MatthiasKunnen Sep 2, 2020
fa8dcb8
Allow debugging tests with run test:inspect
MatthiasKunnen Dec 24, 2020
9115801
Implement registering of type to serializer map
MatthiasKunnen Dec 23, 2020
5848219
Test overwriting transformers of mapped types
MatthiasKunnen Dec 24, 2020
cae66e3
Test if mapped types work on arrays
MatthiasKunnen Dec 24, 2020
f5e107a
Clear global config at end of mapped-type test
MatthiasKunnen Jan 3, 2021
9ac939d
Increase budget to 8 KB
MatthiasKunnen Jan 3, 2021
b6bbd77
Tighten mappedTypes type
MatthiasKunnen Jan 3, 2021
f2425c7
Remove unused TypedJSON.mappedTypes
MatthiasKunnen Jan 3, 2021
d063734
Initialize TypedJSON._globalConfig
MatthiasKunnen Jan 3, 2021
d1b3a79
Rename MappedTypeSerializer -> MappedTypeConverters
MatthiasKunnen Jan 3, 2021
e06a28d
Allow mapping only (de)serializer
MatthiasKunnen Jan 3, 2021
7b4fe24
Test mapping Array type
MatthiasKunnen Jan 3, 2021
8accf9e
Test whether undeterminable types throw errors
MatthiasKunnen Dec 23, 2020
205ebcf
Include name of type which could not be determined in error
MatthiasKunnen Dec 23, 2020
709684d
Release 1.6.0-rc3
Neos3452 Jan 4, 2021
6b4582c
v1.6.0-rc4
Neos3452 Jan 6, 2021
01fda86
1.6.0
Neos3452 Jan 21, 2021
db94eee
Implement lazy types
MatthiasKunnen Jan 16, 2021
2c31ecd
Remove randomness from polymorphism test
MatthiasKunnen Jan 16, 2021
bf54d1f
Test lazy types with different files
MatthiasKunnen Jan 21, 2021
630ce2c
Test correct decorator usage for lazy types too
MatthiasKunnen Jan 21, 2021
930b6fb
Use identity for Any type
MatthiasKunnen Jan 21, 2021
cc5d830
Replace Any function with TypeDescriptor
MatthiasKunnen Jan 21, 2021
c5d5fe1
Simplify typeDescriptor handling in json-member.ts
MatthiasKunnen Jan 22, 2021
2b9c498
Test for incorrect usage of jsonMember
MatthiasKunnen Jan 22, 2021
cb5d476
Rename Any -> AnyT, and assign ConcreteTypeDescriptor
MatthiasKunnen Jan 23, 2021
fcd09d5
Process knownTypesDeferred in TypedJSON.parse
MatthiasKunnen Jan 23, 2021
62a81cc
Make lazy types backwards compatible
MatthiasKunnen Jan 26, 2021
c427ed0
Improve unresolvable type error messages
MatthiasKunnen Jan 26, 2021
0e6c864
Update README with backwards compatible lazy types
MatthiasKunnen Jan 26, 2021
015088b
Document mapping types
MatthiasKunnen Jan 22, 2021
62aa57a
Deal with null and undefined in mapType documentation
MatthiasKunnen Jan 23, 2021
158a90d
1.7.0-rc1
Neos3452 Jan 27, 2021
f0038f5
Fix AnyT documentation in README
MatthiasKunnen Jan 27, 2021
5d3aadd
Fix deserializers in mapType documentation
MatthiasKunnen Jan 27, 2021
3909df7
Fix BigInt example in README
MatthiasKunnen Jan 27, 2021
b1b688a
Update readme.md
JohnWeisz Jan 28, 2021
dd73d24
Update readme.md
JohnWeisz Jan 28, 2021
b430920
Prevent unused imports, variables, ...
MatthiasKunnen Jan 30, 2021
1bb5dc9
Test AnyT more thoroughly
MatthiasKunnen Jan 28, 2021
bb04847
Fix handling of TypeDescriptor in @jsonMember
MatthiasKunnen Jan 28, 2021
2dbde99
Extract jsonMember decorator factory to avoid casting
MatthiasKunnen Jan 28, 2021
dc5a5c7
Fix no space in cannot resolve dedected property error
MatthiasKunnen Jan 28, 2021
1f23358
Remove unused imports
MatthiasKunnen Jan 30, 2021
4ca000d
Test reference equality instead of instance of in any tests
MatthiasKunnen Jan 30, 2021
28346c0
Add serialization test for AnyT
MatthiasKunnen Jan 30, 2021
695dea3
Remove circular reference between types and type-descriptor
MatthiasKunnen Jan 30, 2021
3da2036
Use TypeLike where appropriate
MatthiasKunnen Jan 30, 2021
25d2e9f
Stop testing (de)serialization of classes for AnyT
MatthiasKunnen Jan 30, 2021
4e90056
Rename AnyT referential equality tests
MatthiasKunnen Feb 2, 2021
7c8394f
Create isTypeThunk function
MatthiasKunnen Feb 2, 2021
24ee8ed
1.7.0-rc2
Neos3452 Feb 2, 2021
59abc1e
Fix reflected type check for Array/Set/Map
MatthiasKunnen Feb 3, 2021
dc4dee8
Replace usages of prototype builtins
MatthiasKunnen Feb 3, 2021
4c0330b
1.7.0-rc3
Neos3452 Feb 5, 2021
2143845
1.7.0
Neos3452 Feb 28, 2021
82e69c4
Update readme.md on parser
NeoWu1216 Mar 5, 2021
b9faf17
fallback for custom deserializers and serializers (#174)
amoscatelli Mar 7, 2021
fd436e1
1.8.0-rc1
Neos3452 Mar 7, 2021
698bb39
Export MapShape enum
sebastianst Oct 11, 2021
210b9fa
Run yarn upgrade
Neos3452 Oct 13, 2021
6f886ae
1.8.0
Neos3452 Oct 13, 2021
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
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.json]
indent_size = 2

[*.md]
max_line_length = off
trim_trailing_whitespace = false

[*.{yaml,yml}]
indent_size = 2
75 changes: 75 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---

env:
es6: true
node: true

overrides:
-
files:
- '*.js'
extends:
- '@matthiaskunnen/eslint-config-base'

-
env:
jasmine: true
files:
- 'spec/**/*.ts'
extends:
- '@matthiaskunnen/eslint-config-typescript'

parser: '@typescript-eslint/parser'

parserOptions:
project:
- tsconfig/tsconfig.lint.json
sourceType: module

plugins:
- jasmine

rules:
'@typescript-eslint/no-use-before-define': off
func-names: off
jasmine/expect-matcher: error
jasmine/expect-single-argument: error
jasmine/missing-expect: error
jasmine/named-spy: off # We might consider this
jasmine/no-assign-spyon: error
jasmine/no-describe-variables: error
jasmine/no-disabled-tests: error
jasmine/no-expect-in-setup-teardown: error
jasmine/no-focused-tests: error
jasmine/no-global-setup: error
jasmine/no-pending-tests: warn
jasmine/no-promise-without-done-fail: error
jasmine/no-spec-dupes:
- error
- branch
jasmine/no-suite-callback-args: error
jasmine/no-suite-dupes: error
jasmine/no-unsafe-spy: error
jasmine/prefer-jasmine-matcher: error

-
files:
- 'src/**/*.ts'
extends:
- '@matthiaskunnen/eslint-config-typescript'

parser: '@typescript-eslint/parser'

parserOptions:
project:
- tsconfig/tsconfig.lint.json
sourceType: module
rules:
'@typescript-eslint/no-use-before-define':
- error
-
classes: true
enums: true
functions: false
variables: true
typedefs: true
15 changes: 9 additions & 6 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Node CI

on: [push]
on: [pull_request, push]

jobs:
build:
Expand All @@ -9,18 +9,21 @@ jobs:

strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
- name: yarn install, lint, build, and test
run: |
npm ci
npm run build --if-present
npm test
yarn install --frozen-lockfile
yarn run lint
yarn run build
yarn run coverage
yarn run test:ts
yarn run size
env:
CI: true
21 changes: 21 additions & 0 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "size"

on: [pull_request]

jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
-
name: yarn install
run: |
yarn install --frozen-lockfile
env:
CI: true
- uses: andresz1/size-limit-action@v1.4.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_step: install
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ bin
node_modules
packages
coverage
/lib
nuget
nupkg
obj
Properties
temp
.eslintcache
.idea
.nyc_output
*.cs
Expand All @@ -26,4 +28,3 @@ temp
**\nuget
**\nupkg
__*

12 changes: 0 additions & 12 deletions .npmignore

This file was deleted.

136 changes: 0 additions & 136 deletions js/parser.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions js/typedjson.d.ts

This file was deleted.

Loading