New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

joi-rfc3339ish

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

joi-rfc3339ish

Apple's documentation on the date formats of the dates returned with receipt verification is incorrect. [Some parts of the documentation](https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

README

Apple's documentation on the date formats of the dates returned with receipt verification is incorrect. Some parts of the documentation suggest that the format is based on RFC3339 — which it isn't. Other documentation states it's "a date-time format similar to ISO 8601" — which may sound helpful, but it isn't as it's not quite the same.

That's annoying. Especially if you want to validate if the data that is getting returned is meeting your expectations so that you can parse it.

This library provides an extension of Joi adding support stating that the format is like RFC3339 — but not quite it.

Usage

npm install joi-rfc3339ish
yarn add joi-rfc3339ish
const Joi = require('@hapi/joi').extend('joi-rfc3339ish');

const schema = Joi.object().keys({
  date: Joi.rfc3339ish(),
});

// Throws
Joi.attempt({ date: '2018-11-13 16:46:31' }, schema);

// Does not throw
const validated = Joi.attempt({ date: '2018-11-13 16:46:31 Etc/GMT' }, schema);
validated.date; // A Moment.js moment with the timezone set correctly.

Helpful?

Is this helpful? Perhaps not. It turns out that the majority of the frameworks are using the _ms version of dates also included in the payloads returned by the Appstore. But if you were ever aiming for a complete Joi schema defining the payloads returned by Apple, you might still find this helpful.

FAQs

Package last updated on 01 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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