- Add GETTING_STARTED.md with quick start guide and development modes - Add INSTALL.sh automated installation script - Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md - Add QUICK_REFERENCE.md for common commands - Add SETUP_GUIDE.md with detailed setup instructions - Update README.md with improved project overview - Add did-wallet app dependencies and node_modules
19 lines
442 B
JavaScript
19 lines
442 B
JavaScript
import {
|
|
Token,
|
|
Type
|
|
} from '../lib/token.js';
|
|
export function dateDecoder(obj) {
|
|
if (typeof obj !== 'string') {
|
|
throw new Error('expected string for tag 1');
|
|
}
|
|
return new Date(obj);
|
|
}
|
|
export function dateEncoder(obj) {
|
|
if (!(obj instanceof Date)) {
|
|
throw new Error('expected Date for "Date" encoder');
|
|
}
|
|
return [
|
|
new Token(Type.tag, 0),
|
|
new Token(Type.string, obj.toISOString().replace(/\.000Z$/, 'Z'))
|
|
];
|
|
} |