Sha256: d1c1244822755943690e885fdc20c5b681cec4010458e4e6bc3c61364cc7a248
Contents?: true
Size: 636 Bytes
Versions: 24
Compression:
Stored size: 636 Bytes
Contents
'use strict'; const cmp = require('semver/functions/cmp'); const semver = require('semver/functions/coerce'); const has = Function.call.bind({}.hasOwnProperty); function compare(a, operator, b) { return cmp(semver(a), operator, semver(b)); } function intersection(list, order) { const set = list instanceof Set ? list : new Set(list); return order.filter(name => set.has(name)); } function sortObjectByKey(object, fn) { return Object.keys(object).sort(fn).reduce((memo, key) => { memo[key] = object[key]; return memo; }, {}); } module.exports = { compare, has, intersection, semver, sortObjectByKey, };
Version data entries
24 entries across 23 versions & 7 rubygems