deno.land / x / mongoose@6.7.5 / test / helpers / projection.test.js

projection.test.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';
const assert = require('assert');const isSubpath = require('../../lib/helpers/projection/isSubpath');
describe('isSubpath', function() { it('handles single-part paths', function(done) { assert.equal(isSubpath('a', 'a'), true); assert.equal(isSubpath('a', 'b'), false);
done(); });
it('handles multi-part paths', function(done) { assert.equal(isSubpath('a.b.c', 'a.b.c'), true); assert.equal(isSubpath('a.c.b', 'a.b.c'), false); assert.equal(isSubpath('a', 'a.b.c'), true); assert.equal(isSubpath('a.b.c', 'a'), false);
done(); });});
mongoose

Version Info

Tagged at
a year ago