Match測(cè)試 JSON 數(shù)據(jù)的 JavaScript 庫(kù)
Match是一個(gè)可以通過使用一些良好的性能去測(cè)試JSON數(shù)據(jù)的JavaScript庫(kù)。
安裝:
npm install @ozkxr/match
用法:
比較基元
// Numbers
match(3.1415, 3.1415) // => true
//Strings
match('Uno Dos Tres', 'Uno Dos Tres') // => true
// Booleans
match(false, false) // => true
// And with undefined and null values
match(undefined, undefined) // => true
match(null, null) // => true
結(jié)構(gòu)(對(duì)象和數(shù)組):
match({ name: 'Link', color: 'green' }, { name: 'Link', color: 'green' }) // => true
match([ 'deku', 'goron', 'zora' ], [ 'deku', 'goron', 'zora' ]) // => true評(píng)論
圖片
表情
