Skip to content

Instantly share code, notes, and snippets.

@Lily418
Created June 7, 2019 15:00
Show Gist options
  • Select an option

  • Save Lily418/fd31ab30e3903b7c72f64f53307426b8 to your computer and use it in GitHub Desktop.

Select an option

Save Lily418/fd31ab30e3903b7c72f64f53307426b8 to your computer and use it in GitHub Desktop.
import {
rankWith,
scopeEndsWith
} from '@jsonforms/core';
export default rankWith(
Number.MAX_VALUE,
(x) => {
if(!x.elements) {
return false
}
const lastElement = x.elements[x.elements.length - 1]
return lastElement.scope && lastElement.scope.endsWith("unit")
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment