[build] update slices conversion to JS