How to use the unix-permissions.contain function in unix-permissions

To help you get started, we’ve selected a few unix-permissions 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 ehmicky / unix-permissions / examples / methods / contain.js View on Github external
// This file can be run in a terminal with the following commands:
//
//   npm install unix-permissions
//   node node_modules/unix-permissions/examples/methods/contain.js
//
// An online demo is also available at:
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { contain } = require('unix-permissions')

console.log(contain('--x--x--x', 'a=x')) // `true`

console.log(contain('--x--x--x', 'a+x')) // `true`

console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`
github ehmicky / unix-permissions / examples / methods / contain.js View on Github external
'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { contain } = require('unix-permissions')

console.log(contain('--x--x--x', 'a=x')) // `true`

console.log(contain('--x--x--x', 'a+x')) // `true`

console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`

console.log(contain('o+x,o-w', 'o+x', 'o-w')) // `true`
github ehmicky / unix-permissions / examples / methods / contain.js View on Github external
//
// An online demo is also available at:
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { contain } = require('unix-permissions')

console.log(contain('--x--x--x', 'a=x')) // `true`

console.log(contain('--x--x--x', 'a+x')) // `true`

console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`

console.log(contain('o+x,o-w', 'o+x', 'o-w')) // `true`
github ehmicky / unix-permissions / examples / methods / contain.js View on Github external
// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { contain } = require('unix-permissions')

console.log(contain('--x--x--x', 'a=x')) // `true`

console.log(contain('--x--x--x', 'a+x')) // `true`

console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`

console.log(contain('o+x,o-w', 'o+x', 'o-w')) // `true`
github ehmicky / unix-permissions / examples / methods / contain.js View on Github external
const { contain } = require('unix-permissions')

console.log(contain('--x--x--x', 'a=x')) // `true`

console.log(contain('--x--x--x', 'a+x')) // `true`

console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`

console.log(contain('o+x,o-w', 'o+x', 'o-w')) // `true`
github ehmicky / unix-permissions / examples / methods / contain.js View on Github external
console.log(contain('--x--x--x', 'a=x')) // `true`

console.log(contain('--x--x--x', 'a+x')) // `true`

console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`

console.log(contain('o+x,o-w', 'o+x', 'o-w')) // `true`
github ehmicky / unix-permissions / examples / methods / contain.js View on Github external
console.log(contain('--x--x--x', 'a+x')) // `true`

console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`

console.log(contain('o+x,o-w', 'o+x', 'o-w')) // `true`
github ehmicky / unix-permissions / examples / methods / contain.js View on Github external
//   npm install unix-permissions
//   node node_modules/unix-permissions/examples/methods/contain.js
//
// An online demo is also available at:
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { contain } = require('unix-permissions')

console.log(contain('--x--x--x', 'a=x')) // `true`

console.log(contain('--x--x--x', 'a+x')) // `true`

console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`

console.log(contain('o+x,o-w', 'o+x', 'o-w')) // `true`
github ehmicky / unix-permissions / examples / methods / contain.js View on Github external
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { contain } = require('unix-permissions')

console.log(contain('--x--x--x', 'a=x')) // `true`

console.log(contain('--x--x--x', 'a+x')) // `true`

console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`

console.log(contain('o+x,o-w', 'o+x', 'o-w')) // `true`
github ehmicky / unix-permissions / examples / methods / contain.js View on Github external
console.log(contain('--x--x--x', 'a-x')) // `false`

console.log(contain('--x--x--x', 'a-w')) // `true`

console.log(contain('o+x', 'o+x')) // `true`

console.log(contain('o+x', 'o+x,o+x')) // `true`

console.log(contain('o+x', 'o=w')) // `false`

console.log(contain('o+x,o-w', 'o-w,o+x')) // `true`

console.log(contain('o+x,o-w', 'o-w')) // `true`

console.log(contain('o+x,o-w', 'o+x', 'o-w')) // `true`