How to use string-natural-compare - 8 common examples

To help you get started, we’ve selected a few string-natural-compare examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github laurent22 / joplin / ReactNativeClient / lib / components / screens / NoteTagsDialog.js View on Github external
tagListData.sort((a, b) => {
			return naturalCompare.caseInsensitive(a.title, b.title);
		});
github bartveneman / css-analyzer-diff / src / diff-lists.js View on Github external
	return (a, b) => caseInsensitiveCompare(a, b)
}
github oVirt / ovirt-web-ui / src / components / VmsListNavigation / index.js View on Github external
      .sort((vmA, vmB) => naturalCompare.caseInsensitive(vmA.get('name'), vmB.get('name')))
github projectwallace / css-analyzer / src / analyzer / selectors / identifiers.js View on Github external
function sortByIdentifiersCount(a, b) {
  if (a.count === b.count) {
    return stringCompare(a.value, b.value)
  }

  return b.count - a.count
}
github projectwallace / css-analyzer / src / analyzer / rules / index.js View on Github external
.sort((a, b) => {
      if (a.selectors.length === b.selectors.length) {
        return compareStrings.caseInsensitive(
          a.selectors.join(''),
          b.selectors.join('')
        )
      }

      return a.selectors.length - b.selectors.length
    })
  const ruleWithLeastSelectors = [...rulesSortedBySelectorCount].shift()
github RoboPhred / oni-duplicity / src / pages / SaveEditor / components / Sidebar / components / SaveStructureTree / components / SaveStructureItem / derived-state.ts View on Github external
return childItems.sort((a, b) => {
      const aTitle = getSaveItemTitle(a, saveGame);
      const bTitle = getSaveItemTitle(b, saveGame);
      return naturalCompare(aTitle, bTitle);
    });
  }
github SeleniumHQ / selenium-ide / packages / selenium-ide / src / neo / models / Suite.js View on Github external
      ? this._tests.sort((t1, t2) => naturalCompare(t1.name, t2.name))
      : this._tests

string-natural-compare

Compare alphanumeric strings the same way a human would, using a natural order algorithm

MIT
Latest version published 4 years ago

Package Health Score

65 / 100
Full package analysis

Popular string-natural-compare functions