thinkful-ui
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "thinkful-ui", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Shared navigation and UI resources for Thinkful.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.es6", |
@@ -180,12 +180,19 @@ require('./availability_grid.less'); | ||
_digestBitmap(bitmap) { | ||
const MAX_SLOTS_HOUR = 4; | ||
const HOURS_DAY = 24; | ||
const BITS_SLOT = MAX_SLOTS_HOUR / this.props.slotsHour; | ||
// split the bitmap into day-size chunks | ||
let dayRegex = new RegExp(`.{1,${this.props.slotsHour * 24}}`, 'g') | ||
let dayBitmaps = bitmap.match(dayRegex) | ||
let dayRegex = new RegExp(`.{1,${MAX_SLOTS_HOUR * HOURS_DAY}}`, 'g'); | ||
let slotRegex = new RegExp(`.{1,${BITS_SLOT}}`, 'g'); | ||
let availableString = '1'.repeat(BITS_SLOT); | ||
let daysData = this.state.days; | ||
let dayBitmaps = bitmap.match(dayRegex); | ||
if (dayBitmaps) { | ||
dayBitmaps.map((dayBitmap, dayIndex) => { | ||
dayBitmap.split('').map((slotValue, slotIndex) => { | ||
daysData[dayIndex].slots[slotIndex].selected = slotValue === '1'; | ||
let slotBitmaps = dayBitmap.match(slotRegex); | ||
slotBitmaps.map((slotValue, slotIndex) => { | ||
daysData[dayIndex].slots[slotIndex].selected = slotValue === availableString; | ||
}) | ||
@@ -192,0 +199,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71033
748
1