mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
30 lines
542 B
CoffeeScript
30 lines
542 B
CoffeeScript
_ = require 'underscore'
|
|
_.mixin require 'underscore.string'
|
|
|
|
module.exports = p = (url) ->
|
|
ob = {}
|
|
|
|
# remove qs
|
|
url = _.first url.split "?"
|
|
[__..., mode, cachekey, filename] = url.split "/"
|
|
|
|
|
|
if mode is "dev"
|
|
[__..., name, devopt, ext] = filename.split "."
|
|
[type, uid] = devopt.split "-"
|
|
ob.dev =
|
|
uid: uid
|
|
type: type
|
|
else
|
|
[__..., name, ext] = filename.split "."
|
|
ob.min = true
|
|
|
|
ob.name = name
|
|
ob.ext = ext
|
|
|
|
return ob
|
|
|
|
|
|
if require.main is module
|
|
console.info p "/pile/dev/my.exec-123.js"
|