Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

ts-japi

Package Overview
Dependencies
0
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.3 to 1.7.0

.commitlintrc.ts

11

.github/ISSUE_TEMPLATE/bug_report.md
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] {{issue name}}"
title: '[BUG] {{issue name}}'
labels: bug
assignees: jun-sheaf
---
## Describe the bug<sup>*</sup>
## Describe the bug<sup>\*</sup>
{{A clear and concise description of what the bug is.}}
## To Reproduce<sup>*</sup>
## To Reproduce<sup>\*</sup>
{{Add steps/examples to reproduce the behavior.}}
## Expected behavior<sup>*</sup>
## Expected behavior<sup>\*</sup>

@@ -26,3 +25,3 @@ {{A clear and concise description of what you expected to happen.}}

## Platform<sup>*</sup>
## Platform<sup>\*</sup>

@@ -29,0 +28,0 @@ - [ ] OS: {{ Write the OS name and its version }}

---
name: Feature request
about: Suggest an idea for this project
title: "[FR] {{feature request name}}"
title: '[FR] {{feature request name}}'
labels: enhancement
assignees: jun-sheaf
---
## Is your feature request related to a problem? <sup>*</sup>
## Is your feature request related to a problem? <sup>\*</sup>
{{A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]}}
## Describe the solution you'd like<sup>*</sup>
## Describe the solution you'd like<sup>\*</sup>
{{A clear and concise description of what you want to happen.}}
## Describe alternatives you've considered<sup>*</sup>
## Describe alternatives you've considered<sup>\*</sup>

@@ -20,0 +19,0 @@ {{A clear and concise description of any alternative solutions or features you've considered.}}

---
name: Request for comments
about: Request for comments around the community.
title: "[RFC] {{RFC name}}"
title: '[RFC] {{RFC name}}'
labels: good first issue, question
assignees: jun-sheaf
---
## Summary<sup>*</sup>
## Summary<sup>\*</sup>
{{One paragraph explanation of the change}}
## Motivation<sup>*</sup>
## Motivation<sup>\*</sup>

@@ -21,3 +20,3 @@ {{

## Design Detail<sup>*</sup>
## Design Detail<sup>\*</sup>

@@ -31,3 +30,3 @@ {{

## Drawbacks<sup>*</sup>
## Drawbacks<sup>\*</sup>

@@ -40,48 +39,36 @@ {{

## Rationale and Alternatives<sup>*</sup>
## Rationale and Alternatives<sup>\*</sup>
{{
Why is this design the best in the space of possible designs?
{{ Why is this design the best in the space of possible designs?
What other designs have been considered and what is the rationale for not
choosing them?
What other designs have been considered and what is the rationale for not choosing them?
What is the impact of not doing this?
}}
What is the impact of not doing this? }}
## Prior Art<sup>*</sup>
## Prior Art<sup>\*</sup>
{{
Discuss prior art, both the good and the bad, in relation to this proposal. A
few examples of what this can include are:
{{ Discuss prior art, both the good and the bad, in relation to this proposal. A few examples of
what this can include are:
{{
How other services / infrastructures in the same domain have solved this
problem.
{{ How other services / infrastructures in the same domain have solved this problem.
Are there any published papers or great posts that discuss this? If you have
some relevant papers to refer to, this can serve as a more detailed
theoretical background.
}}
Are there any published papers or great posts that discuss this? If you have some relevant papers to
refer to, this can serve as a more detailed theoretical background. }}
This section is intended to encourage you as an author to think about the
lessons from other organisations, provide readers of your RFC with a fuller
picture. If there is no prior art, that is fine - your ideas are interesting
whether they are brand new or if it is an adaptation from other services.
}}
This section is intended to encourage you as an author to think about the lessons from other
organisations, provide readers of your RFC with a fuller picture. If there is no prior art, that is
fine - your ideas are interesting whether they are brand new or if it is an adaptation from other
services. }}
## Unresolved questions<sup>*</sup>
## Unresolved questions<sup>\*</sup>
{{
What parts of the design do you expect to resolve through the RFC process
before this gets merged?
{{ What parts of the design do you expect to resolve through the RFC process before this gets
merged?
What parts of the design do you expect to resolve through the implementation of
this feature before stabilisation?
What parts of the design do you expect to resolve through the implementation of this feature before
stabilisation?
What related issues do you consider out of scope for this RFC that could be
addressed in the future independently of the solution that comes out of this
RFC?
}}
What related issues do you consider out of scope for this RFC that could be addressed in the future
independently of the solution that comes out of this RFC? }}
\* means required.
# Changelog
## [1.7.0](https://github.com/mathematic-inc/ts-japi/compare/v1.6.3...v1.7.0) (2022-08-05)
### Bug Fixes
* ignore relationships if they're not set to support optional relations ([#49](https://github.com/mathematic-inc/ts-japi/issues/49)) ([7bd7d53](https://github.com/mathematic-inc/ts-japi/commit/7bd7d5372c96841583dce9bd01a8bbb4cb220b8e))
## 1.6.2

@@ -4,0 +11,0 @@

@@ -53,4 +53,4 @@ import { RelatorOptions } from '../interfaces/relator.interface';

/** @internal Creates a {@link Relationship}. */
getRelationship(data: PrimaryType, relatedDataCache?: Dictionary<any>[]): Promise<Relationship>;
getRelationship(data: PrimaryType, relatedDataCache?: Dictionary<any>[]): Promise<Relationship | undefined>;
}
//# sourceMappingURL=relator.d.ts.map

@@ -100,3 +100,7 @@ "use strict";

relationshipOptions.meta = meta;
return new relationship_model_1.default(relationshipOptions);
let relationship;
if (relatedData !== undefined || meta || links) {
relationship = new relationship_model_1.default(relationshipOptions);
}
return relationship;
}

@@ -103,0 +107,0 @@ }

@@ -115,3 +115,6 @@ "use strict";

}
relationships[name] = await relator.getRelationship(data, relatedDataCache);
const relationship = await relator.getRelationship(data, relatedDataCache);
if (relationship) {
relationships[name] = relationship;
}
}));

@@ -118,0 +121,0 @@ resourceOptions.relationships = relationships;

@@ -13,7 +13,15 @@ "use strict";

return false;
return (['id', 'status', 'code', 'title', 'detail', 'source', 'links', 'meta'].some((attrName) => attrName in error) &&
[
['id', 'status', 'code', 'title', 'detail'].every((attrName) => !(attrName in error) || typeof error[attrName] === 'string'),
['source', 'links', 'meta'].every((attrName) => !(attrName in error) || (0, is_object_1.isObject)(error[attrName])),
].every((v) => v));
const hasErrorKeys = [
'id',
'status',
'code',
'title',
'detail',
'source',
'links',
'meta',
].some((attrName) => attrName in error);
const expectedStringKeys = ['id', 'status', 'code', 'title', 'detail'].every((attrName) => !(attrName in error) || error[attrName] === undefined || typeof error[attrName] === 'string');
const expectedObjectKeys = ['source', 'links', 'meta'].every((attrName) => !(attrName in error) || error[attrName] === undefined || (0, is_object_1.isObject)(error[attrName]));
return hasErrorKeys && [expectedStringKeys, expectedObjectKeys].every((v) => v);
}

