Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsonapi-checker-lib

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonapi-checker-lib - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

test/spec/header/contentType.test.js

2

package.json
{
"name": "jsonapi-checker-lib",
"version": "0.0.2",
"version": "0.0.3",
"description": "Lib to check some input follows the JSON API specifications",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -17,5 +17,3 @@ 'use strict';

'attributes.isObject',
() => {
expect(obj).to.be.an('object')
}
() => expect(obj).to.be.an('object')
);

@@ -31,3 +29,3 @@

});
}
};
};

@@ -118,3 +118,3 @@ 'use strict';

});
}
};
};

@@ -19,20 +19,2 @@ 'use strict';

Assertion.addMethod('Fields', function () {
const value = this._obj;
const ownFieldKeys = _.keys(value);
const otherFieldKeys = _.keys(otherFields);
const intersectionFieldKeys = _.intersection(ownFieldKeys, otherFieldKeys);
ruleValidator.forEach(
value,
(v, key) => expect(key).be.FieldName()
);
ruleValidator(
'fields.commonNamespace',
() => expect(intersectionFieldKeys).to.be.empty,
intersectionFieldKeys[0]
);
});
Assertion.addMethod('MemberName', function () {

@@ -70,3 +52,3 @@ const value = this._obj;

});
}
};
};

@@ -71,3 +71,3 @@ 'use strict';

});
}
};
};

@@ -28,2 +28,13 @@ 'use strict';

});
Assertion.addMethod('ValidHeaders', function() {
const ruleValidator = require('./rules/validator')(_);
const givenHeaders = this._obj;
const expectedContentType = 'application/vnd.api+json';
ruleValidator(
'serverHeaders.contentType',
() => expect(givenHeaders.contentType).to.be.equals(expectedContentType)
);
});
}

@@ -30,0 +41,0 @@ );

@@ -78,3 +78,3 @@ 'use strict';

});
}
};
};

@@ -143,3 +143,3 @@ 'use strict';

});
}
};
};

@@ -115,3 +115,3 @@ 'use strict';

});
}
};
};

@@ -14,3 +14,3 @@ 'use strict';

throw new Error('An error should be thrown');
} catch(error) {
} catch (error) {
validator(error);

@@ -37,3 +37,3 @@ }

});
}
};
};

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc