import DataStoreManagerConstants from "./constants" ; export function checkKey ( key ) { if ( key . length === 0 || key . length > DataStoreManagerConstants . DFInt . DataStoreKeyLengthLimit ) { throw new Error ( `Key cannot be blank or be more than ${ DataStoreManagerConstants . DFInt . DataStoreKeyLengthLimit } characters!` ) ; } return true ; } export function checkPlaceId ( placeId ) { if ( placeId < 1 ) { throw new Error ( `Place ID must be greater than 1` ) ; } return true ; } export function checkName ( name ) { if ( name . length === 0 || name . length > DataStoreManagerConstants . DFInt . DataStoreKeyLengthLimit ) { throw new Error ( `DataStore name cannot be blank or be more than ${ DataStoreManagerConstants . DFInt . DataStoreKeyLengthLimit } characters!` ) ; } return true ; } export function checkScope ( scope ) { if ( scope . length === 0 || scope . length > DataStoreManagerConstants . DFInt . DataStoreKeyLengthLimit ) { throw new Error ( `DataStore scope cannot be blank or be more than ${ DataStoreManagerConstants . DFInt . DataStoreKeyLengthLimit } characters!` ) ; } return true ; } export function checkValue ( value ) { if ( value . length === 0 || value . length > DataStoreManagerConstants . DFInt . DataStoreMaxValueSize ) { throw new Error ( `DataStore values cannot be blank or be more than ${ DataStoreManagerConstants . DFInt . DataStoreMaxValueSize } characters!` ) ; } return true ; }