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
// Generates two conditional methods | |
// 1. (isBroken: true, method: 'some') filters the abandoned shipments | |
// 2. (isBroken: false, method: 'every') filters the ready shipments | |
function checkShipment(isBroken, method) { | |
return function (curShipment) { | |
return curShipment.packagesList[method](function (curPackage) { | |
return curPackage.isBroken === isBroken; | |
}); | |
}; | |
} |
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
function getSameCharStrings(strings) { | |
const repeatedCharsOrSpaceRegex = /(\w)(?=.*\1)|\s/g; | |
const uniqueSortedChars = strings.map(word => { | |
return word | |
.replace(repeatedCharsOrSpaceRegex, '') | |
.split('') | |
.sort() | |
.join(''); | |
}); | |
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
const path = require('path'); | |
const pascalCase = require('pascal-case'); | |
const {stringifyRequest} = require('loader-utils'); | |
const {stringifySymbol, stringify} = require('../../lib/utils'); | |
module.exports = function ({symbol, config, context, loaderContext}) { | |
const {spriteModule, symbolModule, runtimeOptions} = config; | |
const compilerContext = loaderContext._compiler.context; | |
const iconModulePath = path.resolve(compilerContext, runtimeOptions.iconModule); |
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
const test = (regex, base) => base && base.name && regex.test(base.name); | |
const isStart = ({ base }) => test(/^start-/, base); | |
const isFull = ({ base }) => !test(/^start-/, base); | |
const baseMachine = Machine({ | |
id: 'base', | |
initial: 'init', | |
context: { | |
startBase: null, | |
base: {} |
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
const statusMachine = Machine({ | |
id: "status", | |
type: "parallel", | |
states: { | |
info: { | |
initial: "Created", | |
states: { | |
Created: { | |
on: { | |
OFFICIALLY_SCHEDULED: "OfficiallyScheduled" |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
{"lastUpload":"2022-01-28T20:16:28.891Z","extensionVersion":"v3.4.3"} |