Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.

spliced/xeo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

quickstart[4.21KB]

xeo has no dependencies, just drop it into your html:

<script src="/path/to/xeo-min.js"></script>
<script>
  let doublePlusOne = xeo.exec([2, 3, 4], '&+ *2')
  console.log(doublePlusOne)
  //  [5, 7, 9]
</script>

exec(array, fns[, fold])

let arr = ['here', 'are', 'some', 'strings', 'in an array']
let smallChunk = xeo.exec(arr, '/2 :<8')
console.log(smallChunk)
//  [['he','re'],['ar'],['so','me'],['st','ri','ng']]
let thisYear = new Date().getFullYear()
let bornAfter = (data,target) => xeo.exec(data, `:>${(thisYear - target)}`)
let after1984 = bornAfter([22, 38, 46, 77, 11, 43, 72, 19, 24, 26, 26, 22], 1984)
console.log(after1984)
//  [38, 46, 77, 43, 72]
let votes = [{color: 'red'},{color: 'blue'},{color: 'red'}]
let colorCount = (data,color) => xeo.exec(data, `@color`).filter(n => n[0]===color).length
let redCount = colorCount(votes, 'red')
console.log(redCount)
//  2

docs styled with pug and less

Releases

No releases published

Packages

No packages published