@melchyore/adonis-cache
Version:
Cache package for AdonisJS V5
19 lines (18 loc) • 622 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const crypto_1 = __importDefault(require("crypto"));
class Utils {
static isFunction(value) {
return typeof value === 'function';
}
static sha1(str) {
return crypto_1.default.createHash('sha1').update(str).digest('hex');
}
static chunks(str, length) {
return str.match(new RegExp(`.{1,${length}}`, 'g')) ?? [];
}
}
exports.default = Utils;