@@ -20,0 +28,0 @@ /** @internal */

{
"name": "ts-japi",
"version": "1.6.3",
"version": "1.7.0",
"description": "A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification",
"main": "lib/index.js",
"scripts": {
"test": " jest --runInBand --verbose --coverage",
"api-extractor": "api-extractor run",
"benchmark": "ts-node ./benchmarks/serializer.benchmark",
"build": "tsc",
"clean": "make clean",
"commitlint": "commitlint --from=HEAD~1",
"docs": "npm run api-extractor && ts-node tools/generate_docs.ts",
"format": "run-s format:*",
"format:prettier": "prettier --write .",
"format:eslint": "eslint --fix .",
"examples": "ts-node ./examples/",
"lint": "run-s lint:*",
"lint:prettier": "prettier --check .",
"lint:eslint": "eslint .",
"playground": "ts-node ./benchmarks/playground.benchmark",
"lint": "eslint .",
"examples": "ts-node ./examples/",
"docs": "npm run api-extractor && ts-node tools/generate_docs.ts",
"clean": "make clean",
"build": "tsc",
"benchmark": "ts-node ./benchmarks/serializer.benchmark",
"api-extractor": "api-extractor run"
"prepare": "husky install",
"test": "jest --runInBand --verbose --coverage"
},

@@ -49,2 +56,4 @@ "publishConfig": {

"@changesets/cli": "^2.23.0",
"@commitlint/cli": "^17.0.1",
"@commitlint/config-conventional": "^17.0.2",
"@microsoft/api-documenter": "^7.18.0",

@@ -65,4 +74,6 @@ "@microsoft/api-extractor": "^7.28.2",

"eslint-plugin-tsdoc": "^0.2.16",
"husky": "^8.0.1",
"jest": "^28.1.2",
"lodash": "^4.17.21",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",

@@ -69,0 +80,0 @@ "regenerator-runtime": "^0.13.9",

{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"lib": [
"es2020",
"dom"
],
"declaration": true, /* Generates corresponding '.d.ts' file. */
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./lib/", /* Redirect output structure to the directory. */
"rootDir": "./src/", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"strictFunctionTypes": true, /* Enable strict checking of function types. */
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"resolveJsonModule": true,
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
/* Advanced Options */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": [
"src"
]
}
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"lib": ["es2020", "dom"],
"declaration": true /* Generates corresponding '.d.ts' file. */,
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
"sourceMap": true /* Generates corresponding '.map' file. */,
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./lib/" /* Redirect output structure to the directory. */,
"rootDir": "./src/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
"downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */,
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
"strictNullChecks": true /* Enable strict null checks. */,
"strictFunctionTypes": true /* Enable strict checking of function types. */,
"strictBindCallApply": true /* Enable strict 'bind', 'call', and 'apply' methods on functions. */,
"strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */,
"noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */,
"alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */,
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"resolveJsonModule": true,
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
/* Advanced Options */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": ["src"]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc