Files

489 B
Raw Permalink Blame History

chroma_trail.js — getSpec() (satır 182)

← chroma_trail.js · ← Master

function getSpec(st) {
    var id = st.has(K_BLOCK) ? trim(st.getString(K_BLOCK)) : "";
    var meta = st.has(K_META) ? Math.floor(st.getNumber(K_META)) : DEFAULT_META;
    if (id.length === 0) {
        id = DEFAULT_BLOCK;
        meta = DEFAULT_META;
    }
    if (!(meta >= 0 && meta <= 15)) meta = 0;
    return { id: id, meta: meta };
}