Skip to content

Commit

Permalink
Merge pull request #75 from balena-io/json-schema-is-valid
Browse files Browse the repository at this point in the history
Remove skhema as dependency
  • Loading branch information
flowzone-app[bot] authored Dec 20, 2024
2 parents e807cff + dffa41e commit 8679ae4
Show file tree
Hide file tree
Showing 4 changed files with 421 additions and 8 deletions.
10 changes: 5 additions & 5 deletions lib/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import range from 'lodash/range';
import reduce from 'lodash/reduce';
import some from 'lodash/some';
import uniqWith from 'lodash/uniqWith';
import { isValid } from 'skhema';
import { bigCombination } from 'js-combinatorics';
import { compare, satisfies, valid, validRange } from 'semver';

import { isValid } from './json-schema';
import ObjectSet from './object-set';
import MatcherCache from './matcher-cache';
import { hashObject } from './hash';
Expand Down Expand Up @@ -180,7 +180,7 @@ export default class Contract {
* const contract = new Contract({ ... })
* contract.interpolate()
*/
interpolate(options: object = { rehash: Boolean }): Contract {
interpolate(options: object = { rehash: Boolean }): this {
// TODO: Find a way to keep track of whether the contract
// has already been fully templated, and if so, avoid
// running this function.
Expand Down Expand Up @@ -384,7 +384,7 @@ export default class Contract {
* const contract = new Contract({ ... })
* contract.addChild(new Contract({ ... }))
*/
addChild(contract: Contract, options: object = {}): Contract {
addChild(contract: Contract, options: object = {}): this {
const type = contract.getType();
if (this.metadata.children.map[contract.metadata.hash]) {
return this;
Expand Down Expand Up @@ -433,7 +433,7 @@ export default class Contract {
* contract.addChild(child)
* contract.removeChild(child)
*/
removeChild(contract: Contract, options: object = {}): Contract {
removeChild(contract: Contract, options: object = {}): this {
defaults(options, {
rehash: true,
});
Expand Down Expand Up @@ -486,7 +486,7 @@ export default class Contract {
* new Contract({ ... })
* ])
*/
addChildren(contracts: Contract[] = [], options: object = {}): Contract {
addChildren(contracts: Contract[] = [], options: object = {}): this {
if (!contracts) {
return this;
}
Expand Down
Loading

0 comments on commit 8679ae4

Please sign in to comment.