This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Luhn = { | |
// length of our number (check digit included) | |
length: 10, | |
pow2: [0, 2, 4, 6, 8, 1, 3, 5, 7, 9], | |
// compute check digit | |
checksum: function (x) { | |
var sum = 0; | |
var n; | |
var odd = false; | |
for (var i = x.length - 1; i >= 0; --i) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const fs = require('fs'); | |
const models = require('../models'); | |
for (const model in models) { | |
const tableName = models[model].tableName; | |
let defaultValue = ''; | |
let onUpdate = ''; |